about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2014-01-02libsyntax: De-`@mut` `Parser::obsolete_set`Patrick Walton-2/+2
2014-01-02libsyntax: De-`@mut` `Parser::restriction`Patrick Walton-7/+7
2014-01-02libsyntax: De-`@mut` `Parser::tokens_consumed`Patrick Walton-3/+3
2014-01-02libsyntax: De-`@mut` `Parser::buffer_start` and `Parser::buffer_end`Patrick Walton-13/+13
2014-01-02libsyntax: De-`@mut` `Parser::buffer`Patrick Walton-3/+3
2014-01-02libsyntax: De-`@mut` `Parser::last_token`Patrick Walton-3/+3
2014-01-02libsyntax: De-`@mut` `Parser::last_span`Patrick Walton-30/+28
2014-01-02libsyntax: De-`@mut` `Parser::span`Patrick Walton-49/+51
2014-01-02libsyntax: De-`@mut` `token` in the parserPatrick Walton-223/+221
2014-01-02libsyntax: De-`@mut` `quote_depth` in the parserPatrick Walton-4/+4
2014-01-02libsyntax: Make the parser mutablePatrick Walton-442/+459
2014-01-02auto merge of #10696 : fhahn/rust/issue9543-remove-extern-mod-foo, r=pcwaltonbors-2/+15
This patch for #9543 throws an `obsolete syntax` error for `extern mod foo (name="bar")` . I was wondering if [this](https://github.com/fhahn/rust/compare/mozilla:master...fhahn:issue9543-remove-extern-mod-foo?expand=1#diff-da9d34ca1d0f6beee2838cf02e07345cR4444) is the correct place to do this? I think the wording of the error message could probably be improved as well. If this approach is OK, I'm going to run the whole test suite tomorrow and update the old syntax to the new one.
2014-01-01Remove `extern mod foo (name="bar")` syntax, closes #9543Florian Hahn-2/+15
2014-01-01syntax::codemap: Add static DUMMY_SPklutzy-1/+1
It replaces `dummy_sp()`.
2014-01-01syntax::diagnostic: Remove unnecessary traitsklutzy-11/+11
This removes trait `handler` and `span_handler`, and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2013-12-20auto merge of #11077 : alexcrichton/rust/crate-id, r=cmrbors-0/+24
Right now the --crate-id and related flags are all process *after* the entire crate is parsed. This is less than desirable when used with makefiles because it means that just to learn the output name of the crate you have to parse the entire crate (unnecessary). This commit changes the behavior to lift the handling of these flags much sooner in the compilation process. This allows us to not have to parse the entire crate and only have to worry about parsing the crate attributes themselves. The related methods have all been updated to take an array of attributes rather than a crate. Additionally, this ceases duplication of the "what output are we producing" logic in order to correctly handle things in the case of --test. Finally, this adds tests for all of this functionality to ensure that it does not regress.
2013-12-20rustc: Improve crate id extractionAlex Crichton-0/+24
Right now the --crate-id and related flags are all process *after* the entire crate is parsed. This is less than desirable when used with makefiles because it means that just to learn the output name of the crate you have to parse the entire crate (unnecessary). This commit changes the behavior to lift the handling of these flags much sooner in the compilation process. This allows us to not have to parse the entire crate and only have to worry about parsing the crate attributes themselves. The related methods have all been updated to take an array of attributes rather than a crate. Additionally, this ceases duplication of the "what output are we producing" logic in order to correctly handle things in the case of --test. Finally, this adds tests for all of this functionality to ensure that it does not regress.
2013-12-19Accept trailing commas in struct patternsAlex Crichton-2/+7
We decided in the 12/10/13 weekly meeting that trailing commas should be accepted pretty much anywhere. They are currently not allowed in struct patterns, and this commit adds support for that. Closes #10392
2013-12-18auto merge of #10915 : alexcrichton/rust/fixes, r=ILyoanbors-0/+6
Just a little cleanup.
2013-12-17Remove obsolete mutability from ast::TySeo Sanghyeon-9/+8
2013-12-15Forbid multiple imports in use statementsAlex Crichton-0/+6
Closes #10911
2013-12-15libsyntax: Implement the new `box` syntax for unique pointers.Patrick Walton-7/+25
2013-12-11auto merge of #10897 : boredomist/rust/remove-self-lifetime, r=brsonbors-9/+10
Also remove all instances of 'self within the codebase. This fixes #10889. To make reviewing easier the following files were modified with more than a dumb text replacement: - `src/test/compile-fail/lifetime-no-keyword.rs` - `src/test/compile-fail/lifetime-obsoleted-self.rs` - `src/test/compile-fail/regions-free-region-ordering-incorrect.rs` - `src/libsyntax/parse/lexer.rs`
2013-12-11Make 'self lifetime illegal.Erik Price-9/+10
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-11auto merge of #10891 : ↵bors-271/+161
chris-morgan/rust/macroize-(or-should-that-be-macroify)-syntax--parse--token-so-that-we-don't-make-mistakes-and-to-reduce-the-maintenance-burden, r=huonw I also renumbered things at the same time; ``in`` was shifted into its alphabetical position and the reserved keywords were reordered (a couple of them were out of order). Unused special identifiers are also removed in the second part.
2013-12-11auto merge of #10808 : kballard/rust/use-braces, r=alexcrichtonbors-0/+15
This fixes #10806.
2013-12-10Support imports of the form `use {foo,bar}`Kevin Ballard-0/+15
This fixes #10806.
2013-12-10auto merge of #10833 : sfackler/rust/mut-pat, r=brsonbors-1/+16
Previously, if you wanted to bind a field mutably or by ref, you had to do something like Foo { x: ref mut x }. You can now just do Foo { ref mut x }. Closes #6137
2013-12-11Separate strict/reserved keywords, derive bounds.Chris Morgan-11/+29
It's twenty lines longer, but makes for clearer separation of strict and reserved keywords (probably a good thing) and removes another moving part (the definitions of `(STRICT|RESERVED)_KEYWORD_(START|FINAL)`).
2013-12-11Remove the following unused special identifiers:Chris Morgan-107/+67
- underscore ("_") - unary ("unary") - not_fn ("!") - idx_fn ("[]") - unary_minus_fn ("unary-") - item ("item") - block ("block") - stmt ("stmt") - pat ("pat") - expr ("expr") - ty ("ty") - ident ("ident") - path ("path") - descrim ("descrim") - clownshoe_stack_shim ("__rust_stack_shim") - blk ("blk") - c_abi ("C") (And, of course, renumber everything to match.)
2013-12-11Deduplicate in syntax::parse::token with a macro.Chris Morgan-271/+183
I also renumbered things at the same time; ``in`` was shifted into its alphabetical position and the reserved keywords were reordered (a couple of them were out of order).
2013-12-10Allow ref and mut modifiers for short form field patternsSteven Fackler-1/+16
Previously, if you wanted to bind a field mutably or by ref, you had to do something like Foo { x: ref mut x }. You can now just do Foo { ref mut x }. Closes #6137
2013-12-08Remove dead codesKiet Tran-113/+0
2013-12-05Forbid keywords as lifetime parameters names.Léo Testard-1/+11
2013-12-04Rename extra::json::*::init() constructors to *::new()Kevin Ballard-1/+1
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-2/+2
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-04auto merge of #10792 : kballard/rust/parse_sugary_call_expr-comments, ↵bors-8/+8
r=alexcrichton The comments on this function date back from when it was used for `for` expressions in addition to `do` expressions.
2013-12-04std::str: remove from_utf8.Huon Wilson-1/+1
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-12-03Fix the comments for libsyntax::parse::parser::parse_sugary_call_exprKevin Ballard-8/+8
The comments on this function date back from when it was used for `for` expressions in addition to `do` expressions.
2013-12-01auto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichtonbors-7/+7
2013-12-01auto merge of #10676 : eddyb/rust/ast-box-in-enums, r=cmrbors-78/+92
**Note**: I only tested on top of my #10670 PR, size reductions come from both change sets. With this, [more enums are shrinked](https://gist.github.com/eddyb/08fef0dfc6ff54e890bc), the most significant one being `ast_node`, from 104 bytes (master) to 96 (#10670) and now to 32 bytes. My own testcase requires **200MB** less when compiling (not including the other **200MB** gained in #10670), and rustc-stage2 is down by about **130MB**. I believe there is more to gain by fiddling with the enums' layouts.
2013-12-01ast: Remove one `@` and fix the falloutPhilipp Brüschweiler-7/+7
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-78/+92
critical enum sizes.
2013-11-30auto merge of #10727 : erickt/rust/json, r=huonwbors-4/+5
This PR does some small modernizations to the json library. First is to remove the `@` boxes, second is to rename the constructors to `new`.
2013-11-29extra: missed a couple `@` in jsonErick Tryzelaar-1/+1
2013-11-29extra: json::Encoder should take a &mut io::WriterErick Tryzelaar-3/+4
2013-11-29extra: Rename json constructors into *::initErick Tryzelaar-1/+1
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-2/+2
2013-11-28Register new snapshotsAlex Crichton-69/+66
2013-11-27Be more strict about doc commentsCorey Richardson-4/+2
Previously, `//// foo` and `/*** foo ***/` were accepted as doc comments. This changes that, so that only `/// foo` and `/** foo ***/` are accepted. This confuses many newcomers and it seems weird. Also update the manual for these changes, and modernify the EBNF for comments. Closes #10638