1
1
mirror of https://github.com/github/semantic.git synced 2024-12-28 09:21:35 +03:00
Commit Graph

18212 Commits

Author SHA1 Message Date
joshvera
ccb044ac6b Export scopeLookup
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-26 19:54:49 -05:00
joshvera
ff1543f434 Implement Method
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-26 19:54:37 -05:00
joshvera
e9a999b69e Eval params to names in Evaluatable Function
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-26 19:54:28 -05:00
joshvera
af0184a195 Store names as params in Closure
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-26 19:53:58 -05:00
Timothy Clem
d90e9f0ca8 Rework to have symbolName as method 2018-11-26 13:56:43 -08:00
Timothy Clem
14600029fd Pick out delcarations for ScopeResolution and through Context better 2018-11-26 13:43:20 -08:00
Timothy Clem
e2ac46ae69 Better Show for Span 2018-11-26 13:41:55 -08:00
joshvera
a1d2a09548 Merge the heap and insert a frame link in Evaluatable Import
Co-Authored-By: Rob Rix <rob.rix@github.com>
2018-11-26 13:29:48 -05:00
joshvera
ce40ee2d37 declarationNames traverses edges
Co-Authored-By: Rob Rix <rob.rix@github.com>
2018-11-26 13:05:37 -05:00
joshvera
0cf8bb1b87 Throw UninitializedAddress from deref
Co-Authored-By: Rob Rix <rob.rix@github.com>
2018-11-26 12:31:41 -05:00
joshvera
4379bcca4e syntax errors 2018-11-26 12:31:21 -05:00
joshvera
bf4401d79b Revert newFrame changes 2018-11-26 12:04:49 -05:00
joshvera
e67862a575 Implement in terms of go 2018-11-26 12:03:49 -05:00
joshvera
fd979562ff Revert "Throw UninitializedAddress from value"
This reverts commit 36e1e09af13f8a0cbab286dc5724af5dd11213db.
2018-11-26 12:03:12 -05:00
Patrick Thomson
330a78b230 clarify TODO 2018-11-26 11:21:34 -05:00
joshvera
f1ea66012b Initialize the slots of a frame when creating it 2018-11-20 20:03:17 -05:00
joshvera
878a92eda1 Instantiate an object in the heap for a QualifiedImport
if none exists and we're trying to construct edges to imported frames
2018-11-20 19:28:52 -05:00
joshvera
9b2355b521 Throw UninitializedAddress from value 2018-11-20 19:28:15 -05:00
joshvera
0a7dd5c187 Remove makeNamespace for now 2018-11-20 19:28:04 -05:00
joshvera
d485923816 Return Maybe from deref
So we can case on uninitialized slots in the heap
2018-11-20 19:27:51 -05:00
joshvera
f3cb6d4f8c Implement QualifiedImport for Go 2018-11-20 19:04:32 -05:00
joshvera
83722bc8f6 Ask for the span in QualifiedAliasedImport 2018-11-20 19:04:04 -05:00
joshvera
86aa9c9950 Move defaultAlias to Data.ImportPath 2018-11-20 19:03:46 -05:00
Patrick Thomson
9e553ce939 fix-lint 2018-11-20 11:51:40 -05:00
Patrick Thomson
812abf249d fix stray import/old TODO 2018-11-19 16:45:55 -05:00
Patrick Thomson
af02dc3391 Port over Tokenize instances. 2018-11-19 16:41:00 -05:00
Patrick Thomson
c0d71fe80d Add enough Scope tokens to handle Ruby syntax. 2018-11-19 16:15:32 -05:00
Patrick Thomson
2974b34c17 Add 'Flow' to represent control-flow constructs. 2018-11-19 16:05:01 -05:00
joshvera
01f5a29039 Return unit in delete instance 2018-11-16 18:57:05 -05:00
joshvera
f2aa442c48 Rename AssignmentRvalError to DerefError 2018-11-16 18:54:25 -05:00
joshvera
06c9e97b2d implement Delete evaluatable 2018-11-16 18:53:27 -05:00
joshvera
d8933a062b Add deleteSlot 2018-11-16 18:53:16 -05:00
joshvera
2f904a3791 Add dealloc to delete slots 2018-11-16 18:53:06 -05:00
joshvera
ba28eafd9e Remove undefined from resumingLoadError 2018-11-16 18:26:16 -05:00
joshvera
4d9eafccb0 convergingModules recurs on ValueRef now
so we can remove address
2018-11-16 18:25:46 -05:00
joshvera
edf444eff9 Remove address 2018-11-16 18:22:31 -05:00
joshvera
b583e0bf8d Construct an import edge and frame link from the current scope to the imported scope and frame 2018-11-16 18:03:00 -05:00
joshvera
007c710668 cover all cases of pathDeclarationScope 2018-11-16 18:02:39 -05:00
joshvera
243e0f69fb Create a new scope for QualifiedAliasedImport 2018-11-16 16:57:12 -05:00
joshvera
2c8ac63806 Return objects from QualifedAliasedImport 2018-11-16 16:12:01 -05:00
joshvera
fb0e7e3407 Add object to AbstractValue 2018-11-16 16:11:39 -05:00
joshvera
de126c7b94 qualify object 2018-11-16 16:11:28 -05:00
joshvera
781df71d37 catch the rest of EvalError 2018-11-16 16:11:18 -05:00
joshvera
ec8733889e Add AbstractHole instance to ValueRef 2018-11-16 16:10:02 -05:00
joshvera
e54cc8b096 Add QualifedImportError 2018-11-16 16:09:42 -05:00
joshvera
f39da9578a Move ImportPath to Data.ImportPath 2018-11-16 16:09:11 -05:00
joshvera
ea5587d16c Implement Evaluatable for MemberAccess 2018-11-15 20:24:34 -05:00
joshvera
39e723b980 Add Object to concrete Value 2018-11-15 20:24:21 -05:00
joshvera
3de1cbce5b Change scopedEnvironment to return the address of an Object 2018-11-15 20:24:06 -05:00
joshvera
994fd861c5 Add ReferenceError 2018-11-15 20:23:43 -05:00
joshvera
77fd2e823d Add insertDeclarationSpan to ScopeGraph 2018-11-15 19:29:09 -05:00
joshvera
5c82345816 Add putDeclarationSpan to ScopeGraph 2018-11-15 19:29:01 -05:00
joshvera
6a34826abd Declare variable declarations with an empty span and update after evaluating 2018-11-15 19:28:48 -05:00
joshvera
39d874d9c6 Catch LookupDeclarationScopeError to a hole 2018-11-15 19:28:18 -05:00
joshvera
2f32fd6f2b fix empty heap test 2018-11-15 18:44:47 -05:00
Rick Winfrey
46d39a25c8 A lot of warnings. ALOT 2018-11-15 15:04:28 -08:00
Rick Winfrey
4a5c4deb38 Add StatementBlock Taggable instance 2018-11-15 15:03:37 -08:00
Rick Winfrey
97545f0ae7 Remove redundant constraints and imports 2018-11-15 14:18:36 -08:00
Rick Winfrey
e08b1100e4 Remove unnecessary (now) scopeAddress parameter
In Data.Abstract.ScopeGraph when we invoke `insertImportReference`, we make the assumption that the starting scope with respect to the currently available ScopeGraph is the `currentScope`. We then start from that scope to begin constructing a Path to the scope containing the target declaration.

