779 Commits

Author SHA1 Message Date
Ahmed Charles
e5875274f4 Update tests. 2018-01-26 12:07:52 +00:00
Niko Matsakis
5246910e7e add a code of conduct 2018-01-25 05:33:15 -05:00
Niko Matsakis
b119a2e541
Merge pull request #289 from jnbr/master
update version strings in README.md and doc/tutorial.md to 0.14.0
2018-01-24 19:56:13 -05:00
johannes
71df807949 update version strings in README.md and doc/tutorial.md to 0.14.0 2018-01-24 17:25:28 +01:00
Niko Matsakis
84a49aec05
Merge pull request #288 from nikomatsakis/v0.14
release v0.14
2018-01-24 06:09:07 -05:00
Niko Matsakis
df38c3e2ae update all version numbers to 0.14.0 0.14.0 2018-01-24 05:53:03 -05:00
Niko Matsakis
0f24f77b70 update relase notes 2018-01-24 05:52:31 -05:00
Niko Matsakis
d4bc4e1b8c
Merge pull request #287 from nikomatsakis/issue-240
update `parse_table` comment to describe error recovery
2018-01-24 05:19:58 -05:00
Niko Matsakis
a83d4f9cce
Merge pull request #274 from pyfisch/patch-1
Add example with funky expression and tupels
2018-01-24 05:19:43 -05:00
Niko Matsakis
519a18610c
Merge pull request #275 from pyfisch/patch-2
Add missing comma in tutorial
2018-01-24 05:18:59 -05:00
Niko Matsakis
038ea15f04
Merge pull request #277 from vmx/relax-extern-match
Allow match definition if no custom tokens are defined
2018-01-24 05:18:32 -05:00
Niko Matsakis
d6821a076c add newline to end of file 2018-01-24 05:18:22 -05:00
Volker Mische
daaad78583 Allow match definition if no custom tokens are defined
`extern` is not only used for custom lexers/tokens, but also to define
custom types for `Error` and `Location`. It should be possible to
have custom error types while having `match` dedefinitions as issue #261
shows.

Fixes #261.
2018-01-24 05:18:21 -05:00
Niko Matsakis
226cb536c8
Merge pull request #279 from vmx/issue-278
Return grammar errors first
2018-01-24 04:41:24 -05:00
Niko Matsakis
e2d8f223f4 update parse_table comment to describe error recovery 2018-01-24 04:35:33 -05:00
Niko Matsakis
88b4e65c22
Merge pull request #281 from gwenn/category
Specify `parsing` category in Cargo.toml
2018-01-24 04:19:32 -05:00
Niko Matsakis
c3f810704d
Merge pull request #286 from nikomatsakis/issue-240
Rework error recovery mechanism
2018-01-24 04:18:36 -05:00
Niko Matsakis
2e0d114793 add new style error recovery function and adjust tests
Also, add some detailed tests covering all the cases for error spans.
2018-01-23 13:14:50 -05:00
Niko Matsakis
1d36900d66 remove LALR annotation, not crucial 2018-01-23 12:49:26 -05:00
Niko Matsakis
dae7c1db35 make last_location into an &mut so we can thread it around 2018-01-23 12:49:26 -05:00
Niko Matsakis
004187aa86 make next_token and token_to_integer more hygienic 2018-01-23 12:49:26 -05:00
Niko Matsakis
3f4ed1e1af add a test for EOF loop 2018-01-23 12:49:26 -05:00
Niko Matsakis
b62a3fc095 make a test demonstrating the lock-in phenomena 2018-01-23 12:49:26 -05:00
Niko Matsakis
3eeb66c93d make unrecognized_token_error more hygienic 2018-01-23 12:49:26 -05:00
Niko Matsakis
a40cd3d0ff rework error recovery to drop tokens and handle EOF more gracefully 2018-01-23 12:49:26 -05:00
Niko Matsakis
94fa24c4a6 add more useful info when DEBUG_PRINT is enabled 2018-01-23 12:49:26 -05:00
Niko Matsakis
3d49e9cffd use lane-table even on LR(0) grammars
This is needed to avoid infinite loops in error recovery.
2018-01-23 12:49:26 -05:00
Markus Westerlind
08728df48a Add a test case for issue #240 2018-01-23 12:49:26 -05:00
gwenn
92c3400010 Specify parsing category in Cargo.toml
https://crates.io/categories/parsing
> Crates to help create parsers of binary and text formats.
2017-11-26 18:17:32 +01:00
Volker Mische
f309406335 Return grammar errors first
If some production in the grammar returns an error, give it priority
over built-in errors.

