Commit Graph

88 Commits

Author SHA1 Message Date
Brian Leibig
8240b872e4 Update grammar to parse current rust syntax 2017-10-08 18:46:42 -07:00
Arthur Arnold
c291e87dae changed upper bound digit in octal rule to 7 2017-06-13 17:08:12 -03:00
Mark Simulacrum
6ebbe0ef50 Re-add LALR grammar. 2017-05-08 09:47:05 -06:00
Mark Simulacrum
c3781e6200 Remove ANTLR grammar.
It is unused and not maintained.
2017-05-02 08:34:38 -06:00
bors
2971d491b9 Auto merge of #41508 - michaelwoerister:generic-path-remapping, r=alexcrichton
Implement a file-path remapping feature in support of debuginfo and reproducible builds

This PR adds the `-Zremap-path-prefix-from`/`-Zremap-path-prefix-to` commandline option pair and is a more general implementation of #41419. As opposed to the previous attempt, this implementation should enable reproducible builds regardless of the working directory of the compiler.

This implementation of the feature is more general in the sense that the re-mapping will affect *all* paths the compiler emits, including the ones in error messages.

r? @alexcrichton
2017-04-28 12:09:37 +00:00
Gianni Ciccarelli
b48eb5e0be support default impl for specialization
`[default] [unsafe] impl` and typecheck
2017-04-26 14:43:09 +00:00
Michael Woerister
39ffea31df Implement a file-path remapping feature in support of debuginfo and reproducible builds. 2017-04-26 15:44:02 +02:00
Gianni Ciccarelli
715811d0be support default impl for specialization
pr review
2017-04-25 05:28:22 +00:00
Oliver Schneider
eb447f4ef4
Fix various useless derefs and slicings 2017-03-27 08:58:00 +02:00
Dmitry Guzeev
577497b541 Fix typo 2017-02-15 15:13:31 +03:00
Stefan Schindler
28b64dc1b9 Use keywords::Invalid 2016-11-27 17:59:36 +01:00
Stefan Schindler
2dc3fdf2bd Resolve visibility issues
use syntax::ast::Name; is a reexport of syntax::symbol::Symbol(u32);
2016-11-27 16:45:09 +01:00
Stefan Schindler
0bcb05cf50 Finishing d2f8fb0a0a from @jseyfried 2016-11-27 15:34:32 +01:00
Stefan Schindler
0e1828ab03 Fix grammar verification
* Use `make check-lexer` to verify the grammar.
 * Extend grammar/README
 * Add make clean-grammar rule
 * Add target `check-build-lexer-verifier` to `make tidy`, so it will build the verifier with every build and catch future errors
 * Search for antlr4 with configure and find
2016-11-16 22:42:07 +01:00
Jonathan Turner
6ae3502134 Move errors from libsyntax to its own crate 2016-06-23 08:07:35 -04:00
Michael Rosenberg
e8007e889b antlr grammar verification script now compiles under latest nightly 2016-05-25 00:15:26 -04:00
Michael McConville
552b70aad3 Fix whitespace alignment
Trivial, but my eye is twitching.
2015-12-24 21:39:38 -05:00
Ariel Ben-Yehuda
43a6deb95f fix rustc-test 2015-11-26 19:19:54 +02:00
Simonas Kazlauskas
99f9bb16ab Adjust src/grammar for the introduced <- op 2015-10-27 23:06:37 +02:00
Vadim Petrochenkov
f284cbc7af Cleanup interfaces of Name, SyntaxContext and Ident
Make sure Name, SyntaxContext and Ident are passed by value
Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-09-24 23:05:02 +03:00
Vadim Petrochenkov
405c616eaf Use consistent terminology for byte string literals
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-03 10:54:53 +03:00
Sean McArthur
cfcd449c4c rustc: rename multiple imports in a list 2015-08-08 11:54:15 -07:00
Simon Sapin
c160192f5f Replace usage of String::from_str with String:from 2015-06-08 16:55:35 +02:00
bors
2e7d7bc05d Auto merge of #25337 - bleibig:update-grammar, r=nikomatsakis
* Correctly lex CRLF in string literals
* Update `extern CRATE as NAME` syntax
* Allow leading `::` in view paths
* Allow TySums in type ascriptions and impls
* Allow macros to have visibility and attributes
* Update syntax for qualified path types and expressions
* Allow block expressions to be called () and indexed []
2015-05-18 23:29:26 +00:00
Carol Nichols
e70c8584d5 Revert "Panic if the grammar verifier sees a token it doesn't recognize"
This reverts commit 9c7d5ae57c.