Control.Abstract.ScopeGraph will need the scopeAddress parameter still, because it is going to insert a new scope into our scope graph using the scope returned from Data.Abstract.ScopeGraph (with the newly constructed path to the declaration).
2018-11-15 13:58:28 -08:00
Rick Winfrey
f7c38b0bb7 Clean up unused params 2018-11-15 13:52:14 -08:00
Rick Winfrey
a94760e99a Placeholder for handling Hole Paths 2018-11-15 13:51:57 -08:00
Rick Winfrey
66d3044951 Merge branch 'master' into heap-frames 2018-11-15 13:44:06 -08:00
joshvera
78d543c60f Return the currentScope' if pathDeclarationScope is a DPath
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-15 14:39:59 -05:00
joshvera
393da1897b Test position of slots
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-15 14:39:41 -05:00
joshvera
0cfd04905a Add Evaluatable instance for RequiredParameter
Declares the name of the param in the scope graph and assigns the Rval's associated scope to the lval's declaration and the rval's value to the lval's slot.

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 19:17:42 -05:00
joshvera
22e1822185 Defer declaring names in the scope graph to param
Parameter syntax evaluatable instances are now responsible for adding declarations to the scope graph.

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 19:16:26 -05:00
joshvera
b0d0e2706b Add putSlotDeclarationScope
so we can set the associated scope of a slot

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 19:15:39 -05:00
joshvera
5c861f412f Add putDeclarationScopeAtPosition
So we can set the associated scope for the declaration of a slot

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 19:14:58 -05:00
joshvera
fe30b926f7 EvalError types
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 19:14:31 -05:00
joshvera
127552dbfc parameterize EvalError by address and value
so that we can throw AssignmentRvalError within Assignment or RequiredParameter Evaluatable instances

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 19:14:02 -05:00
joshvera
3223c97548 Add non-lexical StatementBlock
to differentiate between syntax that creates a new lexical scope and function bodies etc.

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 19:13:22 -05:00
joshvera
c0be5b6da2 Remove Assignment from RequiredParameter
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 18:57:31 -05:00
joshvera
b690585a78 Add statementTerm for lexical blocks
Change statementBlock to construct non-lexical syntax blocks

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 18:57:15 -05:00
joshvera
3f4c5d961d Create a lexical edge to its parent's declaration frame when calling a closure 2018-11-14 15:15:31 -05:00
joshvera
eebae6a1fc Add pathDeclarationScope 2018-11-14 15:14:58 -05:00
joshvera
4c2716f817 Add lookupDeclarationFrame 2018-11-14 15:14:50 -05:00
joshvera
6877ef1a5e Add lookupDeclarationScope 2018-11-14 15:14:43 -05:00
Timothy Clem
7c3469b86e Get the math right! 2018-11-13 15:50:07 -08:00
joshvera
4da5b012da Construct a frame for the intermediate import scope
So we can look up declarations across heap boundaries

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 18:00:00 -05:00
joshvera
519a6db035 Implement Return
impements Return in terms of eval and earlyReturn now that eval returns a ValueRef

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 17:59:25 -05:00
joshvera
12a038869a Export Heap and Frame accessors
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 17:58:49 -05:00
joshvera
1f09735902 Add insertFrameLink
in order to add frames that are reachable from the current frame

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 17:58:37 -05:00
joshvera
0a35a5eee7 Add bindFrames to merge heap frames for now
This may not be an ideal solution but populates the current heap with enough information to traverse frames to correct slots

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 17:58:06 -05:00
Timothy Clem
630566f956 No need for extra details here, this data is already around in error responses 2018-11-13 14:36:03 -08:00
Timothy Clem
492117d796 Actually use the HTTP_TIMEOUT config var 2018-11-13 14:30:25 -08:00
joshvera
56b85b1070 Don't construct intermediate current scope in QualifedExport eval
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 14:09:05 -05:00
joshvera
567fe790c9 Construct an import reference from correct start scope
Construct an import reference starting from the currentAddress of the target scope graph

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 14:08:42 -05:00
joshvera
4aac61ea70 Insert a list of scope if label doesn't exist in edge map of target scope
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 14:08:06 -05:00
joshvera
24720f9f06 Look within references when constructing paths
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 14:07:38 -05:00
Timothy Clem
2e1626d949 Make symbols output also return partial results 2018-11-13 11:02:23 -08:00
Timothy Clem
4fbeaef355 Attempt to send stack traces to haystack 2018-11-13 10:09:58 -08:00
joshvera
1cb513e441 bind scope graphs in side effect imports without constructing an edge
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 12:06:44 -05:00
Timothy Clem
890f6d2068 Return partial results for json diffs too 2018-11-10 09:40:39 -08:00
Timothy Clem
d33b4a5f3d Better error structure for Tocs 2018-11-10 09:40:29 -08:00
Timothy Clem
09e6046763 Be consistent with other responses 2018-11-10 09:40:19 -08:00
Timothy Clem
bc9f85fdef Catch errors for some diff outputs 2018-11-09 16:44:10 -08:00
Timothy Clem
b964324d09 Only stat errors once per path 2018-11-09 13:18:46 -08:00
Rick Winfrey
1e88378a51 Return an Rval representing the function body as a closure, instead of returning a Heap address
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-09 12:47:44 -08:00
Rick Winfrey
12d27b436c Update an existing function declaration scope
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-09 12:47:24 -08:00
Rick Winfrey
21a9e29b0c bindAll after evaluating a sideEffectImport
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-09 12:46:52 -08:00
Rick Winfrey
7103ba94b7 Declare a function using its name and the full span of the function
⚠️ this is a hack to get around the problem of evaluating a functionName (term) in order to retrieve its Span to properly declare the function.

