1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 18:06:14 +03:00
Commit Graph

18030 Commits

Author SHA1 Message Date
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