1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 15:35:14 +03:00
Commit Graph

8740 Commits

Author SHA1 Message Date
Rob Rix
2e251ee244 Factor callstacks out into a helper functor. 2017-08-17 11:50:52 -04:00
Rob Rix
1a20c7e356 Revert "Choose holds regular assignments."
This reverts commit ab81e11ec69214fd5e6c3f368bfcbf4b6073d8cd.
2017-08-17 11:15:46 -04:00
Rob Rix
e3bb646ab6 Revert "Alt holds regular assignments."
This reverts commit 865f2429dcb6cf16151a0ade4b989bb276c10596.
2017-08-17 11:15:44 -04:00
Rob Rix
21439ba2f0 Revert "Assignment is completely self-contained."
This reverts commit 44fed1d491b8098518af1eaeb6846e342d4861d8.
2017-08-17 11:15:42 -04:00
Rob Rix
c092b347a0 Revert "Rename Return to Pure."
This reverts commit d259b76d176903f199b11d3f2ada1e493a88df1d.
2017-08-17 11:15:41 -04:00
Rob Rix
b028875180 Revert "Define a Map action."
This reverts commit 8c2b57c1174de5576e976c4e97b42c6bb37daf29.
2017-08-17 11:15:40 -04:00
Rob Rix
0bd826198c Revert "Maps compose."
This reverts commit 1d97d6bff36c3d8f89e98b8fa685735f7e91c7f2.
2017-08-17 11:15:38 -04:00
Rob Rix
a162f5bbb6 Revert "Promote maps in sequence."
This reverts commit c4bffb328d5dc60677377f6f9813a3e7f444b3b4.
2017-08-17 11:15:37 -04:00
Rob Rix
a062a40f66 Revert "Bind through maps."
This reverts commit d39c0404e1e398308ad7d272134e19b7e02a4815.
2017-08-17 11:15:36 -04:00
Rob Rix
25a82e076b Revert "Add a Seq constructor."
This reverts commit 26c5e09ed43a87a1de8f002cb6af6b4bd15a5b88.
2017-08-17 11:15:34 -04:00
Rob Rix
ffcb1dac2e Revert "Run assignments direct-recursively."
This reverts commit 2ad1fe1a614b766c2ce295b55e79759bf5396db9.
2017-08-17 11:15:33 -04:00
Timothy Clem
c7fd754af8 Line em up 2017-08-16 14:45:18 -07:00
Timothy Clem
bb86b5241d Use token for pair with no children 2017-08-16 14:45:06 -07:00
Timothy Clem
d9da2c1339 Docs 2017-08-16 14:34:44 -07:00
Timothy Clem
ada7f4d4db Not using this import 2017-08-16 14:33:50 -07:00
Timothy Clem
41b843ed70 Formatting 2017-08-16 14:28:00 -07:00
Timothy Clem
680ad37eea Fix up chained strings, allow comments 2017-08-16 14:14:33 -07:00
Timothy Clem
4fa472f8a1 Comments in hashes, simplify a few literals 2017-08-16 14:11:09 -07:00
Rob Rix
802476eb8a Run assignments direct-recursively. 2017-08-16 17:04:29 -04:00
Timothy Clem
55e87d3095 Allow comments in assignments 2017-08-16 13:44:30 -07:00
Timothy Clem
f0e96bc947 Add in comment handling, re-write binary
Also add complex and rational literals
2017-08-16 13:30:13 -07:00
Rob Rix
b4aec090fe Add a Seq constructor. 2017-08-16 16:21:26 -04:00
Rob Rix
3f21c88cb1 Bind through maps. 2017-08-16 16:12:29 -04:00
Rob Rix
9aa021b404 Promote maps in sequence. 2017-08-16 16:12:06 -04:00
Rob Rix
6735125dc4 Maps compose. 2017-08-16 16:10:57 -04:00
Rob Rix
435121211a Define a Map action. 2017-08-16 16:10:12 -04:00
Rob Rix
88d8a80a03 Rename Return to Pure. 2017-08-16 16:07:08 -04:00
Rob Rix
5551390619 Assignment is completely self-contained. 2017-08-16 16:04:45 -04:00
Rob Rix
187441e9af Alt holds regular assignments. 2017-08-16 15:47:13 -04:00
Rob Rix
320a302f58 Choose holds regular assignments. 2017-08-16 15:44:17 -04:00
Timothy Clem
8fc65cbee2 Properly assign binary - and * 2017-08-16 12:25:34 -07:00
Rob Rix
7074a18012 Merge branch 'master' into assignment-optimization 2017-08-16 14:40:36 -04:00
Rob Rix
cae20bcbf9 📝 the Python combinators. 2017-08-16 14:35:57 -04:00
Rob Rix
9d63ca22ae 📝 the contextualizing operators. 2017-08-16 14:33:10 -04:00
Rob Rix
b6401aaa9f 📝 handleError & parseError. 2017-08-16 14:27:53 -04:00
Rob Rix
2457402a48 📝 emptyTerm. 2017-08-16 14:22:25 -04:00
Rob Rix
fb60c60c9c 📝 makeTerm & friends. 2017-08-16 14:22:19 -04:00
Rob Rix
f7abab4186 Convince everything that we have MonadFree instances. 2017-08-16 14:17:50 -04:00
Rob Rix
e4ccee6d02 📝 manyThrough. 2017-08-16 14:09:50 -04:00
Rob Rix
f71eab9ced 📝 advance & token. 2017-08-16 14:08:10 -04:00
Rob Rix
8bb23f0642 🔥 infixChoice. 2017-08-16 14:07:59 -04:00
Rob Rix
66abd4e327 Merge branch 'master' into systematic-comment-assignment 2017-08-16 13:23:40 -04:00
Rob Rix
40a5c5594b Rename assignBy to assign. 2017-08-16 13:21:57 -04:00
Rob Rix
fd44cc8603 Throw always has a valid error. 2017-08-16 13:11:57 -04:00
Rob Rix
05c1db40fd Alt holds a normal list. 2017-08-16 13:10:43 -04:00
Rob Rix
99bdeb6ce5 Compute the first set for label rules. 2017-08-16 13:08:33 -04:00
Rob Rix
ee42a0ece8 Push alternation through currentNode. 2017-08-16 13:02:17 -04:00
Rob Rix
7a996f739c Push alternation through advance & eof. 2017-08-16 13:01:33 -04:00
Rob Rix
b2072d24ca 🔥 the state effects. 2017-08-16 13:01:00 -04:00
Rob Rix
85bd4671b8 Fix node handling. 2017-08-16 12:56:30 -04:00
Rob Rix
889e8031a5 Revert "Define currentNode in terms of state."
This reverts commit 034449cadff61b15101f26ac9313e8dc4fc44432.
2017-08-16 12:50:35 -04:00
Rob Rix
098b9f8941 Revert "Define location in terms of state."
This reverts commit e90b5c5e0ddba4390ec6230357accf96f6211a1c.
2017-08-16 12:49:30 -04:00
Rob Rix
994d40cf23 Revert "Define advance in terms of state."
This reverts commit 7387c9ae3719f92bea2ac3b776561b099ee3e599.
2017-08-16 12:48:52 -04:00
Rob Rix
4daab99a09 Revert "Define eof in terms of state."
This reverts commit b71a285f23f1a7112173f03a2041bebaae637940.
2017-08-16 12:48:39 -04:00
Rob Rix
d861ff4329 Define eof in terms of state. 2017-08-16 12:38:31 -04:00
Rob Rix
1f36dc6136 Pull requireExhaustive out to the top level. 2017-08-16 12:36:32 -04:00
Rob Rix
b14ec8b99a Pull skipTokens out to the top level. 2017-08-16 12:35:56 -04:00
Rob Rix
35c69f6ba1 Rename dropAnonymous to skipTokens. 2017-08-16 12:35:44 -04:00
Rob Rix
b0f3d967c5 Use the AST synonym widely. 2017-08-16 12:26:41 -04:00
Rob Rix
a5812184b8 Tidy up Markdown with the AST synonym. 2017-08-16 12:24:47 -04:00
Rob Rix
6bbaa7a8e6 Parameterize the AST synonym by the functor. 2017-08-16 12:24:02 -04:00
Rob Rix
8d6d7535e8 Try to push alternation through equal states. 2017-08-16 12:23:00 -04:00
Rob Rix
4f46843e26 Push alternation through Get. 2017-08-16 12:20:42 -04:00
Rob Rix
9c198eb08a Define advance in terms of state. 2017-08-16 12:19:29 -04:00
Rob Rix
0ba1035755 Pull the advance state function out to the top level. 2017-08-16 12:18:40 -04:00
Rob Rix
a66bdfe1bb Define location in terms of state. 2017-08-16 12:13:55 -04:00
Rob Rix
496ee5a3c9 Assignment takes Cofree structures. 2017-08-16 12:07:53 -04:00
Rob Rix
ada798fcdb Define currentNode in terms of state. 2017-08-16 11:14:03 -04:00
Rob Rix
d1011231b9 State holds projected nodes. 2017-08-16 11:13:11 -04:00
Rob Rix
61281b8b65 Define nodeError using wildcards. 2017-08-16 10:55:33 -04:00
Rob Rix
56ae476d28 The projection function is rank-1. 2017-08-16 10:50:04 -04:00
Rob Rix
226d703baf Sort the imports. 2017-08-16 10:49:47 -04:00
Rob Rix
847f8c28c0 Drop tokens before the end of branches. 2017-08-16 07:41:40 -07:00
Rob Rix
2b4efe8435 Rename project to currentNode. 2017-08-16 10:33:56 -04:00
Rob Rix
a8607ce41c Project rules return the current node. 2017-08-16 10:31:25 -04:00
Rob Rix
fb7791f852 Clean up Markdown assignments a little with token rules. 2017-08-16 10:30:25 -04:00
Rob Rix
039789d32a Repeated zero-width matches are ok. 2017-08-16 10:10:14 -04:00
Rob Rix
7863683d5e Define a MonadState instance for Assignment. 2017-08-16 10:04:36 -04:00
Rob Rix
68ae0309b6 Add context to decorated class/function definitions. 2017-08-16 09:18:11 -04:00
Rob Rix
dd7f601149 Merge branch 'eof-drops-anonymous-nodes' into systematic-comment-assignment 2017-08-16 09:06:03 -04:00
Rob Rix
bc4f6004f1 Drop tokens before the end of branches. 2017-08-16 08:56:43 -04:00
Timothy Clem
f0a2f40c10 Few more ruby assignment fixes 2017-08-15 14:16:21 -07:00
Timothy Clem
84bacf6ad1 Drop anon nodes for eof 2017-08-15 14:14:24 -07:00
Rob Rix
eb73e8a75e Post-contextualize chained terms. 2017-08-15 16:26:30 -04:00
Rob Rix
00a9a6c672 Left-chain comparisons. 2017-08-15 16:23:34 -04:00
Timothy Clem
210d84c658 Use handleError and manyTill in Ruby Assignment 2017-08-15 13:06:43 -07:00
Timothy Clem
9dda6bf725 Merge remote-tracking branch 'origin/master' into ruby-assignment-fixes 2017-08-15 07:59:24 -07:00
Rob Rix
c04896abce Lambdas have empty names. 2017-08-15 10:00:54 -04:00
Rob Rix
4c161b49bd Don’t assign identifiers for continue, pass, and break keywords. 2017-08-15 09:49:20 -04:00
Timothy Clem
64834dfb86 Spelling 2017-08-14 16:14:37 -07:00
Rob Rix
3d0bc0e926 Assign key-value pairs as infix terms. 2017-08-14 19:09:55 -04:00
Rob Rix
2e4c88632c Stop discarding comments after pairs. 2017-08-14 19:08:52 -04:00
Rob Rix
8468f3f2e4 Stop discarding comments after dictionaries. 2017-08-14 19:08:31 -04:00
Rob Rix
6d5105f9c0 Define booleanOperator using infixTerm. 2017-08-14 19:06:07 -04:00
Timothy Clem
1739fa5c17 Forcing the builds to run 2017-08-14 16:00:02 -07:00
Rob Rix
0fc8fd2032 🔥 contextualizeLast. 2017-08-14 18:45:29 -04:00
Rob Rix
a7cfb3c988 Assign multiple comments at the end of a branch. 2017-08-14 18:38:29 -04:00
Timothy Clem
b6f307b92e Bump, bump 2017-08-14 15:35:51 -07:00
Timothy Clem
1c8d979a73 Bump build 2017-08-14 15:28:33 -07:00
Rob Rix
e3e3657b2c Assign comments right before else clauses. 2017-08-14 18:26:28 -04:00
Rob Rix
ec19a35697 Simplify the assignment of partial decorators. 2017-08-14 18:01:00 -04:00
Rob Rix
51638833df Assign comments at the end of branches. 2017-08-14 17:57:12 -04:00
Rob Rix
a2ced02795 Define separate postContextualize & postContextualizeThrough rules. 2017-08-14 17:56:58 -04:00
Timothy Clem
a6db57793e ++haskell-tree-sitter to enable dependent files for regenerating TH code 2017-08-14 14:36:08 -07:00
Rob Rix
c3addf1292 Define a function to contextualize the last element in a list. 2017-08-14 17:29:43 -04:00
Rob Rix
3043434628 Contextualize inside assignments. 2017-08-14 17:09:04 -04:00
Rob Rix
5a4e497048 Contextualize inside comparisonOperator and binaryOperator. 2017-08-14 17:02:42 -04:00
Rob Rix
dfbe85e5a0 Define a helper to contextualize infix terms. 2017-08-14 16:56:40 -04:00
Rob Rix
27f4db2f6a Correct the return types in infixContent. 2017-08-14 16:56:11 -04:00
Rob Rix
6f22e49623 Contextualize after the right term. 2017-08-14 16:50:16 -04:00
Rob Rix
82b1bc1f87 Define a helper to match context infix. 2017-08-14 16:46:51 -04:00
Rob Rix
d1ee070aa8 Context holds a NonEmpty list of fields. 2017-08-14 16:42:49 -04:00
Rob Rix
2d6f130d32 Define a Diffable' instance for NonEmpty fields in syntax. 2017-08-14 16:42:13 -04:00
Rob Rix
07fda850f9 Correct the docs for the Diffable' instance for Rec1 of []. 2017-08-14 16:39:48 -04:00
Rob Rix
54c6095da4 Define a GAlign instance for non-empty lists. 2017-08-14 16:38:05 -04:00
Rob Rix
9e2444d71d Define a post-contextualizing syntax combinator. 2017-08-14 16:26:01 -04:00
Rob Rix
e31c5eddb8 Define contextualize in terms of makeTerm1. 2017-08-14 16:19:11 -04:00
Timothy Clem
e5e221aa69 Try to get TH to run on all build nodes 2017-08-14 13:19:01 -07:00
Timothy Clem
5aa28af55b Bump for mac build 2017-08-14 13:15:44 -07:00
Rob Rix
f6c77b4daa Simplify assignment' a little further. 2017-08-14 16:12:31 -04:00
Rob Rix
e59f148a57 Simplify assignment'. 2017-08-14 16:10:29 -04:00
Rob Rix
ba3ef97260 Simplify binaryOperator. 2017-08-14 16:02:46 -04:00
Rob Rix
f4ff0a6f64 Correct the error message. 2017-08-14 15:58:51 -04:00
Rob Rix
212ce544da Simplify comparisonOperator. 2017-08-14 15:58:13 -04:00
Timothy Clem
93b337af4c Merge remote-tracking branch 'origin/master' into ruby-assignment-fixes 2017-08-14 12:50:45 -07:00
Rob Rix
d7e3092192 Split out makeTerm1 & makeTerm1'. 2017-08-14 15:50:01 -04:00
Rob Rix
d657570e3e Define a makeTerm-alike which constructs a Term from non-empty foldable syntax. 2017-08-14 15:45:30 -04:00
Rob Rix
d74d67b803 Generalize infixChoice to any Alternative. 2017-08-14 15:33:42 -04:00
Rob Rix
a9dd39e149 Pass constructor assignments to infixChoice directly. 2017-08-14 15:32:58 -04:00
Rob Rix
4b3668f222 Define an infix choice combinator. 2017-08-14 15:31:43 -04:00
Rob Rix
f0b55a4a94 Add callstacks to manyThrough. 2017-08-14 15:31:35 -04:00
Rob Rix
c0c479c302 Unparenthesize a thing. 2017-08-14 15:13:39 -04:00
Rob Rix
525c31694a 🔥 an obsolete comment. 2017-08-14 15:13:34 -04:00
Rob Rix
cd25018e40 Rearrange a few rules to reuse expressions. 2017-08-14 15:12:31 -04:00
Rob Rix
902ac23def Rewrite conditionalExpression without binds. 2017-08-14 14:46:05 -04:00
Rob Rix
a1fd6c9ad9 Reuse the expressions assignment. 2017-08-14 14:44:15 -04:00
Rob Rix
70e83e215f Use tokens to match symbols & advance. 2017-08-14 14:37:09 -04:00
Rob Rix
297675c90e Add a token combinator. 2017-08-14 13:59:48 -04:00
Rob Rix
965f716be1 Add an advance rule to pass nodes. 2017-08-14 13:58:02 -04:00
Rob Rix
41d5ec6065 Relax/remove some Ix constraints. 2017-08-14 13:49:39 -04:00
Rob Rix
e97b3e6fc6 Unfreeze notFollowedBy. 2017-08-14 13:46:14 -04:00
Rob Rix
e32c566774 Contextualize expressions. 2017-08-14 12:35:43 -04:00
Rob Rix
ea161dea48 Contextualize concatenated string fragments. 2017-08-14 12:35:14 -04:00
Rob Rix
530179f833 🔥 discarding comments in conditionalExpression. 2017-08-14 12:34:58 -04:00
Rob Rix
e85e84371e Use the term combinator widely. 2017-08-14 12:08:29 -04:00
Rob Rix
52472efbf3 Define a helper to contextualize terms. 2017-08-14 12:07:53 -04:00
Rob Rix
3c7e940b9e Contextualize the first operand of boolean expressions. 2017-08-14 12:06:57 -04:00
Rob Rix
512a297142 🔥 a redundant location rule. 2017-08-14 12:05:08 -04:00
Rob Rix
9d5c5baab1 Don’t match comments with the expression rule. 2017-08-14 12:01:54 -04:00
Rob Rix
d532486dc0 Contextualize within boolean operators. 2017-08-14 12:01:41 -04:00