Co-Authored-By: Josh Vera <vera@github.com>
2018-11-09 12:46:14 -08:00
Rick Winfrey
d020f71862 Set currentScope and currentFrame after running an initial action
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-09 12:43:35 -08:00
Rick Winfrey
cbafcd8114 Add (Show address) for debugging
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-09 12:42:43 -08:00
joshvera
a37c10b7fb Implement Call in terms of call effect
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 13:05:04 -05:00
joshvera
ce91cf71db Remove self argument from call effect
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 13:04:52 -05:00
joshvera
c663c6a2ea Stub in pathPosition with Position 0
⚠️ : This is really bad because we never want to erroneously index into a sequence.

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 12:03:05 -05:00
joshvera
90f37e206b throw heap errors on Hole paths
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 11:47:15 -05:00
joshvera
ba3b90ab12 resume from heap errors
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 11:47:04 -05:00
joshvera
af8918046e Export Scope and Path from Control.Abstract.ScopeGraph
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 11:37:58 -05:00
joshvera
244109310a Add AbstractHole instances for Path, Scope, Address
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 11:37:45 -05:00
joshvera
eebcc9c9ee Fix up runFunction carriers
function effect now takes parameters as terms

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-08 20:47:04 -05:00
joshvera
f6bfec2d96 the tests compile! 2018-11-08 18:22:35 -05:00
joshvera
22bdbdfafe Fix up import conflicts
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-08 12:55:42 -05:00
joshvera
7da4d50492 Rename LookupError to LookupScopeError
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-08 12:54:46 -05:00
joshvera
6af58e5f92 Rename LookupError/LookupPathError to LookupAddressError/LookupLinkError 2018-11-08 12:54:25 -05:00
Josh Vera
0edad11aef Merge branch 'master' into streamline-toc-summaries 2018-11-08 11:59:56 -05:00
Timothy Clem
57f284f847 Streamline the declarations for toc summaries 2018-11-08 08:33:26 -08:00
Josh Vera
ebb380f427 Merge branch 'master' into add-explicit-assignment-timeout 2018-11-08 11:18:02 -05:00
Rick Winfrey
ca0508c471 Export lookupDeclaration 2018-11-07 16:29:11 -08:00
Rick Winfrey
05c85c30e2 Add lookupDeclaration in Data.Abstract.Heap
This allows us to retrieve a frame address and position with which we can inspect slot values accordingly
2018-11-07 16:23:06 -08:00
joshvera
0c35a8a95c Start fixing up tests
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-07 18:27:56 -05:00
Rick Winfrey
6e934d83d9 Merge branch 'master' into add-explicit-assignment-timeout 2018-11-07 13:49:02 -08:00
joshvera
a49b7f5440 Add lookupFrameAddress to Heap
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-07 15:56:20 -05:00
Timothy Clem
8c0dd6d3b5 Just return the first line if function defs span multiple lines 2018-11-07 11:48:50 -08:00
joshvera
79186be933 reassociate 8 Eithers
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-07 14:08:45 -05:00
Rick Winfrey
0530153780 No need for top level heap
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-06 17:12:27 -08:00
Rick Winfrey
6500f4de53 Keep Heap state around rather than discarding it
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-06 17:11:28 -08:00
Rick Winfrey
657b2db1fd Parameterize ModuleResult by Heap
We think it'll be helpful to keep the Heap around when we evaluate a Module