Fixes #278.
2017-11-23 00:43:31 +01:00
Pyfisch
e3d1370089
Add missing comma in tutorial
closes #219
2017-10-29 20:57:24 +01:00
Pyfisch
f7e83a3f4a
Add example with funky expression and tupels
closes #83
2017-10-29 18:48:54 +01:00
Niko Matsakis
01ccd43789 Merge pull request #254 from joerivanruth/transform-parse-error
Make ParseError Displayable
2017-10-15 05:47:15 -04:00
Niko Matsakis
0645c0aada Merge pull request #268 from notriddle/patch-1
Fix the "no-brackets" example code
2017-10-15 05:42:36 -04:00
Joeri van Ruth
5c7f81b821 Move internal token to __intern_token.
Re-export it at the toplevel because client visible types
use it.
2017-10-05 16:54:45 +02:00
Joeri van Ruth
9d38aa4722 Use a Display'able token type in the internal tokenizer 2017-10-05 16:54:45 +02:00
Joeri van Ruth
517acc3543 Suppress some warnings 2017-10-05 16:54:45 +02:00
Joeri van Ruth
d4669c1226 Change one more () into &'static str 2017-10-05 16:54:45 +02:00
Joeri van Ruth
f71329d454 Make default user error &'static str instead of ()
Because () doesn't implement fmt::Display, which is inconvenient.
2017-10-05 16:54:45 +02:00
Joeri van Ruth
e51a157122 Also rename map_err to map_error and map_loc to map_location 2017-10-05 16:54:45 +02:00
Joeri van Ruth
564cc5c066 Fix minor nits
- rename `map_tok` to `map_token`

- Add backticks about unrecognized token
2017-10-05 16:54:45 +02:00
Joeri van Ruth
27b4b05720 Modify comment
To trigger Travis rebuild.
2017-10-05 16:54:45 +02:00
Joeri van Ruth
65d26ae20f Replace expect_err with unwrap_err
to make it work on older Rust versions.
2017-10-05 16:54:45 +02:00
Joeri van Ruth
7bdb7126b0 Add utility methods to ParseError
Add three methods .map_loc(), .map_tok() and .map_err()
that transform the locations, tokens and user error values
inside the ParseError.
2017-10-05 16:54:45 +02:00
Michael Howell
424e22c5fb Fix the "no-commas" example code
It translated `<e:T?>` into `e?`, when it should've been `T?`.

`<e:T?>` is a nonterminal bound to the name, `T?` is a nonterminal bound to no name, and `e?` is meaningless.
2017-10-01 21:25:10 -07:00
Niko Matsakis
08bb4c98b9 Merge pull request #263 from fitzgen/support-associated-types
Allow actions to return a grammar's type parameter's associated type
2017-09-21 09:25:36 -04:00
Nick Fitzgerald
b3d667e679 Allow actions to return a grammar's type parameter's associated type
Supporting this requires determining which `where` clauses apply to the used
type parameters for the nonterminal and symbol types, so that we can bound the
type parameters in such a way that we get access to their associated types.
2017-09-18 10:15:28 -07:00
Niko Matsakis
ff250d40a0 Merge pull request #264 from fitzgen/where-clauses
Create an explicit structure for `where` clauses
2017-09-18 05:01:34 -04:00
Nick Fitzgerald
1cb7716c3b Create an explicit structure for where clauses
This commit parses a grammar's `where` clauses into a structure that allows us
to see what type parameters are being bound and in what ways.
2017-09-12 14:25:13 -07:00
Niko Matsakis
4176ff6313 Merge pull request #259 from nikomatsakis/issue-249
avoid out-of-bounds error in error classification
2017-08-30 06:25:24 -04:00