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

18331 Commits

Author SHA1 Message Date
Rob Rix
fb4b254e5c define returns in unit. 2018-12-10 10:37:38 -05:00
Rob Rix
a2b6a27005 Defining built-ins returns in unit. 2018-12-10 10:36:51 -05:00
Rob Rix
7587536d4d Avoid constructing a ValueRef. 2018-12-10 10:36:02 -05:00
Rob Rix
17541d6b3e Analyze to values. 2018-12-10 10:34:17 -05:00
Rob Rix
dd2ef7bbdb Evaluate to values. 2018-12-10 10:29:41 -05:00
Rob Rix
826da6d8ca Pass eval an evaluator producing values. 2018-12-10 10:12:09 -05:00
Rob Rix
e7f8a88905 Evaluate TypeScript.JSX.RequiredParameter using ref. 2018-12-10 09:55:50 -05:00
Rob Rix
e305f1e18e Evaluate Ruby.Assignment using ref. 2018-12-10 09:54:51 -05:00
Rob Rix
8caee1226d Evaluate Statement.Assignment using ref. 2018-12-10 09:53:12 -05:00
Rob Rix
0adaad3ba0 Evaluate Expression.Delete using ref. 2018-12-10 09:52:51 -05:00
Rob Rix
3d2ced84c3 Make ref throw the error. 2018-12-10 09:51:08 -05:00
Rob Rix
03fda04500 Compose in the other direction. 2018-12-10 09:46:39 -05:00
Rob Rix
f96fb53501 Factor out the kleisli composition. 2018-12-10 09:46:05 -05:00
Rob Rix
9116072186 Make the ref parameter throw on failure. 2018-12-10 09:44:54 -05:00
Rob Rix
e0e8b1b566 Add a RefError constructor to EvalError. 2018-12-10 09:42:34 -05:00
Rob Rix
4c59a6bafa eval takes a reference evaluator. 2018-12-10 09:32:02 -05:00
joshvera
18388a66ee Add AbstractHole constraint 2018-12-07 18:16:32 -05:00
joshvera
486e50469a Use undefined' 2018-12-07 18:16:24 -05:00
joshvera
c0b1bdaf08 Add New instance 2018-12-07 17:57:30 -05:00
joshvera
283284e91e Add ConstructorError and ScopedEnvError 2018-12-07 17:57:20 -05:00
joshvera
04e257991a declaredName of New is its subject 2018-12-07 17:31:59 -05:00
joshvera
9586b476fd Assign New changes
and add MetaProperty
2018-12-07 17:31:44 -05:00
joshvera
59be0c0e00 Improve liftDeclaredName instance for Calls 2018-12-07 16:55:27 -05:00
Rob Rix
231e0f81b7 Give eval a dummy parameter. 2018-12-07 16:16:23 -05:00
Rob Rix
0cf03b6abe Give ref an extra parameter for the slot-recurrence function. 2018-12-07 16:00:53 -05:00
Rob Rix
4e18bd6a40 Simplify the open-recursion since our host language is call-by-need. 2018-12-07 15:55:35 -05:00
Rob Rix
0b36f9bad1 Module results hold values. 2018-12-07 15:23:03 -05:00
Rob Rix
76537758fc Generalize graphingTerms over the result type. 2018-12-07 15:02:48 -05:00
Rob Rix
9acacd0716 runFunction takes an evaluator producing values. 2018-12-07 14:49:37 -05:00
Rob Rix
df4413f2a4 Calls return values. 2018-12-07 14:46:41 -05:00
Rob Rix
a51e5f67c1 They do. 2018-12-07 14:33:45 -05:00
Rob Rix
80ce9ab357 Functions return values. 2018-12-07 14:30:47 -05:00
Rob Rix
ed073ba245 While operates on values, not ValueRefs. 2018-12-07 12:59:01 -05:00
Rob Rix
36a7c31166 LoopControl operates on values, not ValueRefs. 2018-12-07 12:52:51 -05:00
Rob Rix
09d616788e Return holds a value, not a ValueRef. 2018-12-07 12:38:16 -05:00
Patrick Thomson
0d361e9b0b Add ZSuper syntax node (#2292)
Previously, invocations of `super` were captured as an `Identifier`.
It is straightforward enough to return a ZSuper instead.
2018-12-07 12:21:32 -05:00
Rob Rix
ba2cabc979 Revert "Abbreviate the Effect instance for Modules."
This reverts commit d51f3ec67b35c1ed460617b5561016afa30ae9ec.
2018-12-07 11:46:05 -05:00
Rob Rix
d82d0ad584 Revert "Rename resolve to resolvePaths."
This reverts commit 6c2cd2a6c9a56956b6d6bae61510939b21f25080.
2018-12-07 11:46:01 -05:00
Rob Rix
3c2a4241e8 Rename resolve to ref. 2018-12-07 11:45:29 -05:00
Rob Rix
23e3a688f7 Resolve MemberAccesses. 2018-12-07 11:40:11 -05:00
Rob Rix
3fd19e07d8 Specialize resolve for Identifier. 2018-12-07 11:32:13 -05:00
Rob Rix
260a44e7a0 Constrain callers of resolve a little further. 2018-12-07 11:31:25 -05:00
Rob Rix
ca6fad7c06 resolve returns in Maybe. 2018-12-07 11:01:46 -05:00
Rob Rix
f59cdd394b Add a resolve method to Evaluatable with a (bad) default definition. 2018-12-07 10:34:40 -05:00
Rob Rix
adffd6b9c4 Rename resolve to resolvePaths. 2018-12-07 09:52:20 -05:00
Rob Rix
5189c1204a Abbreviate the Effect instance for Modules. 2018-12-07 09:48:58 -05:00
joshvera
c39ed82293 Remove PHP NamespaceName instance 2018-12-06 17:30:30 -05:00
joshvera
ec83947033 Remove PHP Namespace instance 2018-12-06 17:30:03 -05:00
joshvera
6688380c15 Remove comments 2018-12-06 17:29:55 -05:00
joshvera
1b23d1d0dd Merge remote-tracking branch 'origin/master' into heap-frames 2018-12-06 16:32:38 -05:00
joshvera
192943889b delint 2018-12-06 16:16:25 -05:00
joshvera
14a47d8711 parens 2018-12-06 15:56:42 -05:00
joshvera
30cb4f43f6 Remove unused bind 2018-12-06 15:53:58 -05:00
Rob Rix
0b6e3430de Clarify that we’re returning the first path we find.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 15:48:55 -05:00
Rob Rix
2cd7257429 Merge branch 'heap-frames' of https://github.com/github/semantic into heap-frames 2018-12-06 15:44:27 -05:00
Rob Rix
a4ec6dc3a8 Generalize foldrGraph to foldGraph producing a Monoidal value.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 15:42:36 -05:00
joshvera
34d5825cf9 Implement Let 2018-12-06 15:29:30 -05:00
joshvera
61a0a9052f Fix tuple instance 2018-12-06 15:29:24 -05:00
joshvera
9b7670e655 Implement tuple eval 2018-12-06 15:22:33 -05:00
joshvera
5f395923a7 Implement Array eval 2018-12-06 15:22:06 -05:00
Rob Rix
664877024d Find paths uniformly using findPath.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 15:18:39 -05:00
Rob Rix
e5c5d36c3c Define a function to find a path to a declaration through a graph.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 15:11:22 -05:00
Rob Rix
db698dbd98 Build up paths using foldrGraph.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 15:04:40 -05:00
Rob Rix
c278733fd7 Define a generic graph traversal operation.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 15:02:59 -05:00
Rob Rix
adfcb37231 Move the Path instances into a deriving clause.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 13:11:44 -05:00
Rob Rix
b28d877845 🔥 a redundant language extension.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 13:09:35 -05:00
Rob Rix
dcd751f4b9 Define Path as an ordinary datatype.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 13:08:56 -05:00
Rob Rix
79e235ce34 Derive the instances for ScopeGraph in a deriving clause.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 13:06:24 -05:00
Rob Rix
1e7c8d63f6 Factor the module info & span into BaseError’s Eq1 instance.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 13:02:37 -05:00
Rob Rix
5eb73810eb Show module info & span in BaseError.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 12:59:00 -05:00
Rob Rix
87a4f2574b Add missing cases to ScopeError’s Eq1 instance.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 12:58:48 -05:00
Rob Rix
f95b06a3b4 Don’t loop on cyclic graphs.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-12-06 12:34:22 -05:00
Rob Rix
c486eb82ce Follow export edges. 2018-12-06 12:13:10 -05:00
Rob Rix
f9c124f303 Replace the address pair Reader with separate CurrentFrame/Scope Readers. 2018-12-06 12:03:07 -05:00
Rob Rix
04e2ca5321 Define CurrentFrame/Scope newtypes. 2018-12-06 11:46:34 -05:00
Rob Rix
74ca31af53 🔥 a bunch of uses of scoped type variables. 2018-12-06 11:45:13 -05:00
Rob Rix
7a4f8a8503 Re-enable TupleSections. 2018-12-06 11:27:33 -05:00
Rob Rix
5e62b5139b Merge branch 'heap-frames' of https://github.com/github/semantic into heap-frames 2018-12-06 11:22:34 -05:00
Rob Rix
454b9d669d Don’t traverse export edges.
Per discussion with @joshvera: https://github.slack.com/archives/C0E7PGQQ5/p1544111976406600

This makes the tests run again, tho two of them fail.
2018-12-06 11:22:15 -05:00
Rob Rix
0e4a91fc91 Add a convenience for constructing a path to a declaration. 2018-12-06 11:20:09 -05:00
Rob Rix
9375a82be2 Simplify in terms of an insertReference helper. 2018-12-06 11:14:35 -05:00
Rob Rix
b3ef26f301 Use insertScope here too. 2018-12-06 11:10:19 -05:00
Rob Rix
b47e28f278 Use insertScope. 2018-12-06 11:09:08 -05:00
Rob Rix
816205244c We don’t. 2018-12-06 10:50:43 -05:00
joshvera
c7c9aafa2b s/Module/InternalModule 2018-12-06 10:49:04 -05:00
joshvera
4a7fa7b18a Implement AbstractClass 2018-12-06 10:48:58 -05:00
Rob Rix
de416fa88c Use insertFrame in insertFrameLink. 2018-12-06 10:47:27 -05:00
Rob Rix
c23b587f80 Rename the Heap field to unHeap. 2018-12-06 10:45:36 -05:00
joshvera
1ddd78b9de Merge branch 'heap-frames' of https://github.com/github/semantic into heap-frames 2018-12-06 10:44:43 -05:00
joshvera
4ee84bc538 Implement InternalModule 2018-12-06 10:44:40 -05:00
joshvera
9ac611e17f Implement Module 2018-12-06 10:41:26 -05:00
Rob Rix
8074a3a37f Realign some cases. 2018-12-06 10:40:50 -05:00
Rob Rix
15d53b25fa 🔥 a redundant do-block. 2018-12-06 10:39:56 -05:00
Rob Rix
b9b007277d 🔥 commented-out functionality. 2018-12-06 10:38:59 -05:00
Rob Rix
3b2c76c283 Customize the Show instance for Heap for brevity. 2018-12-06 10:38:40 -05:00
Rob Rix
113fb7ea1c Reformat Frame. 2018-12-06 10:33:06 -05:00
joshvera
f0e2b51b80 Revert "Remove TypeScript Module"
This reverts commit 0c9d58ae586e492075dec1a8666492451f83a480.
2018-12-06 10:32:02 -05:00
joshvera
8bd2f30875 Format the heaps 2018-12-06 10:31:22 -05:00
joshvera
f82d82b2ba Remove TypeScript Module 2018-12-06 10:27:56 -05:00
Rob Rix
fc19fa67db Use declareFunction to define both Function and Method evaluation. 2018-12-06 10:20:51 -05:00
Rob Rix
e65da03e85 No we should not. 2018-12-06 10:20:05 -05:00
Rob Rix
4913b252b8 Define a helper for declaring functions/methods. 2018-12-06 10:19:22 -05:00
Rob Rix
8ff61d8299 Simplify the ValueRoots instance for closures. 2018-12-06 10:09:50 -05:00
Rob Rix
e639c3ffc3 Merge branch 'heap-frames' of https://github.com/github/semantic into heap-frames 2018-12-05 17:22:22 -05:00
Rob Rix
de6557442a 🔥 some redundant language extensions. 2018-12-05 17:21:57 -05:00
Rob Rix
92a82f0bd2 Simplify some fmaps. 2018-12-05 17:21:49 -05:00
Rob Rix
db823182a7 Use an operator section. 2018-12-05 17:21:23 -05:00
Rob Rix
da99d65e61 🔥 redundant parens. 2018-12-05 17:21:13 -05:00
Rob Rix
b21f900a3a Replace some dollars with dots. 2018-12-05 17:21:00 -05:00
joshvera
eee533a010 Merge branch 'heap-frames' of https://github.com/github/semantic into heap-frames 2018-12-05 15:58:11 -05:00
Rob Rix
743e24f9ce 🔥 a redundant language extension. 2018-12-05 15:56:27 -05:00
Rob Rix
46ab1d6b02 Use <$> again. 2018-12-05 15:56:00 -05:00
Rob Rix
7ca06eff7f Use <$>. 2018-12-05 15:55:41 -05:00
Rob Rix
cdb869e199 Functor law. 2018-12-05 15:55:13 -05:00
Rob Rix
0fe1f4db5f Use for_. 2018-12-05 15:54:22 -05:00
Rob Rix
a14cc79903 🔥 redundant parens. 2018-12-05 15:53:23 -05:00
joshvera
52c685d30f Implement default export instance 2018-12-05 15:45:20 -05:00
Rob Rix
47c2dea759 Merge branch 'heap-frames' of https://github.com/github/semantic into heap-frames 2018-12-05 15:39:09 -05:00
Rob Rix
6bb5308697 Rename the ScopeGraph field to unScopeGraph. 2018-12-05 15:35:02 -05:00
Rob Rix
d98cb05d0b Pattern-match against the constructor. 2018-12-05 15:34:20 -05:00
Rob Rix
7badac6148 Spacing. 2018-12-05 15:32:18 -05:00
Rob Rix
0daef02edc Don’t use record wildcards to unpack ScopeGraph. 2018-12-05 15:32:06 -05:00
Rob Rix
dc2b94eef2 Align { to the next line. 2018-12-05 15:26:35 -05:00
Rob Rix
6bf9f08f63 🔥 a couple of redundant do-blocks. 2018-12-05 15:24:50 -05:00
Rob Rix
3d34922fe2 Tighten up reference with <$> and <|>. 2018-12-05 15:24:10 -05:00
Rob Rix
c90e1605fd Tighten up insertImportReference using <$> and <|>. 2018-12-05 15:20:08 -05:00
Rob Rix
12ccbf8f85 Move modifyReferences down. 2018-12-05 15:19:09 -05:00
Rob Rix
e8a9634339 Flip modifyReferences. 2018-12-05 15:18:53 -05:00
Rob Rix
1e12265292 Extract a function to modify a scope’s references. 2018-12-05 15:17:18 -05:00
Rob Rix
ebc1a83ed1 Factor out a common traverseEdges function. 2018-12-05 15:14:57 -05:00
joshvera
522c87e627 Merge branch 'heap-frames' of https://github.com/github/semantic into heap-frames 2018-12-05 15:09:46 -05:00
joshvera
eae6b7c8b3 Add tests for QualifedExportFrom 2018-12-05 15:07:37 -05:00
Rob Rix
05392f2296 simplify lookupScopePath using <$>. 2018-12-05 14:53:42 -05:00
Rob Rix
98107e05be Correct associatedScope using >>=. 2018-12-05 14:48:44 -05:00
Rob Rix
3a3fa0c541 Define associatedScope using foldr. 2018-12-05 14:42:53 -05:00
Rob Rix
38611d053c Simplify associatedScope using <$> and <|>. 2018-12-05 14:42:05 -05:00
Rob Rix
3c2a544a2d Define scopeOfDeclaration using a foldr. 2018-12-05 14:40:12 -05:00
Rob Rix
bc0c28477f Simplify scopeOfDeclaration using <$ and <|> . 2018-12-05 14:38:25 -05:00
Rob Rix
9a966a51f4 Use maybe. 2018-12-05 14:35:30 -05:00
Rob Rix
433e3dd04d Use maybeM. 2018-12-05 14:35:24 -05:00
Rob Rix
4a80c83275 Parens instead of dollar. 2018-12-05 14:34:09 -05:00
Rob Rix
c4477c05b7 🔥 a redundant dollar. 2018-12-05 14:33:33 -05:00
Rob Rix
5981de0f56 Redundant parens. 2018-12-05 14:33:01 -05:00
Rob Rix
b67708c9d3 🔥 redundant parens. 2018-12-05 14:32:02 -05:00
Rob Rix
34b5965554 Extract a defineSelf helper. 2018-12-05 14:29:00 -05:00
Rob Rix
0132a24e1b 🔥 ScopedTypeVariables. 2018-12-05 14:26:43 -05:00
Rob Rix
c51629df80 do-notation does not work that way! 2018-12-05 14:26:33 -05:00
Rob Rix
776ae3ebe1 🔥 a redundant language extension. 2018-12-05 14:25:09 -05:00
Rob Rix
df18160bc0 🔥 redundant parens. 2018-12-05 14:24:40 -05:00
Rob Rix
e489bd75cb Beautify. 2018-12-05 14:24:19 -05:00