about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer
AgeCommit message (Collapse)AuthorLines
2014-07-09lexer: shuffle around some functionsCorey Richardson-99/+100
2014-07-09syntax: use a better Show impl for IdentCorey Richardson-1/+1
Rather than just dumping the id in the interner, which is useless, actually print the interned string. Adjust the lexer logging to use Show instead of Poly.
2014-07-09syntax: doc comments all the thingsCorey Richardson-13/+17
2014-07-08auto merge of #15493 : brson/rust/tostr, r=pcwaltonbors-1/+1
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-1/+1
[breaking-change]
2014-07-08Change DST syntax: type -> Sized?Nick Cameron-0/+1
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-01rustc: Remove `&str` indexing from the language.Brian Anderson-2/+2
Being able to index into the bytes of a string encourages poor UTF-8 hygiene. To get a view of `&[u8]` from either a `String` or `&str` slice, use the `as_bytes()` method. Closes #12710. [breaking-change]
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-1/+1
This commit removes superfluous to_string calls from various places
2014-06-24Remove the quad_precision_float feature gateAlex Crichton-8/+1
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-18Handle CRLF properly in the lexerKevin Ballard-23/+118
The lexer already ignores CRLF in between tokens, but it doesn't properly handle carriage returns inside strings and doc comments. Teach it to treat CRLF as LF inside these tokens, and to disallow carriage returns that are not followed by linefeeds. This includes handling an escaped CRLF inside a regular string token the same way it handles an escaped LF. This is technically a breaking change, as bare carriage returns are no longer allowed, and CRLF sequences are now treated as LF inside strings and doc comments, but it's very unlikely to actually affect any real-world code. This change is necessary to have Rust code compile on Windows the same way it does on Unix. The mozilla/rust repository explicitly sets eol=lf for Rust source files, but other Rust repositories don't. Notably, rust-http cannot be compiled on Windows without converting the CRLF line endings back to LF. [breaking-change]
2014-06-18Don't require mutable StringReader to emit lexer errorsKevin Ballard-42/+52
Teach StringReader how to emit errors for arbitrary spans, so we don't need to modify peek_span. This allows for emitting errors without having a &mut borrow of the StringReader.
2014-06-18Fix spans for doc commentsKevin Ballard-3/+3
2014-06-18Fix some violations of stronger guarantees for mutable borrows.Simon Sapin-9/+17
See 159e27aebb940926ccf1bad0b2b12087d36ad903
2014-06-17Refactor backslash-escape parsing to share similar code.Simon Sapin-151/+69
Move into a new syntax::parse::lexer::StringReader method the code that was almost duplicated for parsing backslash-escapes in byte, byte string, char, and string literals.
2014-06-17Add br##"xx"## raw byte string literals.Simon Sapin-3/+53
2014-06-17Add a b"xx" byte string literal of type &'static [u8].Simon Sapin-48/+111
2014-06-17Add a b'x' byte literal of type u8.Simon Sapin-3/+65
2014-06-13Fix all violations of stronger guarantees for mutable borrowsCameron Zwarich-28/+54
Fix all violations in the Rust source tree of the stronger guarantee of a unique access path for mutable borrows as described in #12624.
2014-06-13librustc: Fix the issue with labels shadowing variable names by makingPatrick Walton-12/+27
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-04syntax: methodify the lexerCorey Richardson-0/+1577