116 Commits

Author SHA1 Message Date
Niko Matsakis
0705f422e7 remove DFA codegen and replace with regex-set 2017-02-27 10:12:39 -05:00
Niko Matsakis
ffab149493 bump to 0.12.5 2017-02-11 08:11:03 +01:00
Markus Westerlind
b69e679d5b fix: Don't accidentally cast a reduce action to usize
This caused panics in certain error recovery scenarios as a reduce action represented by a negative number would get casted to `usize` which then caused an index out of bounds panic.

The added tests were extracted and minimized from [gluon's grammar](abd06a4f6e/parser/src/grammar.lalrpop) with the test case below being a minimal reproduction.

Panicking
```
type Test = a ->
```

Valid expression
```
type Test = a -> a
in 1
```
2017-01-28 16:22:37 +01:00
Markus Westerlind
77c82c0cd4 feat: Add the expected successor tokens to UnrecognizedToken errors
This just adds the terminal strings defined in the grammar which is not the best possible information but it is better than no information.

Partial fix for #58
2016-12-28 19:31:06 +01:00
Niko Matsakis
fa1c31eac8 bump version number to 0.12.4 2016-11-29 13:51:41 -05:00
Niko Matsakis
9b4d5d588d update version numbers to 0.12.3 2016-11-29 13:51:21 -05:00
Niko Matsakis
a3745f4878 update version numbers for 0.12.2 2016-11-29 13:51:21 -05:00
Markus Westerlind
bf7c7901e9 fix: Actually avoid all clones when not using error recovery 2016-11-29 17:54:37 +01:00
Markus Westerlind
18b179660b Use ! instead of error to indicate error recovery 2016-11-22 23:03:56 +01:00
Markus Westerlind
6bf1c9e940 Store the tokens dropped during error recovery in the produced type 2016-11-22 22:37:19 +01:00
Markus Westerlind
352ed58dce Fix nits 2016-11-22 22:36:10 +01:00
Markus Westerlind
5c4c0d0f8a Only generate a parse_table parser when testing error recovery 2016-11-22 22:36:10 +01:00
Markus Westerlind
39a033c477 Don't drop the token that caused an error
If we end up dropping some states in the first part of error recovery we may not need to skip any tokens at all.
2016-11-22 22:36:10 +01:00
Markus Westerlind
9dd99ce436 Don't enter an infinite loop if no recovery exists at EOF 2016-11-22 22:36:10 +01:00
Markus Westerlind
9cd4f30319 Make the error available for error recovery actions 2016-11-22 22:36:10 +01:00
Markus Westerlind
7af013e7bb Add basic error recovery for parse tables
This does not yet recover errors at EOF as EOF handling is a separate
step
2016-11-22 22:36:10 +01:00
Markus Westerlind
b9c9ea33bc Ignore .rs files generated for tests 2016-11-09 21:14:55 +01:00
Niko Matsakis
4764a1d286 bump version number to 0.12.1 2016-09-29 05:38:06 -04:00
Niko Matsakis
3fc5b2d02b allow type parameters not constained by arguments
In the older code, type parameters that were not constrained by some
argument would fail to be threaded through. We now pass `PhantomData`
arguments and/or specify the type parameters manually so that this all
works out fine.

Fixes #104.
2016-08-16 07:58:04 -04:00
Niko Matsakis
70a438357a bump version number to 0.12.0 2016-08-05 05:20:30 -04:00
Niko Matsakis
1da9ee7d99 enable annotations to select algorithm etc 2016-08-03 05:20:25 -04:00
Niko Matsakis
98f4159c8b add test_all that runs both ascent/table-driven
It then asserts that the results are equal.
2016-08-03 05:20:11 -04:00
Niko Matsakis
2517a138b0 remove printlns 2016-08-02 21:46:09 -04:00
Niko Matsakis
6374ddc729 implement a parse-table-driven output 2016-08-02 21:46:09 -04:00
Niko Matsakis
43e3fe2315 use TokenSet for LR1 lookahead and not Token
This way, instead of having:

    X = A (*) B [c]
    X = A (*) B [d]

you would have

    X = A (*) B [c, d]
2016-06-01 05:03:56 -04:00
Niko Matsakis
b7648bcd9e separate shifts/reduces into distinct tables 2016-06-01 04:53:47 -04:00
Niko Matsakis
2db28a3650 add forgotten test for unit default actions 2016-03-22 04:45:45 -04:00
Niko Matsakis
0a577f46d4 update test output 2016-03-22 04:42:18 -04:00
Niko Matsakis
b639c9e88b Port lalrpop-test to use new Configuration value
Also, start emitting comments again, since they are helpful to ME.
2016-03-07 05:47:43 -05:00
Niko Matsakis
6efc75b2a5 Update Cargo.toml to v0.11.0 2016-02-25 14:44:11 -05:00
Niko Matsakis
a9ec498c9e extend with some further tests where @R and @L are used in weird ways to
try and get assertion errors etc
2016-02-25 05:55:00 -05:00
Niko Matsakis
e79e2c4858 extend the loc_issue_90 test a bit more 2016-02-25 05:55:00 -05:00
Niko Matsakis
3d4d097373 stop carrying lookbehind around and just extract it from the top of the stack 2016-02-25 05:55:00 -05:00
Niko Matsakis
7e8602562e do not pass lookahead/lookbehind to actions if there are symbols 2016-02-25 05:54:59 -05:00
Niko Matsakis
7431af506d add a regression test for loc #90 2016-02-25 05:54:59 -05:00
Niko Matsakis
93a2a48219 enable inlining of $L and $R (and fix some bugs) 2016-02-25 05:54:59 -05:00
Niko Matsakis
cc37797eaa package up each nonterminal as a (L, T, L) pair 2016-02-25 05:54:56 -05:00
Niko Matsakis
df60aefc30 change lookahead to be passed unconditionally 2016-02-25 05:54:56 -05:00
Niko Matsakis
68c79f79f2 change lookbehind to stop passing around an option everywhere 2016-02-25 05:54:56 -05:00
Niko Matsakis
9fc995c5f2 just pass lookahead position, not entire triple 2016-02-25 05:54:52 -05:00
Niko Matsakis
f255a56035 Move over to use regex_syntax's parser 2016-02-21 20:43:11 -05:00
Niko Matsakis
a9e03641a2 Update .rs files for tests to not have comments 2016-02-19 04:26:49 -05:00
Niko Matsakis
728654dfa2 Switch license to MIT/Apache2 instead of Unlicense, in an effort to be
more uniform with the rest of the Rust ecosystem, and to evade the
various legal quandries associated with the concept of "public domain".
2016-01-24 04:52:05 -05:00
Niko Matsakis
01ae27afe8 Bump to version 0.10.0 (in progress). 2016-01-23 11:45:29 -05:00
Niko Matsakis
2a95803383 Bump version to 0.9.0 2016-01-23 11:39:03 -05:00
Niko Matsakis
9a121b78a0 Fix inlining so that different appearances of the same symbol can be
inlined in multiple ways.
2016-01-22 08:16:21 -05:00
Florian Hahn
bf6be4a166 Do not use (..) for empty enum variants, closes #43 2015-12-08 21:49:20 +01:00
Niko Matsakis
63c9c2efc9 patch up the macro expansion test case now that * and ? are inlined 2015-10-25 07:11:48 -04:00
Niko Matsakis
ddadce60fb refashion inlining so that it actually works, and also factor out action
code into its own file, rather than embedding strings all over the place
2015-10-25 07:11:48 -04:00
Niko Matsakis
7648a9214f simplify the grammar model so that all actions are just action fns; move
the lookahead/lookbehind action code into lower
2015-10-25 07:11:29 -04:00