about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2014-02-23auto merge of #12328 : nick29581/rust/abi, r=alexcrichtonbors-4/+5
2014-02-24All uses of `extern fn` should mean `extern "C" fn`. Closes #9309.Nick Cameron-4/+5
2014-02-23auto merge of #12338 : edwardw/rust/hygienic-break-continue, r=cmrbors-5/+5
Makes labelled loops hygiene by performing renaming of the labels defined in e.g. `'x: loop { ... }` and then used in break and continue statements within loop body so that they act hygienically when used with macros. Closes #12262.
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-14/+5
2014-02-23Make break and continue hygienicEdward Wang-5/+5
Makes labelled loops hygiene by performing renaming of the labels defined in e.g. `'x: loop { ... }` and then used in break and continue statements within loop body so that they act hygienically when used with macros. Closes #12262.
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-1/+1
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-22Represent lifetimes as Names instead of IdentsEdward Wang-1/+1
Closes #7743.
2014-02-20move extra::test to libtestLiigo Zhuang-3/+4
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-25/+33
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-14extern mod => extern crateAlex Crichton-10/+10
This was previously implemented, and it just needed a snapshot to go through
2014-02-14Register new snapshotsAlex Crichton-7/+6
This enables the parser error for `extern mod` => `extern crate` transitions.
2014-02-14Removed the obsolete ast::CallSugar (previously used by `do`).Eduard Burtescu-17/+13
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-152/+120
2014-02-13Remove obsolete warnings for `extern mod`Flavio Percoco-12/+0
This patch gets rid of ObsoleteExternModAttributesInParens and ObsoleteNamedExternModule since the replacement of `extern mod` with `extern crate` avoids those cases and raises different errors. Both have been around for at least a version which makes this a good moment to get rid of them.
2014-02-13Replace `extern mod` with `extern crate`Flavio Percoco-105/+108
This patch adds a new keyword `crate` which is intended to replace mod in the context of `extern mod` as part of the issue #9880. The patch doesn't replace all `extern mod` cases since it is necessary to first push a new snapshot 0. The implementation could've been less invasive than this. However I preferred to take this chance to split the `parse_item_foreign_mod` method and pull the `extern crate` part out of there, hence the new method `parse_item_foreign_crate`.
2014-02-11Correct span for self and ExprStructSeo Sanghyeon-2/+2
2014-02-11auto merge of #12170 : aepsil0n/rust/feature/reserve_do_keyword, r=brsonbors-0/+1
This resolves issue #12157. Does that do it already or is there something else that needs taking care of? As a side note, there seems to be some documentation, in which the old existence of the do keyword is explained. The list of keywords is not up-to-date either. But these are certainly separate issues.
2014-02-11Reserve `do` as a keywordEduard Bopp-0/+1
Resolves issue #12157. `do` is hereby reinstated as a keyword; no syntax is associated with it though. Along the way, a unit test had to be adapted, since it was using `do` as a method identifier. Breaking changes: - Any code using `do` as an identifier will no longer work.
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-7/+7
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-08Fixed error starting with uppercasemr.Shu-5/+5
Error messages cleaned in librustc/middle Error messages cleaned in libsyntax Error messages cleaned in libsyntax more agressively Error messages cleaned in librustc more aggressively Fixed affected tests Fixed other failing tests Last failing tests fixed
2014-02-08auto merge of #12098 : kballard/rust/from_utf8_lossy_tweak, r=huonwbors-2/+2
MaybeOwned allows from_utf8_lossy to avoid allocation if there are no invalid bytes in the input. Before: ``` test str::bench::from_utf8_lossy_100_ascii ... bench: 183 ns/iter (+/- 5) test str::bench::from_utf8_lossy_100_invalid ... bench: 341 ns/iter (+/- 15) test str::bench::from_utf8_lossy_100_multibyte ... bench: 227 ns/iter (+/- 13) test str::bench::from_utf8_lossy_invalid ... bench: 102 ns/iter (+/- 4) test str::bench::is_utf8_100_ascii ... bench: 2 ns/iter (+/- 0) test str::bench::is_utf8_100_multibyte ... bench: 2 ns/iter (+/- 0) ``` Now: ``` test str::bench::from_utf8_lossy_100_ascii ... bench: 96 ns/iter (+/- 4) test str::bench::from_utf8_lossy_100_invalid ... bench: 318 ns/iter (+/- 10) test str::bench::from_utf8_lossy_100_multibyte ... bench: 105 ns/iter (+/- 2) test str::bench::from_utf8_lossy_invalid ... bench: 105 ns/iter (+/- 2) test str::bench::is_utf8_100_ascii ... bench: 2 ns/iter (+/- 0) test str::bench::is_utf8_100_multibyte ... bench: 2 ns/iter (+/- 0) ```
2014-02-08auto merge of #12086 : huonw/rust/safe-json, r=kballardbors-116/+157
The lexer and json were using `transmute(-1): char` as a sentinel value for EOF, which is invalid since `char` is strictly a unicode codepoint. Fixing this allows for range asserts on chars since they always lie between 0 and 0x10FFFF.
2014-02-07Rewrite path::Display to reduce unnecessary allocationKevin Ballard-2/+2
2014-02-08std::fmt: convert the formatting traits to a proper self.Huon Wilson-2/+2
Poly and String have polymorphic `impl`s and so require different method names.
2014-02-08syntax: convert the lexer to use Option<char> over transmute(-1).Huon Wilson-116/+157
The transmute was unsound. There are many instances of .unwrap_or('\x00') for "ignoring" EOF which either do not make the situation worse than it was (well, actually make it better, since it's easy to grep for places that don't handle EOF) or can never ever be read. Fixes #8971.
2014-02-07Correct span for ExprFnBlock, ExprMethodCall, ExprParenSeo Sanghyeon-3/+3
2014-02-07Removed @self and @Trait.Eduard Burtescu-94/+83
2014-02-06auto merge of #12048 : sanxiyn/rust/crate-config, r=alexcrichtonbors-3/+3
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-2/+2
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-02-06Avoid cloning ast::CrateConfigSeo Sanghyeon-3/+3
2014-02-04Replace NonCopyable usage with NoPodFlavio Percoco-2/+3
cc #10834
2014-02-03Fixing remaining warnings and errors throughoutAlex Crichton-2/+2
2014-02-03syntax: Remove io_error usageAlex Crichton-4/+4
2014-02-02std: rename fmt::Default to `Show`.Huon Wilson-1/+1
This is a better name with which to have a #[deriving] mode. Decision in: https://github.com/mozilla/rust/wiki/Meeting-weekly-2014-01-28
2014-02-02rustc: update docs & propagate @[]/@str removal more.Huon Wilson-1/+1
Various functions can now be made specific to ~[], or just non-managed vectors.
2014-02-02rustc: Remove the vstore handling of @str and @[].Huon Wilson-1/+1
2014-02-02syntax: remove the handling of @str and @[] from the parser completely.Huon Wilson-30/+9
2014-02-02syntax: add an obsolete syntax warning for @[].Huon Wilson-1/+9
2014-02-02Changes from the review of the @str PR.Huon Wilson-7/+0
2014-02-02Fix `@str` removal tests.Huon Wilson-1/+0
2014-02-02librustc: Remove `@str` from the languagePatrick Walton-5/+14
2014-02-02libsyntax: Remove `@str` from the internerPatrick Walton-11/+14
2014-02-02libsyntax: Remove the `interner_get` function and all usesPatrick Walton-28/+2
2014-02-02libsyntax: Remove uses of `token::ident_to_str()`Patrick Walton-29/+14
2014-02-02libsyntax: Remove many uses of `token::ident_to_str`Patrick Walton-4/+4
2014-02-02libsyntax: Fix tests.Patrick Walton-25/+25
2014-02-02libsyntax: Remove `ident_to_str` from the parser, which was returningPatrick Walton-10/+8
`@str` values
2014-02-02libsyntax: Remove all `@str` from the ASTPatrick Walton-5/+8
2014-02-02libsyntax: Make float literals not use `@str`Patrick Walton-3/+6
2014-02-02libsyntax: De-`@str` pathnamesPatrick Walton-17/+13