about summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
AgeCommit message (Collapse)AuthorLines
2014-11-05Remove `Matcher`sPiotr Czarnecki-2/+0
2014-11-05Use `TokenTree`s in lhs of macrosPiotr Czarnecki-0/+8
2014-11-05Register snapshots.Eduard Burtescu-77/+0
2014-11-03Clean-up transmutes in libsyntaxAriel Ben-Yehuda-2/+2
2014-10-30Test fixes and rebase conflictsAlex Crichton-7/+7
2014-10-30rollup merge of #18430 : bjz/tokenAlex Crichton-34/+30
Conflicts: src/libsyntax/parse/parser.rs
2014-10-30rollup merge of #18398 : aturon/lint-conventions-2Alex Crichton-2/+2
Conflicts: src/libcollections/slice.rs src/libcore/failure.rs src/libsyntax/parse/token.rs src/test/debuginfo/basic-types-mut-globals.rs src/test/debuginfo/simple-struct.rs src/test/debuginfo/trait-pointers.rs
2014-10-30Formatting fixesBrendan Zabarauskas-8/+8
2014-10-30Remove Token::get_close_delimiterBrendan Zabarauskas-11/+0
We can simplify these usages due to the new delimiter representation. `Parser::expect_open_delim` has been added for convenience.
2014-10-30Use common variants for open and close delimitersBrendan Zabarauskas-19/+26
This common representation for delimeters should make pattern matching easier. Having a separate `token::DelimToken` enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in `ast::TtDelimited`, removing the need to ensure matched delimiters when working with token trees.
2014-10-28Update code with new lint namesAaron Turon-2/+2
2014-10-28Move token-to-string functions into print::pprustBrendan Zabarauskas-95/+0
2014-10-28Use an enum rather than a bool in token::IdentBrendan Zabarauskas-13/+35
2014-10-28Convert some token functions into methodsBrendan Zabarauskas-178/+202
2014-10-28Use PascalCase for token variantsBrendan Zabarauskas-278/+322
2014-10-09syntax: Convert statics to constantsAlex Crichton-8/+8
2014-10-07Add `abstract`, `final`, and `override` to reserved keywordsJohn Gallagher-0/+3
2014-10-03Set the `non_uppercase_statics` lint to warn by defaultP1start-2/+5
2014-09-26librustc: Eliminate the `ref` syntax for unboxed closure capture clausesPatrick Walton-28/+29
in favor of `move`. This breaks code that used `move` as an identifier, because it is now a keyword. Change such identifiers to not use the keyword `move`. Additionally, this breaks code that was counting on by-value or by-reference capture semantics for unboxed closures (behind the feature gate). Change `ref |:|` to `|:|` and `|:|` to `move |:|`. Part of RFC #63; part of issue #12831. [breaking-change]
2014-09-18libsyntax: Disallow keywords followed by `::`.Patrick Walton-35/+48
This breaks code that looked like: mymacro!(static::foo); ... where `mymacro!` expects a path or expression. Change such macros to not accept keywords followed by `::`. Closes #17298. [breaking-change]
2014-09-17auto merge of #17223 : retep998/rust/into_string, r=huonwbors-41/+41
Replaces some usage of `.to_string()` with `.into_string()`
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-10/+10
2014-09-13Improve memory usage of libsyntaxPeter Atashian-41/+41
Replaces some usage of `.to_string()` with `.into_string()` Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-16librustc: Forbid external crates, imports, and/or items from beingPatrick Walton-45/+46
declared with the same name in the same scope. This breaks several common patterns. First are unused imports: use foo::bar; use baz::bar; Change this code to the following: use baz::bar; Second, this patch breaks globs that import names that are shadowed by subsequent imports. For example: use foo::*; // including `bar` use baz::bar; Change this code to remove the glob: use foo::{boo, quux}; use baz::bar; Or qualify all uses of `bar`: use foo::{boo, quux}; use baz; ... baz::bar ... Finally, this patch breaks code that, at top level, explicitly imports `std` and doesn't disable the prelude. extern crate std; Because the prelude imports `std` implicitly, there is no need to explicitly import it; just remove such directives. The old behavior can be opted into via the `import_shadowing` feature gate. Use of this feature gate is discouraged. This implements RFC #116. Closes #16464. [breaking-change]
2014-08-14librustc: Implement simple `where` clauses.Patrick Walton-10/+11
These `where` clauses are accepted everywhere generics are currently accepted and desugar during type collection to the type parameter bounds we have today. A new keyword, `where`, has been added. Therefore, this is a breaking change. Change uses of `where` to other identifiers. [breaking-change]
2014-07-20Correctly stringify! types and paths inside macrosPiotr Jawniak-3/+5
Closes #8709
2014-07-09Fix all the test falloutCorey Richardson-2/+2
2014-07-09ast: make Name its own typeCorey Richardson-45/+56
2014-07-09lexer: lex WS/COMMENT/SHEBANG rather than skippingCorey Richardson-1/+15
Now, the lexer will categorize every byte in its input according to the grammar. The parser skips over these while parsing, thus avoiding their presence in the input to syntax extensions.
2014-07-09syntax: don't parse numeric literals in the lexerCorey Richardson-33/+9
This removes a bunch of token types. Tokens now store the original, unaltered numeric literal (that is still checked for correctness), which is parsed into an actual number later, as needed, when creating the AST. This can change how syntax extensions work, but otherwise poses no visible changes. [breaking-change]
2014-07-09syntax: don't process string/char/byte/binary litsCorey Richardson-23/+11
This shuffles things around a bit so that LIT_CHAR and co store an Ident which is the original, unaltered literal in the source. When creating the AST, unescape and postprocess them. This changes how syntax extensions can work, slightly, but otherwise poses no visible changes. To get a useful value out of one of these tokens, call `parse::{char_lit, byte_lit, bin_lit, str_lit}` [breaking-change]
2014-07-09token: replace ast::Ident with just IdentCorey Richardson-18/+19
2014-07-09syntax: doc comments all the thingsCorey Richardson-3/+3
2014-07-08replace idents with namesJohn Clements-0/+5
2014-07-08get rid of keyword idents, replace with namesJohn Clements-6/+6
should prevent future bugs
2014-07-08remove unused fn, make SELF_KEYWORD_NAME publicJohn Clements-5/+1
2014-07-08auto merge of #15493 : brson/rust/tostr, r=pcwaltonbors-12/+12
This updates https://github.com/rust-lang/rust/pull/15075. Rename `ToStr::to_str` to `ToString::to_string`. The naive renaming ends up with two `to_string` functions defined on strings in the prelude (the other defined via `collections::str::StrAllocating`). To remedy this I removed `StrAllocating::to_string`, making all conversions from `&str` to `String` go through `Show`. This has a measurable impact on the speed of this conversion, but the sense I get from others is that it's best to go ahead and unify `to_string` and address performance for all `to_string` conversions in `core::fmt`. `String::from_str(...)` still works as a manual fast-path. Note that the patch was done with a script, and ended up renaming a number of other `*_to_str` functions, particularly inside of rustc. All the ones I saw looked correct, and I didn't notice any additional API breakage. Closes #15046.
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-12/+12
[breaking-change]
2014-07-08Change DST syntax: type -> Sized?Nick Cameron-0/+2
closes #13367 [breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g., ``` trait Tr for Sized? {} fn foo<Sized? X: Share>(x: X) {} ```
2014-07-04new_mark -> apply_mark, new_rename -> apply_renameJohn Clements-1/+1
2014-06-27comments onlyJohn Clements-0/+1
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-4/+2
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-24auto merge of #14952 : alexcrichton/rust/const-unsafe-pointers, r=brsonbors-3/+3
This does not yet change the compiler and libraries from `*T` to `*const T` as it will require a snapshot to do so. cc #7362 --- Note that the corresponding RFC, https://github.com/rust-lang/rfcs/pull/68, has not yet been accepted. It was [discussed at the last meeting](https://github.com/rust-lang/rust/wiki/Meeting-weekly-2014-06-10#rfc-pr-68-unsafe-pointers-rename-t-to-const-t) and decided to be accepted, however. I figured I'd get started on the preliminary work for the RFC that will be required regardless.
2014-06-17Add br##"xx"## raw byte string literals.Simon Sapin-0/+7
2014-06-17Add a b"xx" byte string literal of type &'static [u8].Simon Sapin-4/+12
2014-06-17Add a b'x' byte literal of type u8.Simon Sapin-0/+11
2014-06-16rustc: Start accepting `*const T`Alex Crichton-3/+3
This does not yet change the compiler and libraries from `*T` to `*const T` as it will require a snapshot to do so. cc #7362
2014-06-13librustc: Fix the issue with labels shadowing variable names by makingPatrick Walton-51/+52
the leading quote part of the identifier for the purposes of hygiene. This adopts @jbclements' solution to #14539. I'm not sure if this is a breaking change or not. Closes #12512. [breaking-change]
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-10/+10
2014-06-06Change to_str().to_string() to just to_str()Adolfo OchagavĂ­a-1/+1