summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-307/+307
2013-09-03Incorporate review feedback. Fix #8468.Felix S. Klock II-4/+1
2013-09-03Allow _ param name in trait default method for #8468.Felix S. Klock II-2/+14
2013-09-02switch __field__ hack to <unnamed_field>Daniel Micay-1/+1
avoids conflict with fields actually named `__field__`
2013-09-02Renamed syntax::ast::ident -> IdentMarvin Löbel-98/+98
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-46/+46
2013-08-30fix various warningsErick Tryzelaar-1/+1
2013-08-28auto merge of #8718 : bblum/rust/typeof, r=pcwaltonbors-3/+26
r? anybody
2013-08-27librustc: Fix merge fallout.Patrick Walton-45/+3
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-8/+8
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-27librustc: Add support for type parameters in the middle of paths.Patrick Walton-220/+367
For example, `foo::<T>::bar::<U>`. This doesn't enforce that the type parameters are in the right positions, however.
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-15/+10
They are still present as part of the borrow check.
2013-08-23Emit a better error for attempted unsafe-pointer-self. Close #8306.Ben Blum-0/+13
2013-08-23Parse and reserve typeof keyword. #3228Ben Blum-3/+13
2013-08-22auto merge of #8626 : kballard/rust/issue-8615, r=catamorphismbors-1/+0
Fixes #8615.
2013-08-21std/extra: changing XXX to FIXME; cleanupTim Chevalier-2/+9
* Get rid of by-value-self workarounds; it works now * Remove type annotations, they're not needed anymore
2013-08-20auto merge of #8573 : mrordinaire/rust/struct-new-as-field-name, r=alexcrichtonbors-23/+0
fix for #8088, along with a test.
2013-08-19Don't skip token after @'staticKevin Ballard-1/+0
Fixes #8615.
2013-08-18auto merge of #8560 : kballard/rust/reserve-yield, r=pcwaltonbors-4/+7
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-18auto merge of #8550 : kballard/rust/token-start-err-msg, r=catamorphismbors-1/+3
The span was fixed at some point to point to the correct character, but the error message is still bad. Update it to emit the actual character in question (potentially escaped). Fixes #3747.
2013-08-17auto merge of #8547 : kballard/rust/trait-parse-err-msg, r=alexcrichtonbors-1/+1
When parsing a trait function, the function must end with either `;` or `{` (signifying a default implementation). The error message incorrectly stated that it must be `;` or `}`. Fixes #6610.
2013-08-18fix for #8088 (Cannot name a struct field `new` due to ancient syntax)Do Nhat Minh-23/+0
remove code for parsing ancient syntax added a run-pass test
2013-08-17Fix warnings in librustc and libsyntaxErick Tryzelaar-1/+0
2013-08-16Reserve 'yield' keywordKevin Ballard-4/+7
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-15Better error message for unknown start of tokenKevin Ballard-1/+3
The span was fixed at some point to point to the correct character, but the error message is still bad. Update it to emit the actual character in question (potentially escaped). Fixes #3747.
2013-08-15Fix error message when trait method ends with wrong tokenKevin Ballard-1/+1
When parsing a trait function, the function must end with either `;` or `{` (signifying a default implementation). The error message incorrectly stated that it must be `;` or `}`. Fixes #6610.
2013-08-15std: Change either::{lefts, rights} to return an iteratorblake2-ppc-3/+3
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-26/+18
Closes #5495
2013-08-12auto merge of #8418 : ↵bors-31/+114
pnkfelix/rust/fsk-issue3192-improve-parse-error-for-empty-struct-init, r=pcwalton,me Fix #3192. r? anyone There are 4 different new tests, to check some different scenarios for what the parse context is at the time of recovery, becasue our compile-fail infrastructure does not appear to handle verifying error-recovery situations. Differentiate between unit-like struct definition item and unit-like struct construction in the error message. ---- More generally, outlines a more generic strategy for parse error recovery: By committing to an expression/statement at set points in the parser, we can then do some look-ahead to catch common mistakes and skip over them. One detail about this strategy is that you want to avoid emitting the "helpful" message unless the input is reasonably close to the case of interest. (E.g. do not warn about a potential unit struct for an input of the form `let hmm = do foo { } { };`) To accomplish this, I added (partial) last_token tracking; used for `commit_stmt` support. The check_for_erroneous_unit_struct_expecting fn returns bool to signal whether it "made progress"; currently unused; this is meant for use to compose several such recovery checks together in a loop.
2013-08-11auto merge of #8455 : nikomatsakis/rust/issue-5762-objects-dralston-d, r=graydonbors-18/+19
Fix #5762 and various other aspects of object invocation. r? @graydon
2013-08-11libsyntax: Update from `@Object` to `@mut Object` as requiredNiko Matsakis-18/+19
2013-08-11syntax: Shrink enum Token and enum nonterminalblake2-ppc-11/+11
`enum Token` was 192 bytes (64-bit), as pointed out by pnkfelix; the only bloating variant being `INTERPOLATED(nonterminal)`. Updating `enum nonterminal` to use ~ where variants included big types, shrunk size_of(Token) to 32 bytes (64-bit). I am unsure if the `nt_ident` variant should have an indirection, with ast::ident being only 16 bytes (64-bit), but without this, enum Token would be 40 bytes. A dumb benchmark says that compilation time is unchanged, while peak memory usage for compiling std.rs is down 3% Before:: $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs 19.00user 0.39system 0:19.41elapsed 99%CPU (0avgtext+0avgdata 627820maxresident)k 0inputs+28896outputs (0major+228665minor)pagefaults 0swaps $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs 31.64user 0.34system 0:32.02elapsed 99%CPU (0avgtext+0avgdata 629876maxresident)k 0inputs+22432outputs (0major+229411minor)pagefaults 0swaps After:: $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs 19.07user 0.45system 0:19.55elapsed 99%CPU (0avgtext+0avgdata 609384maxresident)k 0inputs+28896outputs (0major+221997minor)pagefaults 0swaps $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs 31.90user 0.34system 0:32.28elapsed 99%CPU (0avgtext+0avgdata 612080maxresident)k 0inputs+22432outputs (0major+223726minor)pagefaults 0swaps
2013-08-10Merge branch 'issue-8393-attributes-in-macros' of ↵Erick Tryzelaar-59/+95
https://github.com/nikomatsakis/rust into rollup
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-1/+1
cc #5898
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-1/+1
cc #7887
2013-08-09auto merge of #8176 : catamorphism/rust/rustpkg-extern-mod, r=catamorphismbors-5/+18
r? @graydon Also, notably, make rustpkgtest depend on the rustpkg executable (otherwise, tests that shell out to rustpgk might run when rustpkg doesn't exist).
2013-08-09std/rustc/rustpkg/syntax: Support the `extern mod = ...` formTim Chevalier-5/+18
This commit allows you to write: extern mod x = "a/b/c"; which means rustc will search in the RUST_PATH for a package with ID a/b/c, and bind it to the name `x` if it's found. Incidentally, move get_relative_to from back::rpath into std::path
2013-08-09Add parse-error recovery for erroneous `struct_id { }` form.Felix S. Klock II-31/+114
There are 4 different new tests, to check some different scenarios for what the parse context is at the time of recovery, becasue our compile-fail infrastructure does not appear to handle verifying error-recovery situations. Differentiate between unit-like struct definition item and unit-like struct construction in the error message. ---- More generally, outlines a more generic strategy for parse error recovery: By committing to an expression/statement at set points in the parser, we can then do some look-ahead to catch common mistakes and skip over them. One detail about this strategy is that you want to avoid emitting the "helpful" message unless the input is reasonably close to the case of interest. (E.g. do not warn about a potential unit struct for an input of the form `let hmm = do foo { } { };`) To accomplish this, I added (partial) last_token tracking; used for `commit_stmt` support. The check_for_erroneous_unit_struct_expecting fn returns bool to signal whether it "made progress"; currently unused; this is meant for use to compose several such recovery checks together in a loop.
2013-08-08Allow attributes to appear as macro argumentsNiko Matsakis-59/+95
Fixes #8393
2013-08-07Forbid `priv` where it has no effectAlex Crichton-6/+23
This is everywhere except struct fields and enum variants.
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-2/+2
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-4/+4
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-03remove obsolete `foreach` keywordDaniel Micay-21/+16
this has been replaced by `for`
2013-08-03make `for` parse as `foreach` doesDaniel Micay-6/+5
Closes #6997
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-3/+16
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-10/+9
2013-08-01convert `pure` to a reserved keywordDaniel Micay-31/+31
2013-08-01make `in` and `foreach` get treated as keywordsDaniel Micay-13/+13
2013-07-31remove `copy` as a keywordDaniel Micay-70/+68
2013-07-31rm ancient error for lowercase kindsDaniel Micay-32/+3
3 of these kinds no longer even exist in the CamelCase form