1022 Commits

Author SHA1 Message Date
Jan Teske
9b5ec5fdb1 Ignore trailing commas in ExpectedDebug (#455)
* Ignore trailing commas in `ExpectedDebug`

rust-lang/rust/pull/59076 changed the multiline Debug representation to
always include a trailing comma. This change currently breaks our tests
on beta and nightly, since we use this Debug representation to compare
expected parsing output.

We cannot simply add the trailing commas to the expected output strings,
since that would break on older rustc versions we support. Instead, this
commit makes it so that all trailing commas are stripped before the
comparison.

This workaround can be removed once rust-lang/rust/pull/59076 reaches
our minimum supported rustc version.

* Bump minimum Rust version to 1.31.0

That's required by the current version rustc-demangle, which is a
dependency of mdbook.
2019-04-30 15:30:03 +02:00
Newton Ni
46434782bd Split apart UnrecognizedEOF error variant from UnrecognizedToken (#446)
* Split apart UnrecognizedEOF error variant from UnrecognizedToken

* Factor out fmt_expected function

* Initial attempt at fixing codegen

- Match on lookahead when returning error
- Use last fixed symbol as location of UnrecognizedEOF
- Use `Default::default()` when there are no fixed symbols (?)

* Initial implementation of finding latest optional location

* Fix UnrecognizedToken errors in `Some` test cases

* Fix UnrecognizedEOF test cases

* Fix parentheses around pattern error for 1.26 compatibility

* Add basic test for UnrecognizedEOF (and hopefully trigger Travis build)

* Fix emitted indentation and use travis_wait when testing
2019-03-25 13:35:58 +01:00
Roman Frołow
417f199ec8 type type -> type 2019-03-05 07:37:15 +01:00
Markus Westerlind
cbdafa6494
Merge pull request #451 from rofrol/patch-1
docs: remove unneeded in
2019-03-03 09:08:39 +01:00
Markus Westerlind
4989a9d670
Merge pull request #450 from mikeyhew/remove-fmt-lifetime-warning
Remove warning about hidden lifetime parameter
2019-03-03 09:08:04 +01:00
Roman Frołow
f678f38bcd remove unneeded in 2019-03-03 06:15:42 +01:00
Michael Hewson
2a469030c4 Remove warning about hidden lifetime parameter
On Rust 1.33, the current generated code emits a warning because hidden lifetime parameters in types are deprecated. This occurs in the `impl Display for Token`, and happens because `fmt::Formatter` has a lifetime parameter.

This PR adds an explicit lifetime parameter `'f` to the generated code, so it will work on all supported versions of Rust.
2019-03-02 23:44:14 -05:00
Markus Westerlind
9b773d9fb2
Merge pull request #449 from jwinnie/patch-1
Add gleam to example uses
2019-03-02 08:38:12 +01:00
J Winnie
895575a36e
Add gleam to example uses
https://github.com/lpil/gleam
2019-03-01 19:45:13 -08:00
Markus Westerlind
90b67b999e
Merge pull request #448 from jespersm/remove_print_ok
Remove confusing "ok" message printed to stdout
2019-02-26 10:52:43 +01:00
Markus Westerlind
4d6b014fff
Merge pull request #447 from jespersm/master
Order of string for error message confusing
2019-02-26 10:48:55 +01:00
Jesper Steen Møller
79bcfee0a7 Remove confusing "ok" message printed to stdout 2019-02-26 00:39:06 +01:00
Jesper Steen Møller
48759f18af Order of string for error message confusing 2019-02-22 00:00:43 +01:00
Markus Westerlind
983643086f
Merge pull request #442 from Songbird0/add-missing-link
Add a link to `main.rs`
2019-01-28 22:22:35 +01:00
Songbird0
7fbb1cd7ba
Add a link to main.rs
Add the missing link to `main.rs`.
2019-01-26 19:39:59 +01:00
Markus Westerlind
3d4e3cbc80 chore: lalrpop-snap does not exist 2019-01-20 22:41:05 +05:30
Markus Westerlind
27e5a0eef5 Version 0.16.3 2019-01-20 22:41:05 +05:30
Markus Westerlind
dbd9a13e5b
Merge pull request #435 from Marwes/update
Release preparation
2019-01-20 17:22:45 +01:00
Markus Westerlind
6805efedec Update dependencies 2019-01-20 17:06:11 +01:00
Markus Westerlind
61f52ab179 chore: Snapshot the in-tree parser on every release 2019-01-20 17:06:11 +01:00
Markus Westerlind
fe75f44b4c
Merge pull request #434 from Marwes/opt_memcpy
perf: Avoid some memcpying in reductions
2019-01-19 22:50:36 +01:00
Markus Westerlind
4968e5a608 perf: Avoid some memcpying in reductions
In gluon's parser I have a lalrpop symbol type that ends up at 400Kb
which is expensive to copy around. By moving the `push` call into each
reduction instead we make it easier for LLVM to elide memcpys and I
observed a reduction in memcpy uses from 27% to 18% of of the total
parse time.
2019-01-19 22:09:01 +01:00
Markus Westerlind
becdc9bf19
Merge pull request #433 from alercah/rerun
Support conditional execution by Cargo.
2019-01-19 22:08:48 +01:00
Markus Westerlind
baadb9a24c
Merge pull request #438 from Marwes/snapshot
chore: Don't try to infer whether we are building in the lalrpop work…
2019-01-19 22:07:24 +01:00
Markus Westerlind
7ef0d9e778 Use the PROFILE env rather than hardcoding debug 2019-01-19 16:33:51 +01:00
Alexis Hunt
9592e43313 Support conditional execution by Cargo.
Cargo allows build scripts to emit directives to specify their
dependencies, so that modifying other files does not cause them to be
rerun. This adds a configuration option to emit those directives,
defaulting to false to avoid interfering with other parts of the build
script and leading to hard-to-debug issues.

On Windows, some files cannot be represented in the UTF-8 used by Cargo,
and a build warning is emitted instead.

I've tested this change manually, but didn't see an easy way to test
it programmatically as part of the codebase, especially because
`to_string_lossy()` can never return `None` on Unix platforms.
2019-01-12 11:03:41 -05:00
Markus Westerlind
5ee01e55a4 chore: Don't try to infer whether we are building in the lalrpop workspace
Instead we use --all-features to enable a special `test` feature to run tests with a freshly generated lrgrammar.rs. Since we also have a test to check that the saved lrgrammar.rs is identical to what lalrpop generates we should be ok with this approach.

Closes #436
2019-01-11 22:33:45 +01:00
Niko Matsakis
885f7859db
Merge pull request #437 from alercah/endings
Convert all CRLF line endings to LF.
2019-01-10 17:15:23 -05:00
Alexis Hunt
802ac11a20 Convert all CRLF line endings to LF. 2019-01-10 16:47:50 -05:00
Niko Matsakis
c37319e111
Merge pull request #432 from Marwes/allow_deprecated
Allow trim_left in the generated code
2019-01-10 16:42:27 -05:00
Markus Westerlind
bdd65184e5 fix: Allow the deprecated use of trim_left
Fixes #428
2019-01-10 22:19:23 +01:00
Markus Westerlind
0c67bbed06
fix: Don't make generated files read-only
Don't make generated files read-only
2019-01-05 19:35:07 +01:00
David Flemström
0793ba27a6 Don't make generated files read-only 2019-01-03 14:30:09 +01:00
Markus Westerlind
64bed5ca63
Merge pull request #422 from Marwes/ndm-extract-state-machine-rebase
extract state machine
2018-12-10 21:51:36 +01:00
Stéphane Campinas
39774c0666 typo 2018-12-03 13:57:18 +05:30
Niko Matsakis
548df5c9f8 bump petgraph to 0.4.14 (nightly complains?) 2018-11-29 19:57:56 +01:00
Niko Matsakis
e9daba641f tweak comment 2018-11-29 19:55:25 +01:00
Niko Matsakis
c4262b2fa2 remove feature gates 2018-11-29 19:55:24 +01:00
Niko Matsakis
8a79a3683f start using the state machine (tests pass, horray!) 2018-11-29 19:55:24 +01:00
Niko Matsakis
5968cf013c connect state machine reduce to __reduce helper 2018-11-29 19:55:24 +01:00
Niko Matsakis
032034a3d9 convert reduce actions to positive numbers from 0 2018-11-29 19:55:24 +01:00
Niko Matsakis
67a0dc1b32 add a drive function 2018-11-29 19:55:24 +01:00
Niko Matsakis
47a8ea7d43 give names to anonymous lifetimes and introduce where-clauses 2018-11-29 19:55:24 +01:00
Niko Matsakis
080611a725 generate state machine definition (but do not use to drive parsing)
This version however requires all lifetimes to be explicit. Suboptimal.
2018-11-29 19:55:24 +01:00
Niko Matsakis
d0d6cc6bbb refactor the write_fn_header to use a builder
Too many parameters!
2018-11-29 19:55:24 +01:00
Niko Matsakis
00158bd763 promote free_variables to a directory 2018-11-29 19:55:24 +01:00
Niko Matsakis
5bfa1af9fa improve logic around free-variables to account for false answers 2018-11-29 19:55:24 +01:00
Niko Matsakis
9d37210c45 extract a helper for filtering type-params/where-clauses 2018-11-29 19:55:24 +01:00
Niko Matsakis
6b96c4d9bb lower (and flatten) into repr::WhereClause 2018-11-29 19:55:24 +01:00
Niko Matsakis
0f0533d539 add a newtype of Atom for Lifetime 2018-11-29 19:55:24 +01:00