This was wrong... the `continue` was to ignore the latter half of the
tokens file. Another mechanism will have to be used to keep the model
grammar's tokens in sync with the actual grammar's tokens :-/
2015-05-17 10:48:42 -04:00
Eduard Burtescu
6a59d1824d syntax: replace sess.span_diagnostic.cm with sess.codemap(). 2015-05-14 01:47:56 +03:00
Brian Leibig
568d7f1960 Update the bison grammar for various language changes 2015-05-12 09:20:43 -07:00
Carol Nichols
9c7d5ae57c Panic if the grammar verifier sees a token it doesn't recognize
To prevent the reference grammar from getting out of sync with the real
grammar, panic if RustLexer.tokens contains an unknown token in a
similar way that verify.rs panics if it encounters an unknown binary
operation token.
2015-05-05 19:47:50 -04:00
Carol Nichols
1ca9ed61d6 Declare other tokens used later in the reference grammar
There were some tokens used in the grammar but not declared. Antlr
doesn't really seem to care and happily uses them, but they appear in
RustLexer.tokens in a potentially-unexpected order.
2015-05-05 19:47:50 -04:00
Carol Nichols
cdb6e1e15f Correct a typo in a declared token in the reference grammar
This appears to not have too much of a detrimental effect, but it
doesn't seem to be what is intended either.

antlr doesn't mind that `PLUS` isn't declared in `tokens` and happily
uses the `PLUS` that appears later in the file, but the generated
RustLexer.tokens had PLUS at the end rather than where it was intended:

NOT=10
TILDE=11
PLUT=12
MINUS=13
...
PLUS=56
2015-05-05 19:47:22 -04:00
Sean Patrick Santos
7129e8815e Functional changes for associated constants. Cross-crate usage of associated constants is not yet working. 2015-04-23 21:02:26 -06:00
Piotr Czarnecki
13bc8afa4b Model lexer: Fix remaining issues 2015-04-21 12:02:12 +02:00
Piotr Czarnecki
e5e343aeb7 Finished unicode support in the model lexer.
Completed XID_Start and XID_Continue rules
2015-04-19 23:05:32 +02:00
Florian Hahn
be437132b8 Add proper XID_Start and XID_Continue rules and use CharPos for span comparison, closes #15679 2015-04-19 23:02:10 +02:00
Tamir Duberstein
d51047ded0 Strip all leading/trailing newlines 2015-03-15 09:08:21 -07:00
Brian Leibig
481b21cf19 Bison grammar: parse higher ranked constraints in where clauses 2015-03-01 13:59:35 -08:00
Brian Leibig
f1fe1b5d4f Bison grammar: allow ExprQualifiedPath to have optional "as TRAIT_REF" 2015-03-01 13:59:35 -08:00
Brian Leibig
e93b2abf37 Bison grammar: support parsing default trait impls 2015-03-01 13:59:34 -08:00
Brian Leibig
3bca5f23aa Bison grammar: fix precedence with ranges followed by blocks 2015-02-10 17:59:02 -08:00
Brian Leibig
03cc48c38d Bison grammar: refactor items to allow "extern crate" in stmts 2015-02-10 17:59:01 -08:00
Brian Leibig
41d6513b8f Bison grammar: add qualified path expressions 2015-02-10 17:59:01 -08:00
Brian Leibig
ad6bb17acf Bison grammar: refactor index expressions to use ordinary expressions as indexes, remove index_expr and expr_norange 2015-02-10 17:59:01 -08:00
bors
725cc06464 Auto merge of #22011 - fhahn:separate-parse-fail-tests, r=nikomatsakis
This PR moves all `compile-fail` tests that fail at the parsing stage to a `parse-fail` directory, in order to use the tests in the `parse-fail` directory to test if the new LALR parser rejects the same files as the Rust parser. I also adjusted the `testparser.py` script to handle the tests in `parse-fail` differently.

However during working on this, I discovered, that Rust's parser sometimes fails during parsing, but does not return a nonzero return code, e.g. compiling `/test/compile-fail/doc-before-semi.rs` with `-Z parse-only` prints an error message, but returns status code 0. Compiling the same file without `-Z parse-only`, the same error message is displayed, but error code 101 returned. I'll look into that over the next week.
2015-02-08 12:35:03 +00:00
Florian Hahn
01db9a46af Move compile-fail tests that are rejected by the parser to parse-fail 2015-02-06 22:23:16 +01:00
Manish Goregaokar
08a2bef632 Rollup merge of #21954 - jbcrail:fix-misspelled-comments, r=steveklabnik
The spelling corrections were made in both documentation comments and
regular comments.
2015-02-06 16:21:06 +05:30
Brian Anderson
68ddd73257 testparser has long lines 2015-02-05 14:37:16 -08:00
Brian Anderson
290b79c15d Clean up tidy scripts, coverage, performance
This restructures tidy.py to walk the tree itself,
and improves performance considerably by not loading entire
files into buffers for licenseck.

Splits build rules into 'tidy', 'tidy-basic', 'tidy-binaries',
'tidy-errors', 'tidy-features'.
2015-02-05 14:37:16 -08:00
Jorge Aparicio
17bc7d8d5b cleanup: replace as[_mut]_slice() calls with deref coercions 2015-02-05 13:45:01 -05:00
Joseph Crail
dc2e444e50 Fix for misspelled comments.
The spelling corrections were made in both documentation comments and
regular comments.
2015-02-04 23:00:02 -05:00
Jorge Aparicio
bce81e2464 cleanup: s/v.slice*()/&v[a..b]/g + remove redundant as_slice() calls 2015-01-27 09:03:06 -05:00