1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00
Commit Graph

8315 Commits

Author SHA1 Message Date
Rob Rix
143e6ec26d Select the result with the fewest errors. 2017-08-03 19:36:51 -04:00
Rob Rix
f79e118d2e Committed choices with alternatives attempt the alternative. 2017-08-03 19:31:16 -04:00
Rob Rix
51185311af Flatten Alt rules into a non-empty list. 2017-08-03 19:25:54 -04:00
Rob Rix
c0bdb15d61 Assignment ambiguously. 2017-08-03 19:17:17 -04:00
Timothy Clem
6b01580dbb Merge remote-tracking branch 'origin/master' into the-great-tree-sitter-update 2017-08-03 15:09:35 -07:00
Rick Winfrey
f7efacca73 🔥 comment 2017-08-03 14:34:24 -07:00
Rick Winfrey
b1f843679f Add import for swap 2017-08-03 14:22:49 -07:00
Rick Winfrey
1c72b23cea Merge branch 'master' into bump-tree-sitter-python 2017-08-03 14:15:44 -07:00
Rob Rix
9572b96fa4 Define a MonadError instance for Amb. 2017-08-03 17:04:47 -04:00
Rob Rix
5ca85ec4ed Define a Monad instance for Amb. 2017-08-03 17:02:47 -04:00
Rob Rix
aeb4a65c61 Define an Applicative instance for Amb. 2017-08-03 17:02:28 -04:00
Rob Rix
7dd880dd18 Define a Semigroup instance over Amb. 2017-08-03 17:02:15 -04:00
Rob Rix
fb9f27a00e Define an Amb datatype. 2017-08-03 17:02:05 -04:00
Rob Rix
69892a8dc9 Stub in a module for ambiguous data. 2017-08-03 16:58:23 -04:00
Rob Rix
10f39e2fdf requireExhaustive returns a NonEmpty list of results. 2017-08-03 15:57:48 -04:00
Rob Rix
6c9d23d827 Assignment produces a NonEmpty list of results. 2017-08-03 15:54:43 -04:00
Rob Rix
dd8e283632 Revert "Run assignments using iterLookahead."
This reverts commit 2a280ffb7dea2707e13bc518d93af9d6e0648bd0.
2017-08-03 15:38:17 -04:00
Rob Rix
d3895a504e Revert "Define a function computing the first sets for assignments."
This reverts commit 55e4c4f33ed52bf49f018dfd7251117e86c3e774.
2017-08-03 15:38:16 -04:00
Rob Rix
c656ddede7 Revert "Compute the first sets of alternations."
This reverts commit 43644d1d591ed23c434fac120df27c985148523f.
2017-08-03 15:38:15 -04:00
Rob Rix
02f847674c Revert "Compute the first sets of repetitions."
This reverts commit d2f133799ae567cb345d7c33cd1f4d08956382c4.
2017-08-03 15:38:14 -04:00
Rob Rix
45754489e2 Revert "Compute the first sets of catchError rules."
This reverts commit c5ec4e97f81acf299381c56556c92f629a57dac4.
2017-08-03 15:38:12 -04:00
Rob Rix
f43c2a889c Revert "Add the next set of productions to the state."
This reverts commit 450d9d6c2ef9570388162cb5814e7c1fa5cbf51f.
2017-08-03 15:38:06 -04:00
Rob Rix
1d67f1a3a3 Revert "Set the next set of productions in repetitions."
This reverts commit 30812ca0d171fcd01f821bf317d4ae01511a120b.
2017-08-03 15:38:03 -04:00
Rob Rix
48139bf998 Revert "Set the next set of productions in alternations."
This reverts commit 8925971c100f5523b9c95f862e6e8ac7e22d47b7.
2017-08-03 15:38:01 -04:00
Rob Rix
20271f918f Revert "Represent the next set of productions with an IntSet."
This reverts commit 90ab7924b2514e5f7116b38cdf67614a9c9ca96b.
2017-08-03 15:38:00 -04:00
Rob Rix
a5c918adf7 Revert "📝 stateNextSet."
This reverts commit eac40e6b7c38bac50b2fb1e06535f7060bb4f707.
2017-08-03 15:37:58 -04:00
Rob Rix
0629b136d6 Revert "Define a setter for the next set field."
This reverts commit 1fe1dbc4669fb2460a58925ac00c226172a614f2.
2017-08-03 15:37:56 -04:00
Rob Rix
291e6719db Revert "Swap the order of the setter’s params."
This reverts commit 6d7534d01c260a6427c5ea405eb7086ebd263c7c.
2017-08-03 15:37:55 -04:00
Rob Rix
baffab585b Revert "Use the setter to set & reset the next set."
This reverts commit ee844956ecaa6ab6beb597b44cdeaa1c07031866.
2017-08-03 15:37:53 -04:00
Rob Rix
084985d2a1 Revert "Only run error handlers when the next set of productions doesn’t contain the current node."
This reverts commit 1d5fa138f0febf1940bd9c1ebd421ccf3932c27b.
2017-08-03 15:37:51 -04:00
Rob Rix
b4a2ba099a Revert "Simplify how we limit error handling."
This reverts commit 86ed796bc54b073a0c9a267be267b519ba0a47ef.
2017-08-03 15:37:50 -04:00
Rob Rix
f060e11654 Revert "Consider catchError rules’ own next set."
This reverts commit 04a02be4c4da5409360c98dc723104d53b004875.
2017-08-03 15:37:48 -04:00
Rob Rix
7c1c4f33d4 Consider catchError rules’ own next set. 2017-08-03 13:37:46 -04:00
Rob Rix
7075115769 Simplify how we limit error handling. 2017-08-03 13:36:17 -04:00
Rob Rix
3088e42a84 Only run error handlers when the next set of productions doesn’t contain the current node. 2017-08-03 13:34:53 -04:00
Rob Rix
32252b1caa Use the setter to set & reset the next set. 2017-08-03 13:22:50 -04:00
Rob Rix
d8ead33306 Swap the order of the setter’s params. 2017-08-03 13:22:40 -04:00
Rob Rix
2915d46a85 Define a setter for the next set field. 2017-08-03 13:21:37 -04:00
Rob Rix
aec09b060d 📝 stateNextSet. 2017-08-03 13:20:03 -04:00
Rob Rix
382d0476fa Represent the next set of productions with an IntSet. 2017-08-03 13:19:24 -04:00
Rob Rix
228b525912 Set the next set of productions in alternations. 2017-08-03 13:17:02 -04:00
Rob Rix
390a60c5e7 Set the next set of productions in repetitions. 2017-08-03 13:16:08 -04:00
Rob Rix
7f1ff76e4b Add the next set of productions to the state. 2017-08-03 13:13:49 -04:00
Rob Rix
7ebd2765ea Compute the first sets of catchError rules. 2017-08-03 13:08:32 -04:00
Rob Rix
c74d313194 Compute the first sets of repetitions. 2017-08-03 13:07:54 -04:00
Rob Rix
f03fd85add Compute the first sets of alternations. 2017-08-03 13:07:14 -04:00
Timothy Clem
6bc00b46d7 Merge remote-tracking branch 'origin/master' into the-great-tree-sitter-update 2017-08-03 09:50:27 -07:00
Rob Rix
92a2f999ff Define a function computing the first sets for assignments. 2017-08-03 12:33:27 -04:00
Rob Rix
ccd7812e8d Run assignments using iterLookahead. 2017-08-03 12:26:07 -04:00
Rob Rix
e8074d2955 Merge branch 'master' into delimited-control 2017-08-03 12:16:45 -04:00
Rob Rix
2529288f87 Merge branch 'master' into requiem-for-a-protolude 2017-08-03 11:51:09 -04:00
Timothy Clem
9f41276e3b Update for TypeScript grammar changes 2017-08-03 08:49:20 -07:00
Timothy Clem
f38dc3f578 Update for Ruby grammar changes 2017-08-03 08:19:23 -07:00
Timothy Clem
6563a69ebc Update for Golang grammar changes 2017-08-03 08:00:20 -07:00
Timothy Clem
1ebe08c81d Update tree-sitter and all languages 2017-08-03 07:59:00 -07:00
Yuki Izumi
134aebe418 Fix my bad Haskell style 2017-08-03 17:26:53 +10:00
Yuki Izumi
bcf6b5b45e Use cmark-gfm package 2017-08-03 17:22:40 +10:00
Rick Winfrey
0dd16d83c1 Fix comment 2017-08-02 17:46:48 -07:00
Rick Winfrey
947102e996 📝 many comment problem for conditional expressions 2017-08-02 17:45:05 -07:00
Rick Winfrey
5858d210b6 This allows for catching a comment, but not greedily matching expressions
Using `many comment` will consume anonymous nodes (including the `+` in a binary operator expression).
2017-08-02 17:27:43 -07:00
Rick Winfrey
12e5d30723 Merge branch 'master' into bump-tree-sitter-python 2017-08-02 16:24:22 -07:00
Rick Winfrey
4204df6003 Merge branch 'master' into parse-jsx 2017-08-02 15:51:45 -07:00
Rob Rix
918aeb5301 Recur via the worker function. 2017-08-02 17:37:34 -04:00
Rob Rix
79467e3be7 Wrap the body of runParser up in a worker function. 2017-08-02 17:36:48 -04:00
Rob Rix
8454e187d4 Swap the order of the parser & blob params. 2017-08-02 17:36:04 -04:00
Rob Rix
35a431f794 blobFields closes over the blob. 2017-08-02 17:35:08 -04:00
Rob Rix
02ddc4eb65 Show missing languages as the empty string. 2017-08-02 17:34:34 -04:00
Rob Rix
0c1d08d89d Produce a term when assignment fails at the root. 2017-08-02 17:32:12 -04:00
Rob Rix
b619389ec6 Don’t showBlob. 2017-08-02 17:28:53 -04:00
Rob Rix
38387be114 Don’t include the language key when there is no language. 2017-08-02 17:28:09 -04:00
Rob Rix
2d5a1746ba Merge branch 'master' into delimited-control 2017-08-02 17:23:26 -04:00
Rob Rix
29597fa165 Log the blob fields. 2017-08-02 17:21:45 -04:00
Rob Rix
066465e4d1 Syntax.Error always has an Assignment.Error. 2017-08-02 17:20:55 -04:00
Rob Rix
37704d15f1 Let handleError pick up parse errors. 2017-08-02 17:13:48 -04:00
Rob Rix
beb64af235 Handle errors in JSON. 2017-08-02 16:26:43 -04:00
Rob Rix
c4ca401b5d Handle errors in Ruby expressions. 2017-08-02 16:26:10 -04:00
Rob Rix
f47447a509 Handle assignment errors in Markdown. 2017-08-02 16:26:02 -04:00
Rob Rix
773bf87130 Use the shared combinators in the language assignments. 2017-08-02 16:19:40 -04:00
Rob Rix
c05ff0dd59 🔥 unnecessary Eq instances. 2017-08-02 16:16:35 -04:00
Rob Rix
696219509a Define parseError in Data.Syntax. 2017-08-02 16:15:34 -04:00
Rob Rix
a94eaeffaa Define handleError in Data.Syntax. 2017-08-02 16:15:28 -04:00
Rob Rix
ece4e2de3a Define emptyTerm in Data.Syntax. 2017-08-02 16:15:09 -04:00
Rob Rix
d6f6b9d09c Define makeTerm in Data.Syntax. 2017-08-02 16:14:52 -04:00
Rob Rix
83c6797fa9 Extract a handleError combinator. 2017-08-02 15:59:47 -04:00
Rob Rix
306c4ee42e Remove the redundant type parameter from Assignment. 2017-08-02 15:58:45 -04:00
Rob Rix
b6e064e187 Note that we should log assignment errors. 2017-08-02 15:50:22 -04:00
Rob Rix
69b66fcf21 Separate warnings for parsing & assignment errors in the tree. 2017-08-02 15:49:56 -04:00
Rob Rix
7d07624f4e Add an error handler to the Python expression rule. 2017-08-02 15:42:13 -04:00
Rob Rix
c2e2aa9b7c Log the details of assignment errors in the tree. 2017-08-02 15:35:06 -04:00
Rob Rix
6821e463d0 Add optional assignment errors to Syntax.Error. 2017-08-02 15:31:12 -04:00
Rob Rix
bc0df93593 Derive Foldable, Functor, & Traversable instances for Error. 2017-08-02 15:30:53 -04:00
Rob Rix
af6a3c8b75 Correct an obsolete comment. 2017-08-02 15:18:03 -04:00
Rob Rix
c8bedceabe Rename the type parameter for the parent context. 2017-08-02 15:12:50 -04:00
Rob Rix
f9976fd144 🔥 more redundant parens. 2017-08-02 15:04:02 -04:00
Rob Rix
fe1d3cb4db 🔥 redundant parens. 2017-08-02 15:03:45 -04:00
Rob Rix
2cc13c427d 🔥 Capture & Escape. 2017-08-02 15:00:06 -04:00
Rob Rix
aef66153d9 Remove the capture/escape from the Python grammar. 2017-08-02 14:59:53 -04:00
Rob Rix
9b1bd71523 Change the result type to reflect the rest of iteration. 2017-08-02 14:45:57 -04:00
Rob Rix
f2ae2cadd9 Run the delimited assignment. 2017-08-02 14:16:51 -04:00
Rob Rix
6e2f3a4358 Stub in an attempt at resolving assignment errors in Python expressions. 2017-08-02 14:10:54 -04:00
Rob Rix
ced0c5bfa5 Define smart constructors for capture & escape. 2017-08-02 14:05:34 -04:00
Rob Rix
7738dd991c Correct the type of the continuation. 2017-08-02 14:05:04 -04:00
Rob Rix
99f80fee90 Add an Escape constructor to AssignmentF. 2017-08-02 13:59:17 -04:00
Rob Rix
633f8b2c8e Add a Capture constructor to AssignmentF. 2017-08-02 13:57:29 -04:00
Rob Rix
cc21edd3bb Add a final result type parameter to Assignment. 2017-08-02 13:51:22 -04:00
Timothy Clem
1a5ffa9bcd Merge branch 'master' into print-source 2017-08-02 10:44:31 -07:00
Rob Rix
941dbe4d8a Define a function to retrieve the callstack from errors. 2017-08-02 12:19:17 -04:00
Rob Rix
a017b27781 Factor out the construction of the error. 2017-08-02 12:07:47 -04:00
Rob Rix
2093e85a76 Produce the callstacks from the assignment constructors. 2017-08-02 11:58:20 -04:00
Rick Winfrey
9f791d877b Shim for handling comments when they are siblings to decorators 2017-08-01 18:20:30 -07:00
Rick Winfrey
9937b5371d Restrict decorated definition final expressions (for better errors) 2017-08-01 18:19:56 -07:00
Rick Winfrey
462bccb66e Assign comments in concatenated strings as empty string 2017-08-01 18:19:18 -07:00
Rick Winfrey
ef907b81d7 Many comment is too greedy (and not necessary here) 2017-08-01 17:21:56 -07:00
Rick Winfrey
51d3298282 Elide comments from boolean operator expressions 2017-08-01 17:07:31 -07:00
Rick Winfrey
a2bb8479a3 Elide comments from comprehensions 2017-08-01 17:02:50 -07:00
Rick Winfrey
f486f2c41a Elide comments preceeding a binary operator but after the left hand expression 2017-08-01 16:54:12 -07:00
Rick Winfrey
a2dd9de441 Handle comments in problematic locations for conditional expressions 2017-08-01 16:52:38 -07:00
Rick Winfrey
09889b86d5 Capture expressions on right hand side of binary operator expressions 2017-08-01 16:52:19 -07:00
Rick Winfrey
61a5fd0200 Capture expressions on the right hand side (to include comments) 2017-08-01 16:51:39 -07:00
Rick Winfrey
ada6eb2d51 Not all expressions have WithItem the symbol 2017-08-01 16:51:12 -07:00
Timothy Clem
10ad4e29f6 Autodetect print source 2017-08-01 15:05:25 -07:00
Rick Winfrey
e6bcf3ac82 Allow comments after decorator line 2017-08-01 12:53:33 -07:00
Rick Winfrey
921bc1db2d Assign argument list 2017-08-01 12:47:45 -07:00
Rick Winfrey
61a34fe866 Assign comments in decorator definitions 2017-08-01 11:53:38 -07:00
Timothy Clem
e087469624 Better logging keys 2017-07-31 15:22:11 -07:00
Timothy Clem
fa3523d020 Merge branch 'master' into exit-status 2017-07-31 12:45:41 -07:00
Timothy Clem
268563b929 queue log messages directly 2017-07-31 12:44:08 -07:00
Timothy Clem
613fd2c6fb Already in IO 2017-07-31 12:43:44 -07:00
Rob Rix
a6fa1c80c9 Whoops. 2017-07-31 15:23:58 -04:00
Timothy Clem
1ed5d718f6 Merge branch 'master' into exit-status 2017-07-31 11:00:01 -07:00
Timothy Clem
ee18cfff39 Case id as ID 2017-07-31 09:05:55 -07:00
Timothy Clem
b5c1967440 Allow optional logging of request_id 2017-07-31 09:01:51 -07:00
Timothy Clem
87b2662b02 Log process ID 2017-07-31 08:56:17 -07:00
Timothy Clem
79b5509b00 Let the time task do it's own logging 2017-07-31 08:37:35 -07:00
Timothy Clem
6e682c880e Slightly cleaner nested eithers 2017-07-31 08:23:53 -07:00
Timothy Clem
6c44985e43 Switch disableColor to enableColor 2017-07-31 08:19:34 -07:00
Timothy Clem
e05b6e156e Cleanup use of showPairs 2017-07-31 08:14:32 -07:00
Rob Rix
e53adbd247 Merge branch 'master' into output-typeclass 2017-07-31 11:05:04 -04:00
Timothy Clem
14a2a8ba55 It's a bit more clear if this is called Log 2017-07-28 17:09:08 -07:00
Timothy Clem
4ecbf51763 Extract Semantic.Log 2017-07-28 17:07:48 -07:00
Rick Winfrey
30dccaffa1 Merge branch 'master' into parse-jsx 2017-07-28 17:06:11 -07:00
Rick Winfrey
22f4a60ee2 Parse jsx files with the TypeScript parser 2017-07-28 16:42:19 -07:00
Timothy Clem
d497df47c8 Rework error printing 2017-07-28 16:41:16 -07:00
Timothy Clem
b849180369 Possibility to log inserting and deleting timing 2017-07-28 16:40:57 -07:00
Timothy Clem
ed76134965 Formatting 2017-07-28 16:20:55 -07:00
Timothy Clem
ec66f2405c Not using the nullFormatter 2017-07-28 16:20:47 -07:00
Timothy Clem
565c559b9a Pass around ZonedTime 2017-07-28 16:20:24 -07:00
Rick Winfrey
aaa8713b96 🔥 FDocs 2017-07-28 16:12:20 -07:00
Timothy Clem
409188753d New timing Task 2017-07-28 15:55:20 -07:00
Rob Rix
7da8799e08 🔥 Prologue & protolude. 2017-07-28 14:37:02 -04:00