about summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
AgeCommit message (Collapse)AuthorLines
2014-03-12rand: deprecate `rng`.Huon Wilson-1/+1
This should be called far less than it is because it does expensive OS interactions and seeding of the internal RNG, `task_rng` amortises this cost. The main problem is the name is so short and suggestive. The direct equivalent is `StdRng::new`, which does precisely the same thing. The deprecation will make migrating away from the function easier.
2014-03-05Refactor and fix FIXME's in mtwt hygiene codeEdward Wang-3/+4
- Moves mtwt hygiene code into its own file - Fixes FIXME's which leads to ~2x speed gain in expansion pass - It is now @-free
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-7/+6
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-3/+3
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-2/+20
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-23auto merge of #12338 : edwardw/rust/hygienic-break-continue, r=cmrbors-2/+2
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-4/+4
2014-02-23Make break and continue hygienicEdward Wang-2/+2
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-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-118/+103
2014-02-13Replace `extern mod` with `extern crate`Flavio Percoco-26/+27
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-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-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-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-1/+1
- `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-03Fixing remaining warnings and errors throughoutAlex Crichton-2/+2
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-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-4/+5
2014-02-02libsyntax: Remove `@str` from the internerPatrick Walton-10/+12
2014-02-02libsyntax: Remove the `interner_get` function and all usesPatrick Walton-27/+0
2014-02-02libsyntax: Remove uses of `token::ident_to_str()`Patrick Walton-29/+14
2014-02-02libsyntax: De-`@str` literal strings in the ASTPatrick Walton-1/+13
2014-02-02libsyntax: Introduce an `InternedString` type to reduce `@str` in thePatrick Walton-0/+87
compiler and use it for attributes
2014-01-29Removing support for the do syntax from libsyntax and librustc.Scott Lawrence-40/+39
Fixes #10815.
2014-01-21Remove unnecessary parentheses.Huon Wilson-1/+1
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-46/+48
2013-12-15libsyntax: Implement the new `box` syntax for unique pointers.Patrick Walton-7/+9
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-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-3/+3
critical enum sizes.
2013-11-28Register new snapshotsAlex Crichton-16/+16
2013-11-26auto merge of #10670 : eddyb/rust/node-u32, r=alexcrichtonbors-6/+6
### Rationale There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least **64GB**. Meanwhile, some can't (or barely can) compile rustc because it requires almost **1.5GB**. ### Potential problems Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it. ### Results Some structures have a size reduction of 25% to 50%: [before](https://gist.github.com/luqmana/3a82a51fa9c86d9191fa) - [after](https://gist.github.com/eddyb/5a75f8973d3d8018afd3). Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over **1.4GB** as [before](http://huonw.github.io/isrustfastyet/mem/), but I can barely see the difference). However, my own testcase (previously peaking at **1.6GB** in typeck) shows a reduction of **200**-**400MB**.
2013-11-27Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64.Eduard Burtescu-6/+6
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-2/+2
2013-11-04libsyntax/librustc: Allow calling variadic foreign functions.Luqman Aden-0/+2
2013-10-29librustc: Implement the `proc` type as sugar for `~once fn` and `proc`Patrick Walton-19/+22
notation for closures, and disable the feature gate for `once fn` if used with the `~` sigil.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-3/+3
Who doesn't like a massive renaming?
2013-10-09option: rewrite the API to use compositionDaniel Micay-1/+1
2013-10-08Register new snapshotsAlex Crichton-19/+0
2013-10-08Add bindings for start and ends of keyword ranges; use bindings in match arms.Felix S. Klock II-11/+40
2013-10-08add token::LIT_STR_RAW(ident, num of # symbols)Benjamin Herr-0/+7
Treat it as a synonym for LIT_STR for now.
2013-09-30syntax: Remove usage of fmt!Alex Crichton-6/+6
2013-09-26Add 'continue' as a synonym for 'loop'Brian Anderson-18/+21
2013-09-22Reserve the `alignof`, `offsetof`, and `sizeof` keywordsBirunthan Mohanathas-4/+14
Closes #9333.
2013-09-18Register new snapshotsAlex Crichton-2/+1
2013-09-09auto merge of #9005 : alexcrichton/rust/rusty-log, r=brsonbors-3/+3
Also redefine all of the standard logging macros to use more rust code instead of custom LLVM translation code. This makes them a bit easier to understand, but also more flexibile for future types of logging. Additionally, this commit removes the LogType language item in preparation for changing how logging is performed.
2013-09-06add test case, cleanupJohn Clements-2/+0
2013-09-06remove unneeded imports, clean up unused var warningsJohn Clements-5/+2
2013-09-06memoization for resolveJohn Clements-2/+2