1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00
Commit Graph

293 Commits

Author SHA1 Message Date
Patrick Thomson
034bb562d4 Introduce tree-automata DSL for filtering and matching ASTs.
This patch adds the `Matcher` monad, which is capable of filtering any
recursive data structure, bottom-up, yielding a list of (or an
optional) result. These functions are probably going to be used over
`Term` values, so API is provided to wrap common projection functions.

The API was more or less copied directly from that of Clang's AST
matching facilities.

There are a lot of things we can do in the future:
* Binding results yielded in matchers to associated names, for future
  transformation stages to look up and modify.
* Actual transformation stages.
* Optimizations. This is not very fast.

A million thanks to @robrix, whose sage advice managed to turn my
kooky idea for an API into something really special and exciting.
2018-03-27 16:14:30 -04:00
Rob Rix
d596b0a7c6 🔥 the dependency on TH. 2018-03-27 15:01:35 -04:00
Timothy Clem
724d8f38aa Fix up pulling out go package name for import rendering 2018-03-26 12:02:27 -07:00
joshvera
859c4702b0 Merge remote-tracking branch 'origin/master' into default-typeapplications 2018-03-26 13:18:21 -04:00
Rob Rix
58b6c5ab04 Make lenses for EvaluatingState. 2018-03-26 13:13:59 -04:00
joshvera
126cdc5285 Make typeapplications a default extension 2018-03-26 12:00:19 -04:00
Rob Rix
44f03209c4 Stub in a module for a quiet analysis. 2018-03-26 10:02:20 -04:00
Rob Rix
598c02ce21 Merge branch 'master' into imports,-graphed 2018-03-26 09:46:08 -04:00
Rob Rix
b221649b75 Merge branch 'master' into evaluate-in-the-outer-analysis 2018-03-26 09:40:42 -04:00
Rob Rix
2e228604cf Merge branch 'master' into imports,-graphed 2018-03-24 00:35:50 -04:00
Josh Vera
745eb85ee7 Merge branch 'master' into preludes-and-subclassing 2018-03-23 15:26:41 -04:00
Rob Rix
85650c06df Merge branch 'master' into imports,-graphed 2018-03-23 15:26:11 -04:00
Rob Rix
9c0b5f7ab6 Merge branch '🔥-ghc-mod' into imports,-graphed 2018-03-23 10:26:13 -04:00
Josh Vera
7792356012 Merge branch 'master' into default-extensions 2018-03-22 15:43:31 -04:00
Patrick Thomson
1e2fc5f6d3 Merge remote-tracking branch 'origin/master' into preludes-and-subclassing 2018-03-22 12:50:16 -04:00
Josh Vera
3ef6366649 Merge branch 'master' into php-namespaces 2018-03-22 12:23:57 -04:00
joshvera
f2169e09a9 Move MultiParamTypeClasses, StandaloneDeriving, and DataKinds to default-extensions 2018-03-22 12:23:11 -04:00
Patrick Thomson
6f0f20deea thread default environments properly throughout the stack 2018-03-22 12:03:17 -04:00
Rob Rix
f476eb22bd Stub in a Data.Abstract.Module module. 2018-03-21 17:59:16 -04:00
Rob Rix
56dbd8b6a1 Copy the CallGraph stuff into a new module. 2018-03-21 17:58:47 -04:00
Rob Rix
0b2b27ff21 Stub in an AppMerge semigroup. 2018-03-21 16:40:56 -04:00
Timothy Clem
7fdc5e2fda Write a small spec for evaluating PHP includes 2018-03-19 14:42:31 -07:00
Patrick Thomson
dd1e1c555d Merge remote-tracking branch 'origin/master' into classes 2018-03-19 15:45:43 -04:00
Rob Rix
95f13be61f Merge branch 'master' into doctests 2018-03-19 12:35:14 -04:00
Patrick Thomson
d419ad8bf6 Merge remote-tracking branch 'origin/master' into classes 2018-03-19 12:31:34 -04:00
Rob Rix
f720c86e1f Build with as many cores as we can muster. 2018-03-19 10:20:10 -04:00
Rob Rix
476286834f Set -threaded on the doctests.
This is intended as a workaround for  https://github.com/commercialhaskell/stack/issues/3807
2018-03-19 10:19:48 -04:00
Rob Rix
b7bb4ccf72 Link QuickCheck in until we integrate LeanCheck. 2018-03-19 09:53:21 -04:00
Rob Rix
c5f27206ab Build the doctests with -dynamic so they can load the .dylibs for the parsers. 2018-03-19 09:23:11 -04:00
Rob Rix
5fc81f8566 Rename the fresh/nondet modules to not conflict with the effects package. 2018-03-19 09:23:11 -04:00
Rob Rix
bbb51588e5 Add a doctest component. 2018-03-19 09:23:11 -04:00
Ayman Nadeem
0a596261de Merge remote-tracking branch 'origin' into java-assignment 2018-03-16 14:59:28 -07:00
Timothy Clem
e580051a66 Merge remote-tracking branch 'origin/master' into build-fix-em-ups 2018-03-16 13:57:37 -07:00
Patrick Thomson
5df347eb3e Merge remote-tracking branch 'origin/master' into classes 2018-03-16 16:51:59 -04:00
Rob Rix
863d6aa428 Add a doctest component. 2018-03-16 14:34:54 -04:00
Patrick Thomson
56e7c25268 Move Exports to its own module. 2018-03-16 14:09:41 -04:00
Timothy Clem
9a84cbdd97 Align cause it's fun 2018-03-16 10:15:59 -07:00
Timothy Clem
0eb9d3be66 Try out some of lexi-lambda's recommended compiler warnings 2018-03-16 10:15:39 -07:00
Timothy Clem
0904796674 Add a specific Data.Abstract.Path with path/module name helpers 2018-03-16 09:27:08 -07:00
Timothy Clem
d6036f4165 Merge remote-tracking branch 'origin/export-wrapper' into ruby-imports 2018-03-15 15:34:06 -07:00
Rob Rix
56987f4fd2 Merge branch 'master' into jump-around,-jump-around 2018-03-15 16:10:06 -04:00
Timothy Clem
577bdcac6a Focus on require_relative and add new Ruby specific Require syntax 2018-03-15 11:43:41 -07:00
Timothy Clem
1e276dddef TDD FTW 2018-03-15 11:34:34 -07:00
Rob Rix
6b7bacc7d3 Merge branch 'master' into call-graph-analysis 2018-03-15 10:34:38 -04:00
Rob Rix
f575c05257 🔥 Elaborating for now. 2018-03-15 10:01:23 -04:00
Rob Rix
fcf44b5a37 Rename Store to Heap. 2018-03-14 20:42:59 -04:00
Rob Rix
3ac59ce623 Define an elaborating analysis. 2018-03-14 16:39:58 -04:00
Timothy Clem
7204debb07 Merge remote-tracking branch 'origin/master' into import-language-tour 2018-03-14 11:38:49 -07:00
Patrick Thomson
229902a5ca Merge remote-tracking branch 'origin/master' into rationals 2018-03-14 10:40:00 -04:00
Patrick Thomson
81aab6572e Address Rob's changes. 2018-03-14 10:36:56 -04:00
Rob Rix
6918fb31cf Merge branch 'master' into garbage-collecting 2018-03-14 09:39:55 -04:00
Rob Rix
5e5599c9e8 Copy my changes back. 2018-03-14 09:30:45 -04:00
Timothy Clem
0fd2c3eb05 Specify default-language for benchmarks target 2018-03-13 14:04:39 -07:00
Timothy Clem
af66a0c229 Merge remote-tracking branch 'origin/typescript-exports' into import-language-tour 2018-03-12 15:40:22 -07:00
Timothy Clem
5b1829e474 Some nice Go eval import specs 2018-03-12 13:52:50 -07:00
Rob Rix
8d1b80e599 Define a simple passthrough Collecting analysis. 2018-03-12 14:31:24 -04:00
Rob Rix
31dae8f671 🔥 Control.Monad.Effect.GC. 2018-03-12 14:24:28 -04:00
Timothy Clem
8ebcd5a864 Merge remote-tracking branch 'origin/master' into import-language-tour 2018-03-12 10:03:25 -07:00
Rob Rix
371a4ae02b Whoops, semigroups snuck back in there. 2018-03-12 12:56:47 -04:00
Rob Rix
7794d9423b Merge branch 'master' into re-enable-tracing-analyses 2018-03-12 12:09:13 -04:00
Patrick Thomson
46f4638497 Merge remote-tracking branch 'origin/master' into criterion 2018-03-12 10:53:50 -04:00
Patrick Thomson
8c2ffa6d8e Merge remote-tracking branch 'origin/master' into criterion 2018-03-12 10:22:41 -04:00
Patrick Thomson
ee2cbf9423 Merge remote-tracking branch 'origin/master' into weeder-pass 2018-03-12 10:12:30 -04:00
Timothy Clem
dc96cde7cd Test out some TypeScript imports 2018-03-09 15:54:52 -08:00
Timothy Clem
d352c66227 Test out rest of python imports, move to new dir 2018-03-09 15:16:07 -08:00
Timothy Clem
3fc7f644b2 Try my hand at a spec for analysis - test out python imports 2018-03-09 15:01:29 -08:00
Patrick Thomson
da2a3fc7a8 Initial pass fixing errors raised by weeder.
This fixes a lot of unnecessary exports in the specs, removes a couple
otiose imports (comonads and semigroups are provided by base, I beleive),
and removes a duplicated function.
2018-03-09 12:07:34 -05:00
Patrick Thomson
a883bf9ada 🔥 Control.Monad.Effect.Cache.
This interface has already been obsoleted—its only consumer has a
private interface for its caching functionality, and @robrix's work
will restore a generalized version. No reason to keep this about.
2018-03-09 11:11:09 -05:00
Rob Rix
bed985d625 Merge branch 'master' into re-enable-tracing-analyses 2018-03-08 12:39:49 -05:00
Patrick Thomson
d8c482acda Merge remote-tracking branch 'origin/master' into criterion 2018-03-08 10:20:57 -05:00
Rob Rix
089b08edb3 🔥 Control.Newtype1. 2018-03-07 21:03:46 -05:00
Patrick Thomson
1ea97534b6 print so that we know everything is evaluated 2018-03-07 19:56:54 -05:00
Patrick Thomson
0ac705b0f5 flesh out some benchmarks 2018-03-07 19:34:20 -05:00
Rob Rix
f4fcdfecf1 Stub in a module for Newtype1. 2018-03-07 19:02:16 -05:00
Josh Vera
ca5fa6d5b3 Merge branch 'master' into floats-scientific 2018-03-07 17:49:42 -05:00
Patrick Thomson
8a738a8760 Merge remote-tracking branch 'origin/master' into resuscitate-caching-analysis 2018-03-07 15:07:01 -05:00
Patrick Thomson
4a2d5bda53 necessary changes for floating-point munging 2018-03-07 14:46:26 -05:00
Rob Rix
257a068b3c Stub in a Monoidal map module. 2018-03-07 12:22:52 -05:00
Rob Rix
c121a0665e 🔥 the dependency on pointed. 2018-03-07 12:19:27 -05:00
Rob Rix
a2c395d54b Tracing uses a Reducer. 2018-03-07 11:27:17 -05:00
Rob Rix
ee911a0990 🔥 MonadTrace. 2018-03-06 17:14:52 -05:00
Rob Rix
c9a74da233 Re-enable the tracing analysis. 2018-03-06 17:13:58 -05:00
Patrick Thomson
37fcc4826b Rename the Linker type/module to ModuleTable.
During my recent pairing with @robrix, we agreed that the name of
Linker was inaccurate—it doesn't link anything, it just keeps track of
past modules. This renames it and its module.
2018-03-06 14:17:32 -05:00
Patrick Thomson
c3d01b6602 Resuscitate the caching evaluator.
The caching analysis had been disabled, as it was still written in the
open-interpreter style. This patch restores it, defining a
`CachingAnalysis` newtype that uses nondeterministic but convergent
caching in its `MonadAnalysis` instance. This also defines an
`embedSubterm` helper that is useful in defining new analysis passes.

Thanks to @robrix for 🍐!
2018-03-06 13:51:00 -05:00
Rob Rix
5e579df53f 🔥 Analysis.Abstract.CallGraph. 2018-03-06 10:53:57 -05:00
Rob Rix
91d502b553 Stub in a module for a non-abstract call graph analysis. 2018-03-06 10:36:02 -05:00
Rob Rix
711aa0529a Stub in a call graph analysis module. 2018-03-02 15:06:49 -05:00
Patrick Thomson
226ff88723 Rename MonadFunction to MonadValue. 2018-03-02 11:45:56 -08:00
Rob Rix
91cfe37bc7 🔥 the Analysis.Abstract.TypeInference module. 2018-03-02 10:56:04 -05:00
Rob Rix
9740758d01 Stub in a module for a type inference analysis. 2018-03-02 10:15:18 -05:00
Rob Rix
5199bebf39 Merge branch 'master' into evaluatable-simplification 2018-03-01 16:55:18 -05:00
joshvera
41a538d7e1 Merge remote-tracking branch 'origin/master' into rename-semantic 2018-03-01 10:16:35 -05:00
joshvera
e32961edde Rename semantic-diff to semantic 2018-02-26 13:16:56 -05:00