1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00
Commit Graph

764 Commits

Author SHA1 Message Date
Patrick Thomson
dade361ae8 Bump tree-sitter-php to 0.1.0.1.
This fixes associativity bugs in the PHP grammar.
2019-09-10 11:56:13 -04:00
Patrick Thomson
7f833f08f5 Bump tree-sitter versions. 2019-09-09 11:39:29 -04:00
Patrick Thomson
2790f59882
Merge branch 'master' into python-test-programs 2019-08-30 09:34:09 -04:00
Timothy Clem
691f1fd3e9 Switch over to lingo on hackage 2019-08-19 11:37:15 -07:00
Timothy Clem
0aab5ebd55 Replace supportedExts 2019-08-15 15:48:17 -07:00
Timothy Clem
2510df0e23 Switch over to using lingo 2019-08-14 16:01:55 -07:00
Patrick Thomson
5acd975b1b trying to get test cases in shape 2019-08-13 14:01:50 -04:00
Timothy Clem
61186c946d ++0.7.0.0 2019-07-31 09:45:17 -07:00
Timothy Clem
d8ad7f2b25
Merge branch 'master' into proto-rework 2019-07-16 08:36:39 -07:00
Patrick Thomson
f401f75303 WIP 2019-07-06 10:52:38 -04:00
Timothy Clem
7b44a6a24e Repeatable code gen from proto 2019-07-05 15:11:33 -07:00
Rob Rix
9ea288a36d
Merge branch 'master' into semantic-python 2019-06-25 10:08:47 -07:00
Patrick Thomson
6dda3251e7 Remove servant dependency.
This has no place here; downstream consumers can link in servant, but
we don't have any need to.
2019-06-23 16:43:41 -04:00
Patrick Thomson
dd8446c909 Drop the transformers dependency. 2019-06-20 14:13:54 -04:00
Patrick Thomson
b1a2b85d87 Merge remote-tracking branch 'origin/master' into machines-to-streaming 2019-06-20 14:09:39 -04:00
Patrick Thomson
0564b9d36c Eliminate mtl dependency. 2019-06-20 13:50:50 -04:00
Rob Rix
a483615f21
Stub in a module for generic s-expression serialization of precise ASTs. 2019-06-20 10:53:48 -04:00
Patrick Thomson
17407c0c9d Initial port from machines to streaming. 2019-06-20 09:41:27 -04:00
Patrick Thomson
4de36c5f0e Rewrite the Stat tests so they're not racy. 2019-06-19 17:54:53 -04:00
Patrick Thomson
8ae90e53c5 Quiet debug spew in specs.
This console barf makes reading though backscrolls unpleasant. Using
Shelly rather than an abomination of a `system` call and adding a
helper function to parse files quietly improved the situation greatly.

This also contains changes to Util that make the file significantly
easier to navigate, thanks to the power of `PartialTyepSignatures`.

