about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
AgeCommit message (Collapse)AuthorLines
2015-02-06Libsyntax has been updatedGuillaumeGomez-4/+3
2015-02-06Replace the get method by the deref one on InternedStringGuillaumeGomez-3/+4
2015-02-06Auto merge of #21947 - bluss:full-range-syntax, r=brsonbors-19/+14
Implement step 1 of rust-lang/rfcs#702 Allows the expression `..` (without either endpoint) in general, can be used in slicing syntax `&expr[..]` where we previously wrote `&expr[]`. The old syntax &expr[] is not yet removed or warned for.
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-2/+2
2015-02-04register snapshotsJorge Aparicio-5/+3
2015-02-04Implement `..` syntax for RangeFull as expressionUlrik Sverdrup-19/+14
Allows the expression `..` (without either endpoint) in general, can be used in slicing syntax `&expr[..]` where we previously wrote `&expr[]`. The old syntax &expr[] is not yet removed or warned for.
2015-02-03Update for new snapshot after rebasing.Niko Matsakis-1/+1
2015-02-03Remove the explicit closure kind syntax from the parser and AST;Niko Matsakis-29/+33
upgrade the inference based on expected type so that it is able to infer the fn kind in isolation even if the full signature is not available (and we could perhaps do better still in some cases, such as extracting just the types of the arguments but not the return value).
2015-02-02rollup merge of #21845: Potpourri/import-syntaxAlex Crichton-3/+8
syntax like `use foo::bar::;` and `use foo:: as bar;` should be rejected, see issue #21629
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-3/+3
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02rollup merge of #21825: kmcallister/ttdelim-spanAlex Crichton-1/+1
2015-02-02rollup merge of #21710: alfie/libsyntaxAlex Crichton-8/+8
Conflicts: src/libsyntax/parse/parser.rs
2015-02-02`for x in xs.into_iter()` -> `for x in xs`Jorge Aparicio-1/+1
Also `for x in option.into_iter()` -> `if let Some(x) = option`
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-2/+2
2015-02-02Omit integer suffix when unnecessaryAlfie John-8/+8
See PR # 21378 for context
2015-02-02Tweak some ‘expected…’ error messagesP1start-56/+61
Fixes #21153.
2015-02-01Reject syntax like `use foo::bar::;` and `use foo:: as bar;` and keywords in ↵Potpourri-3/+8
view path idents
2015-01-31Fix end of TtDelimited spanKeegan McAllister-1/+1
2015-01-30std: Stabilize FromStr and parseAlex Crichton-2/+2
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-30Change from core::ops::RangeFull to std::opsNick Cameron-1/+1
2015-01-30Rename FullRange to RangeFullNick Cameron-3/+3
2015-01-30Use absolute path to FullRange, rather than assuming it is in the preludeNick Cameron-4/+17
Closes #21263 [breaking-change] If you are using `core::ops::FullRange` you should change to using `core::ops::RangeFull`
2015-01-28Move return type an associated type of the `Fn*` traits. Mostly this ↵Niko Matsakis-1/+6
involves tweaking things in the compiler that assumed two input types to assume two ouputs; we also have to teach `project.rs` to project `Output` from the unboxed closure and fn traits.
2015-01-26Fallout of io => old_ioAlex Crichton-1/+1
2015-01-26Adjust most comments and messages to not use "unboxed".Eduard Burtescu-1/+1
2015-01-26Remove "unboxed" attribute in code referring to new closures.Eduard Burtescu-18/+15
2015-01-25Tweak chained comparison errors.Huon Wilson-3/+4
Lower case and give a more precise span: from operator to operator, not just the last one.
2015-01-25Add the span of the operator itself to ast::BinOp.Huon Wilson-5/+7
2015-01-22Fix some grammar inconsistencies for the '..' range notation.Daniel Grunwald-17/+37
Grammar changes: * allow 'for _ in 1..i {}' (fixes #20241) * allow 'for _ in 1.. {}' as infinite loop * prevent use of range notation in contexts where only operators of high precedence are expected (fixes #20811) Parser code cleanup: * remove RESTRICTION_NO_DOTS * make AS_PREC const and follow naming convention * make min_prec inclusive
2015-01-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-315/+119
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21rollup merge of #21258: aturon/stab-3-indexAlex Crichton-1/+1
Conflicts: src/libcore/ops.rs src/librustc_typeck/astconv.rs src/libstd/io/mem.rs src/libsyntax/parse/lexer/mod.rs
2015-01-21rollup merge of #21463: sanxiyn/demutAlex Crichton-16/+16
2015-01-21rollup merge of #21411: P1start/help-tweaksAlex Crichton-1/+1
Conflicts: src/librustc_typeck/check/closure.rs
2015-01-21rollup merge of #21340: pshc/libsyntax-no-more-intsAlex Crichton-28/+28
Collaboration with @rylev! I didn't change `int` in the [quasi-quoter](https://github.com/pshc/rust/blob/99ae1a30f3ca28c0f7e431620560d30e44627124/src/libsyntax/ext/quote.rs#L328), because I'm not sure if there will be adverse effects. Addresses #21095.
2015-01-21Fallout from stabilization.Aaron Turon-1/+1
2015-01-21syntax: merge ast::ViewItem into ast::Item.Eduard Burtescu-315/+119
2015-01-21De-mut the parserSeo Sanghyeon-16/+16
2015-01-20Fix up some ‘help’ messagesP1start-1/+1
2015-01-19Auto merge of #21278 - thchittenden:issue-21033-struct-var-pattern-fix, ↵bors-25/+34
r=alexcrichton Closes #21033. The new strategy for parsing a field pattern is to look 1 token ahead and if it's a colon, parse as "fieldname: pat", otherwise parse the shorthand form "(box) (ref) (mut) fieldname)". The previous strategy was to parse "(ref) (mut) fieldname" then if we encounter a colon, throw an error if either "ref" or "mut" were encountered.
2015-01-19Fixes #21033 with accompanying test.Tom Chittenden-25/+34
2015-01-19Auto merge of #21099 - sanxiyn:opt-return-ty, r=alexcrichtonbors-24/+5
This avoids having ast::Ty nodes which have no counterpart in the source.
2015-01-18libsyntax: 0u -> 0us, 0i -> 0isPaul Collier-9/+9
2015-01-18libsyntax: int types -> isizePaul Collier-5/+5
2015-01-18libsyntax: int => i32 in appropriate placesPaul Collier-3/+3
2015-01-18Make output type in ast::FnDecl optionalSeo Sanghyeon-24/+5
2015-01-18auto merge of #20901 : dgrunwald/rust/update-token-can-begin-expr, r=sanxiynbors-9/+3
* add `Token::AndAnd` (double borrow) * add `Token::DotDot` (range notation) * remove `Token::Pound` and `Token::At` This fixes a syntax error when parsing `fn f() -> RangeTo<i32> { return ..1; }`. Also, remove `fn_expr_lookahead`. It's from the `fn~` days and seems to no longer be necessary.
2015-01-17libsyntax: uint types to usizePaul Collier-11/+11
2015-01-15Test fixes and rebase conflictsAlex Crichton-1/+1
2015-01-15rollup merge of #21088: aochagavia/obsoleteAlex Crichton-128/+4
Only the most recent changes (since November 2014) get a special error. Fixes #20599
2015-01-15syntax: parse fully qualified UFCS expressions.Eduard Burtescu-7/+37