Co-Authored-By: Josh Vera <vera@github.com>
2018-11-06 17:06:08 -08:00
Rick Winfrey
1d7b6502ff Fix warning
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-06 16:38:42 -08:00
Rick Winfrey
f8380e2583 Add show for debugging
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-06 16:37:55 -08:00
Timothy Clem
24544863f7 Handle comments inside of selectorExpressions in Go 2018-11-06 13:36:24 -08:00
Rick Winfrey
7eddec8521 Merge branch 'master' into heap-frames 2018-11-06 11:26:39 -08:00
joshvera
2958d2578e Return currentFrame in Maybe
and throw CurrentFrameError and CurrentScopeError in terms that require a current scope and frame

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-06 13:43:14 -05:00
joshvera
e561bf1da7 Add declaration to LookupPathError
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-06 13:05:10 -05:00
joshvera
fdad4295a0 Don't define a prelude of TypeScript atm
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-06 13:04:49 -05:00
Timothy Clem
343289f1c5 Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-06 09:17:49 -08:00
joshvera
e6cf810822 Merge remote-tracking branch 'origin/master' into heap-frames 2018-11-06 11:26:11 -05:00
Timothy Clem
a297d15f47 Fix for comments in expressions with python assignment changes 2018-11-06 08:01:33 -08:00
joshvera
1818a74060 Return ValueRef everywhere 2018-11-05 19:43:14 -05:00
joshvera
11a64f043e return value refs 2018-11-05 17:25:51 -05:00
joshvera
7ed1521ad6 use raiseHandler for runState calls 2018-11-05 17:08:37 -05:00
joshvera
0d9fc6a24a Remove Span constraints 2018-11-05 17:08:26 -05:00
joshvera
f6ffb8904f move type signatures from effects to sig 2018-11-05 17:07:59 -05:00
Patrick Thomson
bdc5db555b rename and prune 2018-11-05 16:56:49 -05:00
joshvera
2a90f1d13f fix type param 2018-11-05 16:11:51 -05:00
joshvera
5186b394e8 run scope graph and heap effects in evaluate 2018-11-05 16:11:45 -05:00
joshvera
28dff57ddb return ScopeGraph from doRequire 2018-11-05 16:11:28 -05:00
joshvera
1020f6dc61 use withLexicalScopeAndFrame in Statements 2018-11-05 16:11:16 -05:00
joshvera
f2754368cb If evaluatable instance returns a ValueRef 2018-11-05 16:11:04 -05:00
joshvera
63aa9da7f6 return undefined from Class instance 2018-11-05 16:10:42 -05:00
joshvera
fc426a9793 fix type constraints 2018-11-05 16:10:31 -05:00
joshvera
c9501897a1 Construct frame from Closure scope in Abstract.Call 2018-11-05 16:10:21 -05:00
joshvera
faffb3098e add heap semantics to BuiltIn 2018-11-05 16:10:04 -05:00
joshvera
14347215cb Set the declaration's scope in runFunction 2018-11-05 16:09:39 -05:00
Timothy Clem
bdb7ee0430 More tests 2018-11-05 13:09:37 -08:00
joshvera
95204199fb rename address to frameAddress 2018-11-05 16:09:14 -05:00
joshvera
674d835ad9 import AllocatorC 2018-11-05 16:09:02 -05:00
joshvera
652461a65f asArray returns values 2018-11-05 16:08:56 -05:00
joshvera
cb0c4ac8f2 address returns a slot 2018-11-05 16:08:50 -05:00
joshvera
9a1fc0f063 Return () from declare 2018-11-05 16:08:34 -05:00
joshvera
cd78a2aaa7 expose runAllocator 2018-11-05 16:08:20 -05:00
joshvera
fc6c21c85e Rename address to frameAddress 2018-11-05 16:08:06 -05:00
joshvera
2beb576dd7 assign to the correct slot in define 2018-11-05 16:07:44 -05:00
joshvera
b3b7d2e5ff fix constraints 2018-11-05 16:07:23 -05:00
joshvera
1f43f15c1d Remove deref from python package 2018-11-05 16:06:18 -05:00
joshvera
3c0e7ce322 remove configurationContext 2018-11-05 16:05:39 -05:00
joshvera
2eeaf7585c parameterize eavesdrop with value 2018-11-05 16:05:11 -05:00
joshvera
e4e6451b1e Remove configurationContext and fix type params 2018-11-05 16:04:52 -05:00
Timothy Clem
67724b2812 Take annotation from first item in list for snippets 2018-11-05 12:33:14 -08:00
Timothy Clem
7169685d06 Always use a wrapping list for python functions and classes 2018-11-05 12:32:46 -08:00
Timothy Clem
11c145589c Give class a custom Declarations1 instance 2018-11-05 09:27:41 -08:00
joshvera
37da68d706 Show builtIn name 2018-11-05 12:22:22 -05:00
joshvera
28ee7a136d currentScope returns in Maybe 2018-11-05 12:22:09 -05:00
joshvera
0d0ef95582 type parameters 2018-11-05 12:22:01 -05:00
Patrick Thomson
15f5319252 fix stray indent 2018-11-05 12:17:05 -05:00
Patrick Thomson
76f0ef7f38 Merge remote-tracking branch 'origin/master' into revisit-matching 2018-11-05 11:07:49 -05:00
Patrick Thomson
688219e380 Arrow instance, why not 2018-11-05 11:06:59 -05:00
Timothy Clem
fa60a394b4 Fully commit to new method of generating symbols 2018-11-05 08:03:09 -08:00
Timothy Clem
0cacdd84d0 Helps the warnings 2018-11-05 07:57:14 -08:00
Rob Rix
3cb4fc5711 Use pure instead of return & 🔥 the annotation. 2018-11-05 09:53:17 -05:00
Rob Rix
2ee79706e3 Whitelist attemptUnsafeArithmetic in the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
68d87314ce Move the reduce duplication annotation into the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
4f92337221 Move the ignore use . annotation into the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
1e5920e318 Move the ignore eta reduce thing into the hlint config. 2018-11-05 09:51:04 -05:00
Rob Rix
fe9f0b0aeb 🔥 a redundant hlint annotation. 2018-11-05 09:49:34 -05:00
Patrick Thomson
292a268b00 better name for infix operator 2018-11-04 14:46:19 -05:00
Patrick Thomson
a84b25ad6e remove Data.Algebra import 2018-11-04 14:39:38 -05:00
Patrick Thomson
8e4f9ea119 better docs 2018-11-02 19:43:12 -04: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
8d12b5c242 Fix declarations to make tests pass 2018-11-02 13:55:55 -07:00
Timothy Clem
5b9b0daee3 Helper for testing ruby tags 2018-11-02 13:55:46 -07:00
Timothy Clem
bf90ef8e45 Did this 2018-11-02 13:54:55 -07:00
joshvera
2f3fc46e00 Remove subterm uses 2018-11-02 16:18:49 -04:00
joshvera
29383adf7a currentScope returns in Maybe 2018-11-02 16:18:35 -04:00
joshvera
42b350cc6e Remove evalQualifiedImport 2018-11-02 16:18:24 -04:00
joshvera
bb39ebde84 use withLexicalScopeAndFrame 2018-11-02 16:18:16 -04:00
joshvera
6470a3a976 Remove ScopeEnv constraint 2018-11-02 16:17:58 -04:00
joshvera
39deb34db6 ignore define values 2018-11-02 16:17:50 -04:00
joshvera
5647df2a16 remove instance sigs 2018-11-02 16:17:43 -04:00
joshvera
cb8a1222c0 forLoop in terms of withLexicalScopeAndFrame 2018-11-02 16:17:32 -04:00
joshvera
595b3d8747 Add withLexicalScopeAndFrame 2018-11-02 16:17:10 -04:00
joshvera
02bcc64102 Fix Env constraints 2018-11-02 16:17:01 -04:00
Timothy Clem
223298b86a Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-02 12:54:21 -07:00
Timothy Clem
018dc73af9 Python assignment: conditionally include annotation on functions 2018-11-02 12:39:38 -07:00
joshvera
f50329ced4 fix up Abstract, Type, and Value 2018-11-02 15:33:45 -04:00
Timothy Clem
a87c526977 No errors, just keep trying 2018-11-02 12:30:43 -07:00
joshvera
d93f2adcd5 fix up primitive, value, and heap 2018-11-02 15:03:10 -04:00
Patrick Thomson
b4a469c706 Merge branch 'master' into add-tsparse-quiet-flag 2018-11-02 13:07:58 -04:00
Patrick Thomson
0a117222c1 Merge branch 'master' into add-explicit-assignment-timeout 2018-11-02 11:10:09 -04:00
Patrick Thomson
b9a742e6db address @rewinfrey's suggestion 2018-11-02 11:03:57 -04:00
Patrick Thomson
a62840c58d Be commensurate with parse --quiet 2018-11-02 11:00:09 -04:00
Patrick Thomson
bd51a186e7 Merge remote-tracking branch 'origin/master' into add-tsparse-quiet-flag 2018-11-02 09:16:28 -04:00
joshvera
e2f9773f7f type signatures 2018-11-01 23:09:03 -04:00
joshvera
4e2126611b Remove allocator from Heap 2018-11-01 23:08:57 -04:00
joshvera
e30239123d port State ScopeGraph to fused effects 2018-11-01 23:08:45 -04:00
joshvera
f85a2d0f1a Evaluator sig 2018-11-01 23:08:28 -04:00
joshvera
daf17e426d derive any class 2018-11-01 22:45:51 -04:00
joshvera
2c4c53904b No effectful constraint 2018-11-01 22:33:43 -04:00
joshvera
82c50ed96d remove pureeffect 2018-11-01 22:32:46 -04:00
joshvera
5234688d9c circular imports 2018-11-01 22:32:30 -04:00
joshvera
c2643d3463 Don't make the heap a monoidal map 2018-11-01 22:32:14 -04:00
joshvera
86253d11c7 NFData instance 2018-11-01 22:31:55 -04:00
joshvera
4870936047 add value param to LoadError 2018-11-01 22:28:45 -04:00
joshvera
069a50a634 add NFData to Position 2018-11-01 22:28:38 -04:00
joshvera
ef9a54cabe add value back to Modules 2018-11-01 22:28:21 -04:00
joshvera
a1bdbccb53 parameterize LoopControl by value 2018-11-01 22:28:10 -04:00
Josh Vera
9f22607fc0 Merge branch 'master' into diff-via-fused-effects 2018-11-01 22:21:46 -04:00
Timothy Clem
55787183b9 Use evalState 2018-11-01 17:40:58 -07:00
Timothy Clem
12a4fc5073 Turn this on for classes and Modules 2018-11-01 17:40:49 -07:00
Timothy Clem
d26cd0bf1a No need for State in this fold 2018-11-01 17:16:34 -07:00
Timothy Clem
63e13ee20c Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-01 16:04:15 -07:00
Timothy Clem
02c9074b7e Format, hide lang 2018-11-01 16:03:12 -07:00
Timothy Clem
92f9f8373e Render to same output format, respecting field choice 2018-11-01 15:48:47 -07:00
Timothy Clem
806c5c417b Include a place for span 2018-11-01 15:48:35 -07:00
Rick Winfrey
9e753a1757 Remove conflict markers 2018-11-01 15:39:09 -07:00
Rick Winfrey
4750d51bf6 Merge branch 'master' into heap-frames
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-01 15:29:45 -07:00
Timothy Clem
1f6a7b9e48 Move HasTextElement 2018-11-01 14:49:35 -07:00
Timothy Clem
59bdb77fc4 Import cleanup 2018-11-01 14:39:15 -07:00
Timothy Clem
460ea0cf67 Rough, but WORKING symbols output with doc strings 2018-11-01 14:31:19 -07:00
Timothy Clem
f860d4aa66 Add in util for Go defs 2018-11-01 13:20:50 -07:00
Patrick Thomson
514dacf756 Merge branch 'master' into add-data-coerce-to-prologue 2018-11-01 12:51:21 -04:00
Timothy Clem
24a9b2b6ea s/Tag/Symbol 2018-11-01 07:56:28 -07:00
Timothy Clem
77f5b0a1d6 Introduce new renderToSymbols 2018-11-01 07:55:34 -07:00
Rob Rix
98805db943 Merge branch 'master' into diff-via-fused-effects 2018-10-31 18:39:24 -04:00
Timothy Clem
7aaeca419f Don't need this 2018-10-31 15:02:14 -07:00
Timothy Clem
c1d3f60073 Make use of language 2018-10-31 15:01:39 -07:00
Patrick Thomson
b9cf8f73c6 Environment and App. 2018-10-31 15:47:30 -04:00
joshvera
ef67897838 Make it compile 2018-10-31 15:37:13 -04:00
Timothy Clem
e18c65ce47 tag doesn't need to be a method 2018-10-31 12:27:01 -07:00
Timothy Clem
0111afde81 Fix up ConstructorNameStrategy for TermF 2018-10-31 12:26:38 -07:00
joshvera
e83b2b75b6 Revert "Fix up constraints"
This reverts commit 922d244a6100c1740c253d8f56ad55b67cdf58b0.
2018-10-31 14:28:15 -04:00
Rick Winfrey
0c6afc5995 Fix up constraints 2018-10-31 11:16:51 -07:00
Timothy Clem
2ccb468800 Taggable instance for Context 2018-10-31 11:08:14 -07: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
joshvera
8b57ade7e6 Add runState call 2018-10-31 12:59:21 -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
427e933b36 Minor cleanup 2018-10-31 08:41:41 -07:00
Timothy Clem
945ab01275 Introduce Taggable 2018-10-31 08:34:58 -07:00
Timothy Clem
100ffff873 Only annotate Python functions if there is a type 2018-10-31 08:34:58 -07:00
Timothy Clem
335989f22d Small helper to test new tags 2018-10-31 08:34:58 -07:00
Timothy Clem
55670cd524 Strings in mini python 2018-10-31 08:29:00 -07:00
Timothy Clem
feef6e3ed6 Generic1 instance for TermF 2018-10-31 08:28:37 -07:00
Timothy Clem
3e26d933b3 MonadFail for Matcher 2018-10-31 08:28:22 -07:00
Patrick Thomson
fd94b225c9 Merge branch 'master' into add-tsparse-quiet-flag 2018-10-31 11:09:20 -04:00
Patrick Thomson
f0d9ba3f8a one last import 2018-10-31 09:36:04 -04:00
Patrick Thomson
27a9ae546a Merge branch 'master' into add-data-coerce-to-prologue 2018-10-31 09:09:37 -04:00
Rob Rix
c95822894e Merge branch 'master' into diff-via-fused-effects 2018-10-30 23:03:50 -04:00
joshvera
09ab5d74a0 Fix some Graph module errors 2018-10-30 19:47:22 -04:00
joshvera
3fd78a2938 fix constraints in outer modules 2018-10-30 18:19:16 -04:00
joshvera
8c41511c87 lowerBound for Heap 2018-10-30 18:19:06 -04:00
Patrick Thomson
015abadea2 Merge branch 'master' into break-dependency-of-config-on-SHA 2018-10-30 18:10:58 -04:00
Rick Winfrey
ad2bb368dd Comment out resumingEnvironmentError 2018-10-30 14:03:00 -07:00
Rick Winfrey
e3be56166a Add fix me comments to evaluatable instances 2018-10-30 13:50:43 -07:00
Rick Winfrey
b1521a30fa Replace usage of insertEdge in favor of new combinators 2018-10-30 13:23:36 -07:00
Rick Winfrey
e7d94f9555 Add insert edge combinators 2018-10-30 13:22:49 -07:00
Patrick Thomson
cb54dd7aed Merge remote-tracking branch 'origin/master' into repl-effect 2018-10-30 15:58:00 -04:00
Patrick Thomson
c73696fcc0 Merge branch 'master' into add-explicit-assignment-timeout 2018-10-30 15:53:29 -04:00
Patrick Thomson
5cac709075 Merge remote-tracking branch 'origin/master' into add-tsparse-quiet-flag 2018-10-30 15:53:02 -04:00
Rob Rix
74f183921a Merge branch 'master' into break-dependency-of-config-on-SHA 2018-10-30 15:40:48 -04:00
Rob Rix
994464105c Merge branch 'master' into diff-via-fused-effects 2018-10-30 15:40:42 -04:00
Patrick Thomson
c4698ff96c Merge branch 'master' into add-data-coerce-to-prologue 2018-10-30 15:40:14 -04:00
Patrick Thomson
a16822e7c3 oops, wrong file 2018-10-30 15:39:04 -04:00
Patrick Thomson
2d91f7e263 stray pragma 2018-10-30 15:24:47 -04:00
Patrick Thomson
3caa753808 Add Data.Coerce to the Prologue.
This is ubiquitous enough that we should just export it.
2018-10-30 15:12:45 -04:00
Patrick Thomson
aa34a5b2c9 cleanup 2018-10-30 15:05:25 -04:00
Patrick Thomson
3cb8608703 Merge remote-tracking branch 'origin/master' into add-purely-to-matching 2018-10-30 15:00:37 -04:00
Rob Rix
8389097a81 Log a SHA of “development” when it’s absent from the Config. 2018-10-30 14:59:14 -04:00
Rob Rix
1ff9c7ac36 Move the SHA to Config. 2018-10-30 14:58:29 -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
Rob Rix
e44ab265ab 📝 optionsSHA. 2018-10-30 14:16:52 -04:00
joshvera
44b7e7640e Remove more constraints 2018-10-30 13:53:03 -04:00
Rob Rix
c71d9ba199 Include the SHA from the Options. 2018-10-30 13:48:22 -04:00
Rob Rix
4faf8dcc52 Add a SHA to Options. 2018-10-30 13:47:12 -04:00
Rob Rix
2d507b0912 Move the request_id field onto its own line. 2018-10-30 13:46:13 -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
Rick Winfrey
9d375d72a1 Comment out remaining problematic code 2018-10-29 16:41:40 -07:00
Rick Winfrey
8c26fbfb61 Fix up parts of Evaluatable Class; not sure about the klass declaration 2018-10-29 16:33:09 -07:00
Rick Winfrey
d76fcb73a7 Sketch out Evalutable TypeAlias 2018-10-29 16:01:59 -07:00