Fixes #140.
2019-06-19 12:09:37 -04:00
Rob Rix
31d396ee91
Merge branch 'master' into semantic-python 2019-06-17 10:54:55 -04:00
Rob Rix
30fd1b4abf
Merge branch 'master' into remove-orphan-bytestring-listable 2019-06-14 16:34:13 -04:00
Patrick Thomson
e1d94f07d1 Remove Listable instance for Source.
This was created with a whole mess of Leancheck combinators. A
Hedgehog approach makes things easier.
2019-06-14 11:53:42 -04:00
Jan Hrček
7aa0d8b3d9 Enable GHC warnings in tests 2019-06-14 15:35:18 +02:00
Patrick Thomson
668d1f396f Require Cabal 2.4. 2019-06-13 14:20:22 -04:00
Patrick Thomson
b8cb9d1bfa Remove unused imports. 2019-06-12 12:52:11 -04:00
Patrick Thomson
11442cf772 Add more bounds. 2019-06-12 12:37:40 -04:00
Patrick Thomson
99c4bb21f8 Overhaul test harnesses and add tasty bounds. 2019-06-12 11:30:20 -04:00
Rob Rix
dd352cb9c5
Add extra-source-files to semantic. 2019-06-11 11:25:56 -04:00
Rob Rix
32c7698aba
Change the category for semantic to Language. 2019-06-11 11:25:34 -04:00
Rob Rix
83a6c6ca78
Make the different cabal files line up. 2019-06-11 11:25:11 -04:00
Rob Rix
40e9999b02
Add bug-reports fields. 2019-06-11 11:23:38 -04:00
Rob Rix
7ec058c38d
Fix a disagreement between the LICENSE file and Copyright field. 2019-06-11 11:12:58 -04:00
Patrick Thomson
039e187819 Fix travis invocation and add more bounds. 2019-06-11 11:05:10 -04:00
Patrick Thomson
90562edd53 Fixes for build time. 2019-06-10 15:03:59 -04:00
Patrick Thomson
dcf4a577f7 Use Hackage package rather than submodules. 2019-06-10 13:29:11 -04:00
joshvera
6b13145862 Move jsxElements out of TypeScript grammar
Also removes typeAssertion from TSX grammar
2019-06-06 16:37:29 -04:00
joshvera
a8a36adc81 Merge remote-tracking branch 'origin/master' into typescript-mapped-types 2019-06-06 15:27:59 -04:00
Patrick Thomson
9aebd13e5b
Merge branch 'master' into fail-all-of-the-tests-at-once-and-explode-into-space 2019-06-06 02:40:01 -04:00
Rob Rix
87209d3eee
🔥 MiniPython & MiniRuby. 2019-06-05 17:05:14 -04:00
joshvera
33e267151a WIP 2019-06-05 14:17:12 -04:00
Patrick Thomson
79fa92e9e6 Bump minimum base version to 4.12.0.0.
This should hopefully provide a more informative error message when
someone attempts to build the project with too old of a GHC.
2019-06-05 10:38:51 -04:00
Patrick Thomson
3e1f3bcb9f Remove redundant HasSpan class.
We already have a classy-lenses-style HasSpan class, provided by Data.Span itself, so we don't need Data.Abstract.HasSpan.
2019-06-04 14:40:09 -04:00
Rob Rix
f79ba2ae36
Merge branch 'master' into move-grammar-datatypes-to-the-parser-packages 2019-06-03 15:22:56 -04:00
Rob Rix
2646f89948
Move the grammar datatypes for all the other languages into their respective packages. 2019-06-03 14:14:04 -04:00
Patrick Thomson
1932332b96 Merge remote-tracking branch 'origin/master' into if-any-monad-is-not-freer-then-I-too-am-bound 2019-06-03 13:40:49 -04:00
Rob Rix
0fa39f6131
🔥 Language.JSON.Grammar. 2019-06-03 13:23:16 -04:00
Rob Rix
f9579b1ed6
🤠 fix the author field in the cabal file.
https://github.com/github/semantic/graphs/contributors seemed too lengthy to fit in there and we didn’t want to leave people out, so we went with “The Semantic authors” to cover everybody.
2019-06-03 12:40:15 -04:00
Rob Rix
930b5c01c6
🤠 fix the repo URL in the cabal file. 2019-06-03 12:39:04 -04:00
Rob Rix
e6145c6217
Don’t depend on freer-cofreer. 2019-06-03 12:18:15 -04:00
Patrick Thomson
a7f6806298 Fix cabal build. (#4)
- Remove cmark-gfm direct dependency.
- Fix submodule paths.
- Pin to versioned fused-effects packages.
2019-05-31 08:58:35 -04:00
Douglas Creager
cf803555e5 Make error reporter API generic
Instead of hard-coding the HTTP API we use for uploading errors to our
internal service, let the user provide an arbitrary function (in the IO
monad) for uploading them.  The default config will create an error
reporter that logs errors to the console, just like happened before if
you didn't set the `HAYSTACK_URL` environment variable.
2019-05-31 08:58:34 -04:00
Patrick Thomson
b2bbda5fca Specify version bounds in .cabal file (#1)
Establish library bounds based on Stackage LTS 13.13.

We use the new cabal `^>=` operator to establish PVP-compatible versioning.
2019-05-31 08:58:17 -04:00
Douglas Creager
afea75f86f Add license and maintainer to cabal file 2019-05-31 08:37:44 -04:00
Patrick Thomson
a410300492 Add tests for readBlobsFromGitRepo.
This is part of the critical path for repository tagging, so we should
test it to make sure it doesn't explode. This introduces a test that
creates a temporary git repo and queries it to make sure that adding
and then reading from a blob works properly.
2019-05-28 14:54:18 -04:00
Patrick Thomson
a0f87c3c12 Remove -dynamic flag from cabal file.
We originally put this here because we were recompiling
haskell-tree-sitter on every ghci reload, and it sped up the process
of linking the built haskell-tree-sitter into ghci. Now that we
compile haskell-tree-sitter once, its use is no longer applicable, and
it interferes with profiling builds.
2019-05-28 12:12:12 -04:00
Patrick Thomson
789fcde288 Merge branch 'master' into blob-depends-on-file 2019-05-24 12:46:16 -04:00
Patrick Thomson
59583c6105 Ensure parse-examples gets passed the -threaded flag. 2019-05-24 12:09:48 -04:00
Patrick Thomson
9509ec37b8 absolutely massive patch that touches everything 2019-05-21 22:05:23 -04:00
Patrick Thomson
70463f79f9 Remove cubic-caller problem. 2019-05-15 18:21:07 -04:00
Patrick Thomson
895677c88e Add fused-effects-exceptions. 2019-05-15 18:04:07 -04:00
Patrick Thomson
065c4688ef Remove unused protobuf-related files.
For some reason that escapes me at the moment, I chose to put these
files in the main tree rather than in services/alephd.
2019-04-29 10:58:51 -04:00
Timothy Clem
0de9099578 Fix parse-examples 2019-04-12 12:54:12 -07:00
Timothy Clem
7840aec67b Fix specs 2019-04-12 12:50:30 -07:00
Timothy Clem
40c4c1f657 Cleanup 2019-04-12 11:45:07 -07:00
Timothy Clem
aef2d62b1b Move Git functionality into semantic 2019-04-12 11:40:03 -07:00
Patrick Thomson
ecea375520 Eliminate boolean blindness with tagged flags a la olegfi. 2019-03-22 16:25:04 -04:00
Josh Vera
f2c6a50c2d Merge branch 'master' into use-external-exceptions-package 2019-03-19 16:06:53 -04:00
Max Brunsfeld
3c0dd6cc45 Add unit test for parsing with a timeout
Co-Authored-By: Rick Winfrey <rewinfrey@github.com>
2019-03-19 11:56:07 -07:00
Patrick Thomson
139b0c5bd1 Use external fused-effects-exceptions package.
This was OSS'd because it turned out to be a little tricky and we
didn't want external consumers to have to implement it themselves. No
reason to keep it around in our tree.
2019-03-19 10:34:13 -04:00
joshvera
a9e4a71fd0 Move catchSync to Control.Effect.Catch 2019-03-18 12:56:46 -04:00
Patrick Thomson
b92d9a5382 Rename Helpers to Bridge. 2019-03-01 15:27:13 -05:00
Josh Vera
8c654caacc Merge branch 'indexer-prototype' into merge-indexer-prototype 2019-02-22 17:33:53 -05:00
joshvera
f2aee684bc Merge remote-tracking branch 'origin/master' into indexer-prototype 2019-02-22 11:10:53 -05:00
joshvera
ffc53d3877 Merge remote-tracking branch 'origin/indexer-prototype' into merge-indexer-prototype 2019-02-21 12:22:08 -05:00
Timothy Clem
fcf0f3896d Merge remote-tracking branch 'origin/master' into embrace-new-api 2019-02-20 14:51:31 -08:00
Rick Winfrey
9d884e4af3 Merge branch 'master' into indexer-prototype 2019-02-20 12:09:23 -08:00
joshvera
be4250707d Merge remote-tracking branch 'origin/indexer-prototype' into deploy-to-moda 2019-02-20 14:23:18 -05:00
Timothy Clem
af321dfd23 Revert "Let's call it 1.0!"
This reverts commit ec8377ca30b15b29c49aec9ed5cb3811b7c07ff4.
2019-02-20 08:27:46 -08:00
Timothy Clem
f2116d9ed8 Let's call it 1.0! 2019-02-19 16:33:33 -08:00
Patrick Thomson
07fbfbc965 examples require process package 2019-02-19 16:11:28 -05:00
Patrick Thomson
1d600e199c Factor out common executable flags 2019-02-19 14:31:16 -05:00
Patrick Thomson
50b55b084f Test consolidating ghc-options in library stanza 2019-02-19 14:22:16 -05:00
Patrick Thomson
6daf9be738 Factor out common libraries. 2019-02-19 14:20:33 -05:00
Patrick Thomson
8418290224 Factor out common GHC extensions. 2019-02-19 13:54:14 -05:00
Patrick Thomson
6b763dd5e9 Fix tests. 2019-02-15 17:55:15 -05:00
Timothy Clem
cbd83d5bb9 This warrents a version bump 2019-02-15 13:34:17 -08:00
Patrick Thomson
c7b41a3594 Merge remote-tracking branch 'origin/master' into indexer-prototype-no-sg 2019-02-15 14:05:23 -05:00
Timothy Clem
cc78c0d8d5 Case Api as generated 2019-02-12 12:49:34 -08:00
joshvera
e73fcc57a5 Move DCOMPUTE_GIT_SHA to cpp-options 2019-02-11 15:08:24 -05:00
joshvera
c9724d2720 Merge 'origin/master' into deploy-to-moda 2019-02-11 14:27:22 -05:00
joshvera
4fd258182e Merge remote-tracking branch 'origin/indexer-prototype' into deploy-to-moda 2019-02-11 13:56:08 -05:00
joshvera
dd106278b3 Add getSpan so we don't have to eval a term
Co-Authored-By: Rob Rix <robrix@github.com>
2019-02-11 13:15:13 -05:00
Timothy Clem
6083803d68 Bring in twirp-haskell and generate everything from protos 2019-02-08 13:52:34 -08:00
joshvera
867d1867c0 remove Data.GitHub.Spec 2019-02-08 15:46:46 -05:00
Patrick Thomson
7db320f6a5 Consolidate a number of unused modules. 2019-02-08 14:43:15 -05:00
Patrick Thomson
6b5f5c11de Gut Semantic.Lens and move lensy declarations near their datatypes 2019-02-08 14:14:19 -05:00
Patrick Thomson
fbf4b443b4 Move tag to its own file and add a couple lenses 2019-02-08 12:05:59 -05:00
Timothy Clem
50bedeb689 Remove extraneous proto encoding/decode from our internal datatypes 2019-02-06 14:55:43 -08:00
Timothy Clem
edc9adb197 Install and use hlint directly 2019-02-04 15:19:10 -08:00
joshvera
e99f85e7a1 Merge remote-tracking branch 'origin/master' into indexer-prototype 2019-02-04 17:17:45 -05:00
joshvera
a4d892811f Merge remote-tracking branch 'origin/master' into indexer-prototype 2019-02-01 16:03:16 -05:00
Timothy Clem
635f09fe29 ++version to 0.5.0 2019-01-31 15:41:08 -08:00
Timothy Clem
f14412fe8f Merge remote-tracking branch 'origin/master' into servant-experiment 2019-01-31 12:57:59 -08:00
Patrick Thomson
4701a91c02 move SQL stuff out of Core and add Catch effect 2019-01-31 14:37:40 -05:00
Timothy Clem
d3330aa9f3 Dedicated input types for Blob and BlobPair 2019-01-28 14:37:50 -08:00
Timothy Clem
1faff05a2b Remove some un-used code 2019-01-25 10:12:38 -08:00
Patrick Thomson
13ac7b4942 Last stage of the great renaming 2019-01-24 13:23:59 -05:00
Patrick Thomson
46969defce Pull in upstream proto3-suite and kill the Exts module. 2019-01-24 13:13:47 -05:00
Patrick Thomson
92b5549d01 Move Envelope 2019-01-24 13:02:11 -05:00
Patrick Thomson
869bd26cae Move User.hs 2019-01-24 12:59:48 -05:00
Patrick Thomson
3cd4ffc9c3 RequestContext, RequestMethod, and RepositoryPush 2019-01-24 12:57:50 -05:00
Patrick Thomson
469151d180 Move Data/GitHub/Repository 2019-01-24 12:48:15 -05:00
Patrick Thomson
c6f4f0fea0 Move Data.GitHub.Git to Data.Git 2019-01-24 12:40:22 -05:00
Timothy Clem
9e9bbc1e68 Dedicated paths for legacy formatting of symbols and toc output 2019-01-24 08:34:37 -08:00
Timothy Clem
be138f7362 Add in parse tree graph endpoint 2019-01-23 14:53:29 -08:00
Timothy Clem
6befe07ea3 Remove rest of old diff renderers and Diff.hs 2019-01-22 12:05:45 -07:00
Timothy Clem
5e6d0240b2 Use the new diff api from the CLI, fix up tests again 2019-01-22 11:42:06 -07:00
Timothy Clem
154e0388af Goodbye Semantic.Parse 2019-01-18 16:04:23 -08:00
Timothy Clem
9f222adcd3 Show and Quiet outputs 2019-01-18 12:37:49 -08:00
Timothy Clem
f23110a73a Transition sexpression term rendering 2019-01-18 09:29:51 -08:00
Timothy Clem
e3afd9d684 Symbol rendering is entirely on the new path 2019-01-17 15:13:39 -08:00
Timothy Clem
8d5d3e45da Factor back in the toc summary endpoint, now supported in twirp too 2019-01-17 14:00:13 -08:00
Timothy Clem
01af025638 Move parse back into semantic 2019-01-16 15:39:07 -08:00
Rick Winfrey
439e9ff9ae Update remaining 2019-01-15 12:27:09 -08:00
Timothy Clem
26b771715f Wire in Twirp ping and symbols endpoints, disable grpc entirely 2019-01-15 08:45:20 -08:00
Patrick Thomson
34cfa42584 rename spec and add toByteString 2019-01-11 12:27:47 -05:00
Patrick Thomson
b29633e0d6 Move the user type into User. 2019-01-11 11:58:13 -05:00
Patrick Thomson
a4bd06f6be Fix nomenclature and modules. 2019-01-11 11:20:58 -05:00
Patrick Thomson
60b024dd13 Fix the members that I omitted. 2019-01-10 19:01:19 -05:00
Patrick Thomson
d7ad7e9fce Add Repository entity and make sure they get pushed in repo pushes 2019-01-10 16:22:34 -05:00
Josh Vera
d4e9ab09a9 Merge pull request #2326 from github/add-hydro-data-types
Add data types for Kafka event messages.
2019-01-10 13:16:52 -05:00
Rick Winfrey
136af86301 Merge branch 'master' into visibility-resolution 2019-01-08 17:32:14 -08:00
joshvera
b23352e163 Merge remote-tracking branch 'origin/master' into indexer-prototype 2019-01-08 15:54:43 -05:00
Patrick Thomson
2894edd428 Include Push events in the cabal file. 2019-01-08 15:30:12 -05:00
Patrick Thomson
39bdfdf01f Add Hydro data types corresponding to proposed push schema.
Provides a `Push` type. To build that, we needed `RequestContext`,
`UserType`, `RequestMethod`, `Spamurai`, `Timestamp`, and `IPVersion`.

The schemas have all been taken from https://github.com/github/hydro-schemas/.
2019-01-08 13:55:09 -05:00
Patrick Thomson
1302fe4ac8 Use -XDerivingVia to clean up our Semigroup/Monoid instances.
Now that we're on GHC 8.6, we can use `-XDerivingVia` in many cases
where we previously had to write instances by hand. If you're not
familiar with `-XDerivingVia`, the [GHC proposal][ghc] is a good place
to start.

[ghc]: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0023-deriving-via.rst

Thanks to the `generic-monoid` package, we can derive a `Semigroup`
instance for any product type whose members are `Semigroups`, and the
same goes for `Monoid`. This entails an extra dependency, but it is
better than the `generic-deriving` package, which is way too much overhead.
I've also switched some trivial definitions to newtype-deriving.

Please be aware that this bumps `hlint` and `haskell-src-exts` so that
`hlint` doesn't choke on the `DerivingVia` extension. You'll need to
`stack install hlint` to get it on your `PATH`. Apologies!
2019-01-07 11:23:11 -05:00
joshvera
b5af73c088 Merge remote-tracking branch 'origin/master' into add-references-to-indexer-prototype 2019-01-04 15:00:43 -05:00
Patrick Thomson
955f30617c Depend on hostname instead of Network.BSD. 2018-12-29 15:02:42 -05:00
Patrick Thomson
d32f5cd5ca Merge branch 'master' into lts-13.0 2018-12-29 14:17:48 -05:00
Patrick Thomson
9852155a77 Upgrade to LTS 13.0 and GHC 8.6.3.
Bumps most of our dependencies.

Code changes:
* algebraic-graphs-0.3 no longer provides a Foldable or Traversable
  implementation for `Graph`, so now neither does our `Graph` type.
* CMark parsing now uses safe rendering of raw HTML/URLs by default,
  so there is no reason to pass an `optSafe` anymore.
* algebraic-graphs now no longer requires an Eq constraint on the
  output type it generates, so we can ditch our Serializing.DOT
  module. (Andrey fixed this for us specifically!)
2018-12-29 14:02:24 -05:00
Rick Winfrey
960d56fdcf Add Visibilities instances 2018-12-19 19:11:02 -08:00
Rick Winfrey
3adaf47a4f Define a Visibilities type class 2018-12-19 19:10:49 -08:00
joshvera
9f86c1b7d1 Move Taggable instances to their own module 2018-12-19 16:27:33 -05:00
Patrick Thomson
5d46cb211e Split up typescript grammar even more 2018-12-18 16:25:32 -05:00
Rob Rix
594979543c 🔥 Located. 2018-12-13 12:04:24 -05:00
Rob Rix
595f0fa2a3 Whitespace error. 2018-12-13 12:04:06 -05:00
Patrick Thomson
684a752773 remove Semantic.Util.Rewriting 2018-12-11 17:47:13 -05:00
Patrick Thomson
e329cbe89a unify the last spec 2018-12-11 17:36:42 -05:00
Patrick Thomson
1de0e9ef09 move specs around 2018-12-11 17:21:39 -05:00
Patrick Thomson
1f44f81acc Unify Control.Rewriting and Control.Matching. 2018-12-11 17:12:24 -05:00
Rob Rix
fa950f3239 🔥 Data.Abstract.Ref. 2018-12-10 11:37:00 -05:00
joshvera
1914a94500 Add -dynamic in test debug builds as well 2018-12-05 11:28:21 -05:00
joshvera
9b8a93bc04 Replace -static with -dynamic in non-release builds
Improves performance in the repl since we don't have to link statically.
2018-12-05 11:25:12 -05:00
joshvera
03e5546ec1 Add -O0 to tests to reduce compilation times 2018-12-05 10:25:21 -05:00
joshvera
49e8a7004c Remove Exports 2018-12-05 10:23:42 -05:00
joshvera
26d3e5e449 Remove Environment 2018-12-05 09:42:00 -05:00
joshvera
70fa31f11e Fix expectation of sequence expression test 2018-11-29 18:38:32 -05:00
joshvera
f39da9578a Move ImportPath to Data.ImportPath 2018-11-16 16:09:11 -05:00
Timothy Clem
57f284f847 Streamline the declarations for toc summaries 2018-11-08 08:33:26 -08:00
Timothy Clem
343289f1c5 Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-06 09:17:49 -08:00
Patrick Thomson
7ea52dbfe3 Give Control.Matching API better ergonomics.
Given that @tclem and I have found the matcher API frustrating, I've
taken a stab at improving its ergonomics, and I've found some success
in separating composition of matchers from predicate-based narrowing
thereof.

The biggest change here is the elimination of the old `match`
combinator, which proved to be clumsy in that it complected narrowing
and composition. Top-down matching combinators are now written with
the `need` combinator and the `>>>` combinator, which is more readable
and more versatile. Here's a matcher that accepts functions with
Python docstrings:

```haskell
docstringMatcher :: ( Decl.Function :< fs
                    , [] :< fs
                    , Lit.TextElement :< fs
                    , term ~ Term (Sum fs) ann
                    ) => Matcher term term
docstringMatcher = target <*
               (need Decl.functionBody
                >>> narrow @[]
                >>> mhead
                >>> narrow @Lit.TextElement
                >>> ensure Lit.isTripleQuoted))
```

Pretty readable, right? Each step of the tree regular expression -
choosing function bodies, ensuring said bodies are lists, examining
the first element, and choosing only TextElements containing
triple-quoted strings - is made implicit. The old way would have
looked something like this:

```haskell
docstringMatcher = target <* match Decl.functionBody
                           $ narrow
                           $ matchM listToMaybe
                           $ target <* ensure Lit.isTripleQuoted
```
which is a good deal more disorganized and less flexible
in the quite-common case of applying functions during a
matching pass. Separating the act of composition from
function application is a big win here.

Further comments are inline.
2018-11-02 19:25:29 -04:00
Timothy Clem
0f56f33f24 Introduce some symbol/tags tests 2018-11-02 13:55:30 -07:00
Timothy Clem
63e13ee20c Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-01 16:04:15 -07:00
Timothy Clem
1f6a7b9e48 Move HasTextElement 2018-11-01 14:49:35 -07:00
Patrick Thomson
b9cf8f73c6 Environment and App. 2018-10-31 15:47:30 -04:00
Timothy Clem
d4d19ea21f Some renaming, split out into two modules 2018-10-31 10:58:00 -07:00
Patrick Thomson
d473b9e1af add Data/Abstract/Name/Spec 2018-10-31 13:19:43 -04:00
Patrick Thomson
b0e6190dbf add Data/Range/Spec 2018-10-31 12:46:52 -04:00
Patrick Thomson
cd05aaa7a5 add Data/Graph/Spec 2018-10-31 12:30:56 -04:00
Timothy Clem
945ab01275 Introduce Taggable 2018-10-31 08:34:58 -07:00
Patrick Thomson
cb54dd7aed Merge remote-tracking branch 'origin/master' into repl-effect 2018-10-30 15:58:00 -04:00
Patrick Thomson
3cb8608703 Merge remote-tracking branch 'origin/master' into add-purely-to-matching 2018-10-30 15:00:37 -04:00
Patrick Thomson
da1704af56 Extract the REPL effect into its own module.
I need this for the refactoring OKR.
2018-10-30 14:55:23 -04:00
Patrick Thomson
6b476d0eb7 Add 'purely' combinator to Matching and rename it.
@tclem and I found ourselves wanting an arrow-like combinator that
promotes a given function to a Matcher. While I think an Arrow
instance is going a little overboard, there's no harm in adding a
'purely' function, the naming of which is commensurate with the
rewriting DSL.

This also renames the module, since there's not anything really
abstract about matching (indeed, it is quite concrete).
2018-10-30 11:04:11 -04:00
Rob Rix
636eec364e Update to fused-effects, replace \/ with handleSum and bundle Interpose. 2018-10-29 09:52:48 -04:00
Rob Rix
1414df368d Define a high-level Semantic.Analysis module. 2018-10-25 21:31:38 -04:00
Rob Rix
131cae4d7b Merge branch 'master' into higher-order-effects 2018-10-24 14:04:13 -04:00
Patrick Thomson
ef696d3c41 Split up Semantic.IO.
This looks like a big patch, but it's very straightforward: no
behavior has changed.

After the umpteenth time spent hitting a compile error because I
passed a `FilePath` rather than a `File` to `readBlobFromPath`, I
decided to finally make the needed refactors to Semantic.IO, and to
split off the `File` type and `Files` effect. This patch:

* adds the `MonadIO` class to `Prologue`'s export list
* moves `File` into `Data.File`
* moves `Handle` into `Data.Handle`
* moves `Files` into `Semantic.Task.Files`
* moves functions for reading blobs into `Data.Blob`
* keeps general IO helpers in Semantic.IO
* renames `readFile` to `readBlobFromFile`
* renames `readBlobFromPath` to `readBlobFromFile'`

This should have a positive effect on compile times and ease of
navigation throughout the codebase.
2018-10-23 15:37:49 -04:00
Rob Rix
314aff5d56 Bump higher-order-effects for Resource & some handler helpers. 2018-10-22 20:18:36 -04:00
Patrick Thomson
8800f7072e Turn on -XMonadFailDesugaring globally.
In the past few years, GHC has been moving to remove the `fail` method
from the definition of `Monad`, a longtime wart, and requiring monads
that fail due to an incomplete pattern match to implement `MonadFail`.
You can read about it[here](https://wiki.haskell.org/MonadFail_Proposal).
Though this move is still in progress, we can opt into it by turning
on the `-XMonadFailDesugaring` extension.

The matching and rewriting systems will both benefit from this, as the
incomplete pattern match in following rewrite rule will crash without
`-XMonadFailDesugaring`, even though the sensible and correct thing
for the rule to do is call out to its `MonadFail` instance:

```haskell
-- crashes the program without -XMonadFailDesugaring
getReceiver :: Rule a (Ruby.Send term) term
getReceiver = do
  (Ruby.Send (Just rec) _ _ _) <- target
  pure rec
```

In addition, turning on `MonadFailDesugaring` will warn you if you put
an incomplete pattern match in a monad that doesn't implement `MonadFail`.
This setting will become implicit in GHC 8.6, so this is a good chance
to make sure that we don't introduce any incomplete patterns going forward.
2018-10-22 14:07:48 -04:00
Rob Rix
3ef2efa73a Merge branch 'master' into higher-order-effects 2018-10-22 09:45:57 -04:00
Patrick Thomson
7c8e8c5bf5 Merge remote-tracking branch 'origin/master' into avoid-recompiling-git 2018-10-18 17:22:18 -04:00
Josh Vera
efde121720 Merge branch 'master' into avoid-recompiling-git 2018-10-18 11:28:18 -04:00
Patrick Thomson
f4b5f0d44e [Experiment] Improve compile speed with larger GHC allocation area 2018-10-17 21:27:22 -04:00
Patrick Thomson
379d75f284 Split up Language.Haskell.Syntax into child modules.
This was the longest (in terms of line count) file in the project.
Splitting it up will save on compile time, as it did for TypeScript.
I observe a ~20sec speedup from `stack clean semantic && stack build semantic:lib`
2018-10-17 18:57:29 -04:00
Patrick Thomson
b361c9ef79 Prevent unnecessary recompilation of Semantic.Version in dev mode.
Right now, Semantic.Version is recompiled on every invocation of
`stack build`, since we marked it as `-fforce-recomp` to ensure that
all deployments are tagged appropriately for haystack. However, this
entails a good deal of wasted time during development. With some
liberal application of `CPP`, we can make this recompilation only
happen on CI, thanks to the `release` flag and passing in a compiler
flag.

To test:

* apply the patch
* `stack build semantic`, then `stack exec semantic -- -v`. It should
  print `semantic version 0.4.0 (<development>)`.
* `stack clean semantic && stack build --ghc-options=-DCOMPUTE_GIT_SHA`.
  `stack exec semantic -- -v` should then print out the correct SHA.

Though it's probably not strictly necessary, I've marked the
`semantic` and `semanticd` executables to compile with
-DCOMPUTE_GIT_SHA, just in case.
2018-10-17 17:24:14 -04:00
Patrick Thomson
ac543651ee Add NFData instances to enable more accurate benchmarking.
Because we're getting serious about benchmarking in the run-up to
Windrose, it's time to bring in the `deepseq` package to ensure that
benchmarks can fully evaluate the result of a test case.

The `deepseq` package provides an `NFData` typeclass:

```
class NFData a where
  rnf :: a -> ()
```

Instances use the `seq` combinator to ensure that the argument to
`rnf` is fully evaluated, returning (). If there is a `Generic`
instance for `a`, the implementation can be omitted. This patch adds
NFData for every syntax node, graph vertex, environment data
structures, and exceptions. It is long, but the work is very
straightforward, so don't panick.

The benchmark suite (`stack bench`) now produces more accurate
results. The benchmarks previously mimicked `rnf` by calling `show` on
the result of an evaluation or graph construction; now that we have
actual `NFData` instances we can use the `nfIO` combinator from
criterion. This has sped up the evaluation benchmarks and reduced
their memory consumption, while it has slowed down the call graph
benchmarks, as those benchmarks weren't evaluating the whole of the
graph.

Unfortunately, this patch increases compile times, as we have to
derive a few more Generic instances. I wish this weren't the case, but
there's little we can do about it now. In the future I have some plans
for how to reduce compile time, and I bet that those gains will at
least nullify the speed hit from this patch.

Now that we have NFData instances for every data type, we can start
benchmarking assignments, in preparation for fixing #2205.

This patch also pulls in updates to `effects` and `fastsum` that add
appropriate NFData instances for the data they vend.
2018-10-17 14:08:47 -04:00
Rob Rix
c9e6912068 Port most of the system over to higher-order-effects. 2018-10-16 18:48:08 -04:00
Rob Rix
298d861a20 Add a dependency on higher-order-effects. 2018-10-12 14:08:49 -04:00
Patrick Thomson
d56377aea9 Prevent slowdowns when pretty-printing in ghci.
Right now, when opening a shell with `script/ghci`, you can encounter
a tremendous slowdown by turning on pretty-printing (with `pretty`)
then printing any value (`[0..3]` should work).

This stems from the fact that our `.ghci` specifies the `prettyShow`
function, defined in Semantic.Util, as its `-interactive-print`
function. While this is a good choice of a pretty-printer, the fact
that it is in Util, a file which imports many modules and uses fancy
types, is not good: pretty-printing cannot begin until Util is
recompiled and linked in. This explains why benchmarking this slowdown
revealed nothing but `dlsym` calls: we thought it was due to linking
in the tree-sitter libraries, but it was actually waiting for Util to
compile and link in.

The fix is simple: define `prettyShow` in another module. This should
provide significant speedups to our developer workflow.
2018-10-04 14:38:36 -04:00
Rob Rix
5c2dac35e8 Merge branch 'master' into first-order-closures 2018-09-27 13:37:25 -05:00
Timothy Clem
6b40e59c1d No SplitDiff! 2018-09-27 13:04:51 -05:00
Timothy Clem
c8dfe57a48 Remove Data.Record entirely 2018-09-26 14:05:29 -05:00
Timothy Clem
38a4bb38f2 WIP - replace Record across the project
Not quiet there with Diff and decorators yet
2018-09-21 13:46:25 -07:00
Rob Rix
038b56970e Parameterize Evaluator by the term type. 2018-09-20 12:43:59 -04:00
Patrick Thomson
ba18287311 Merge branch 'master' into reprinting-pipeline-rename 2018-09-19 13:08:52 -04:00
Patrick Thomson
8e1ca410bb Remove Hungarian-style T- prefix from tokens and scopes.
Prefixes on data constructors are generally an antipattern in Haskell:
if you're concerned about name collisions, have clients use qualified
imports for whatever modules they need. As such, this removes the T-
prefixes from the `Token` and `Context` types. This also renames
Context to Scope, which is a more exact and readable name.
2018-09-19 12:38:48 -04:00
Patrick Thomson
22cf72c20f Merge branch 'master' into term-rewriting-mk2 2018-09-19 11:51:28 -04:00
Patrick Thomson
d68c7975d7 Merge branch 'master' into new-take-on-parse-examples 2018-09-18 17:51:22 -04:00
Timothy Clem
6817193cbc Mark assignment timeouts as pending 2018-09-18 13:00:31 -07:00
Patrick Thomson
2dc8bb0041 Merge branch 'master' into term-rewriting-mk2 2018-09-18 15:18:21 -04:00
Rob Rix
13993af2c7 Merge branch 'master' into heap-widening 2018-09-18 14:46:36 -04:00
joshvera
906da72e54 Merge remote-tracking branch 'origin/master' into scopes-and-frames 2018-09-18 12:26:18 -04:00
Patrick Thomson
c2bfde5c95 move Fragment into its own file for clarity's sake 2018-09-18 11:38:10 -04:00
Rob Rix
f3d616fbd1 Merge branch 'master' into heap-widening 2018-09-18 11:17:21 -04:00
Rob Rix
87c609fa1c Duplicate the flow-sensitive caching module. 2018-09-18 10:27:47 -04:00
Rob Rix
58c22658d3 Rename the Caching module to note its flow-sensitivity. 2018-09-18 10:26:50 -04:00
Rob Rix
560c93784c Move the cache into the Caching module. 2018-09-18 10:21:25 -04:00
Rob Rix
86654a2dab Move Configuration into Data.Abstract.Cache. 2018-09-18 10:12:02 -04:00
Rob Rix
51be2081ae 🔥 Control.Abstract.Configuration. 2018-09-18 10:10:03 -04:00
Timothy Clem
38b692b17c Merge remote-tracking branch 'origin/master' into new-take-on-parse-examples 2018-09-17 16:47:00 -07:00
Timothy Clem
31ca888da7 Introduce datatype for these language examples 2018-09-17 16:46:45 -07:00
Timothy Clem
15f7e57571 First pass at doing parse-examples in haskell and hspec 2018-09-17 15:49:18 -07:00
Patrick Thomson
1ba38e3e57 Merge remote-tracking branch 'origin/master' into term-rewriting-mk2 2018-09-17 18:31:44 -04:00
Patrick Thomson
7c35cb524a Merge branch 'master' into bump-synopsis 2018-09-17 16:18:58 -04:00
joshvera
2d071e5090 Remove Data.Abstract.Frame for now 2018-09-17 13:05:24 -04:00
joshvera
5c96b3d6d7 Merge remote-tracking branch 'origin/master' into scopes-and-frames 2018-09-17 12:08:27 -04:00
Patrick Thomson
06b44c4fc9 Replace the "initial project from stack" synopsis.
I figure that since we're starting to show this to other teams, it
behooves our documentation to have a more meaningful description.
Happy to change this if y'all can come up with a snappier synopsis.
2018-09-17 11:21:21 -04:00
joshvera
68ca3b06bc Remove type-combinators dep 2018-09-14 19:04:09 -04:00
Timothy Clem
d2524e194d Merge branch 'master' into assignment-timeout 2018-09-14 14:03:37 -07:00
Patrick Thomson
d1cc400dc0 add spec file 2018-09-14 13:10:22 -04:00
Patrick Thomson
b8b8fe01c9 port over Control.Rewriting 2018-09-14 12:47:21 -04:00
Timothy Clem
a6ce4f672f Docs and sort out a common Duration datatype 2018-09-13 14:51:32 -07:00
Timothy Clem
7e1c7a1c84 Timeout effect 2018-09-13 14:20:42 -07:00
Patrick Thomson
7129435dc8 Merge remote-tracking branch 'origin/master' into simplify-reprinter
also incorporates a number of changes. oops.
2018-09-12 12:14:01 -04:00
Patrick Thomson
0802e0a9f2 Use a deep embedding for Tokenize. 2018-09-11 18:54:37 -04:00
Timothy Clem
2e48678e6b Rework diff grpc api as well, enable for all supported langauges 2018-09-11 10:32:29 -07:00
joshvera
1eac23ce2e Don't parameterize scopes by name 2018-09-10 18:50:40 -04:00
Timothy Clem
c806be4cfc Clean up, expand grpc support to larger language list 2018-09-10 11:43:42 -07:00
Timothy Clem
38e3cba57a Messy, but working multi-lang grpc parsing 2018-09-10 11:15:52 -07:00
Timothy Clem
a15155c4da Basics of TermVertex in grpc 2018-09-06 17:27:13 -07:00
Timothy Clem
f0d164f952 Rework control flow graph data types 2018-09-06 15:12:12 -07:00
joshvera
3ccdbdb692 Merge remote-tracking branch 'origin/master' into scopes-and-frames 2018-09-05 12:54:45 -04:00
joshvera
01af82bf53 WIP 2018-09-04 12:43:14 -04:00
joshvera
3d412f7d9e Add ScopeGraph 2018-08-29 13:47:44 -04:00
Timothy Clem
34648a263a Merge branch 'master' into source-aware-reprinter 2018-08-28 11:34:53 -07:00
Timothy Clem
5da417d01c Some basic pretty printing for mini Python 2018-08-28 09:14:48 -07:00
Timothy Clem
ea01f30de5 Put this back in order 2018-08-28 09:12:44 -07:00
Timothy Clem
8759225ac7 A mini-python 2018-08-28 09:12:29 -07:00
Timothy Clem
57f32c77bd MiniRuby in its own module 2018-08-27 15:06:51 -07:00
joshvera
bc6614aa12 Merge remote-tracking branch 'origin/master' into entry-points 2018-08-27 12:05:20 -04:00
Timothy Clem
e9e8edbebe Dedicated util for rewriting 2018-08-24 10:35:38 -07:00
Timothy Clem
17fbceb17a Remove need for lens 2018-08-23 15:53:43 -07:00
Timothy Clem
8f6d1ee873 Merge branch 'master' into source-aware-reprinter 2018-08-23 07:47:48 -07:00
Timothy Clem
67f652b4d7 Refactor to have 1 additional data representation in the pipeline 2018-08-22 11:30:03 -07:00
Timothy Clem
a1294e91f1 Docs and some renaming 2018-08-21 16:15:08 -07:00
Charlie Somerville
5f6961e737 move Analysis.Abstract.Configuration to Control.Abstract 2018-08-21 13:42:45 +10:00
Charlie Somerville
ec852844cb reshuffle module layout so that Environment can depend on Heap 2018-08-21 13:42:45 +10:00
Timothy Clem
cbdb932af8 Ruby translation step for the pipeline 2018-08-20 18:11:30 -07:00