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

14495 Commits

Author SHA1 Message Date
Rob Rix
1ab9a13c6d Ignore the state in the error callback spec. 2017-08-06 19:31:44 -04:00
Rob Rix
5129bc5418 We don’t need to qualify these. 2017-08-06 19:31:15 -04:00
Rob Rix
65a134f3c8 Derive Ord & Ix instances for the specs’ Grammar type. 2017-08-06 19:29:43 -04:00
Rob Rix
1635baf667 Drop anonymous nodes before catches whose bodies would drop anonymous nodes.
This prevents handlers capturing tokens that would otherwise have been skipped altogether.
2017-08-06 18:56:04 -04:00
Rob Rix
de18f9c860 Don’t freeze composite call stacks. 2017-08-06 18:56:04 -04:00
Rob Rix
94c08a0f54 Simplify makeFunctionDeclaration. 2017-08-06 18:56:04 -04:00
Rob Rix
574d524581 Reformat functionDefinition. 2017-08-06 18:56:03 -04:00
Rob Rix
c69ed83235 Define functionDefinition without binds. 2017-08-06 18:56:03 -04:00
Rob Rix
215e1a7ac2 Simpler freezing of the call stack in choice construction. 2017-08-06 18:56:03 -04:00
Rob Rix
e45eb2e93d Simpler freezing of the call stack. 2017-08-06 18:56:03 -04:00
Rob Rix
9d044c51f7 Freeze the call stack in unError. 2017-08-06 18:56:03 -04:00
Rob Rix
367c16a0cd Use the error syntax constructor in Task. 2017-08-06 18:56:03 -04:00
Rob Rix
27c97a413c Produce error syntax using the helper. 2017-08-06 18:56:03 -04:00
Rob Rix
6edb85c156 Generalize errorSyntax to take the list of children. 2017-08-06 18:56:03 -04:00
Rob Rix
16dc1b62a7 Define an errorSyntax helper constructor. 2017-08-06 18:56:03 -04:00
Rob Rix
0d08387684 Rephrase end of input nodes as end of branch. 2017-08-06 18:56:03 -04:00
Rob Rix
d5526db5f9 Colourize the actual position/symbol. 2017-08-06 18:56:03 -04:00
Rob Rix
b40e13a296 Colourize the expected symbols. 2017-08-06 18:56:03 -04:00
Rob Rix
08a6c987c0 Pass the colourize flag to showExpectation & showSymbols. 2017-08-06 18:56:03 -04:00
Rob Rix
2ca0450737 Use the same Colourize type synonym for withSGRCode. 2017-08-06 18:56:03 -04:00
Rob Rix
e74c98f9cc Don’t colourize the whole expectation. 2017-08-06 18:56:03 -04:00
Rob Rix
d9a490381b Freeze the call stacks. 2017-08-06 18:56:03 -04:00
Rob Rix
89e0ef3daf Use the best call stack for uncommitted choices. 2017-08-06 18:56:02 -04:00
Rob Rix
1151fce874 Briefer definition of bestCallStack. 2017-08-06 18:56:02 -04:00
Rob Rix
96d473f8f4 Select a callstack to associate with committed choices. 2017-08-06 18:56:02 -04:00
Rob Rix
9579bc8aaa Spacing. 2017-08-06 18:56:02 -04:00
Rob Rix
fbb217f8e7 Add call stacks to Syntax.Error. 2017-08-06 18:56:02 -04:00
Rob Rix
c516620e24 Add a helper to set an implicit call stack. 2017-08-06 18:56:02 -04:00
Rob Rix
66d03867e1 Avoid re-showing errors in Data.Syntax. 2017-08-06 18:56:02 -04:00
Rob Rix
14001ed70a Avoid re-showing errors in Task. 2017-08-06 18:56:02 -04:00
Rob Rix
b8c1e1a953 Carry callstacks through try. 2017-08-06 18:56:02 -04:00
Rob Rix
caf9535fee Define unexpected by throwing an error with the specified message. 2017-08-06 18:56:02 -04:00
Rob Rix
76edea1341 Labels replace expectations. 2017-08-06 18:56:02 -04:00
Rob Rix
fb6298ba6d Revert "Define a function to compute the expectation for an assignment, which may involve its label."
This reverts commit 1a7e775446b72653570015b08dad0530fe4d9805.
2017-08-06 18:56:02 -04:00
Rob Rix
6036870ea9 Labels participate in committed choice. 2017-08-06 18:56:02 -04:00
Rob Rix
2d7c7fd1ee Define a function to compute the expectation for an assignment, which may involve its label. 2017-08-06 18:56:02 -04:00
Rob Rix
bd4e2666c8 🔥 a redundant Ix constraint on firstSet. 2017-08-06 18:56:02 -04:00
Rob Rix
c1596f942d Assignment errors can be strings. 2017-08-06 18:56:01 -04:00
Rob Rix
8e58a76a01 formatError takes Error String. 2017-08-06 18:56:01 -04:00
Rob Rix
60bafabf17 Move error formatting into Data.Error. 2017-08-06 18:56:01 -04:00
Rob Rix
d18ac5e0c6 Move the Error definition into Data.Error. 2017-08-06 18:56:01 -04:00
Rob Rix
add1d471c9 Stub in a module for Errors. 2017-08-06 18:56:01 -04:00
Rob Rix
55683ea810 Errors carry a full Span. 2017-08-06 18:56:01 -04:00
Rob Rix
261fb37c44 Syntax.Error holds the expected/actual fields. 2017-08-06 18:56:01 -04:00
Rob Rix
880d26078e Rename formatErrorWithOptions to formatError. 2017-08-06 18:56:01 -04:00
Rob Rix
8a7911313a Pass the position, expected, & actual fields to formatErrorWithOptions separately. 2017-08-06 18:56:01 -04:00
Rob Rix
eb1439ebbb showExpectation & showSymbols take Strings. 2017-08-06 18:56:01 -04:00
Rob Rix
b66312567b Define <?> using Label. 2017-08-06 18:56:01 -04:00
Rob Rix
b911f93a58 Define a Label assignment. 2017-08-06 18:56:01 -04:00
Rob Rix
3d9760d5d8 Sort the End case of Show to the top. 2017-08-06 18:56:01 -04:00