about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer.rs
AgeCommit message (Collapse)AuthorLines
2013-09-25auto merge of #9481 : jbclements/rust/minor-cleanup, r=cmrbors-1/+0
Small stuff... might as well get it into the tree. One new test case, some issue # cleanup, remove some unused imports.
2013-09-24Disallow char literals which should be escapedAlex Crichton-21/+28
As documented in issue #7945, these literal identifiers are all accepted by rust today, but they should probably be disallowed (especially `'''`). This changes all escapable sequences to being *required* to be escaped. Closes #7945
2013-09-24cleanupJohn Clements-1/+0
2013-09-19lexer: further slight improvements to lexer errorsBenjamin Herr-16/+30
2013-09-19lexer: report problematic chars verbatim or as escape sequenceBenjamin Herr-12/+23
... instead of giving their numeric codepoint, following the lead of fdaae34. So the error message for, say, '\_' mentions _ instead of 95, and '\●' now mentions \u25cf.
2013-09-19lexer: show correct span on lexical errorsBenjamin Herr-19/+59
Previously, the lexer calling `rdr.fatal(...)` would report the span of the last complete token, instead of a span within the erroneous token (besides one span fixed in 1ac90bb). This commit adds a wrapper around `rdr.fatal(...)` that sets the span explicilty, so that all fatal errors in `libsyntax/parse/lexer.rs` now report the offending code more precisely. A number of tests try to verify that, though the `compile-fail` testing setup can only check that the spans are on the right lines, and the "unterminated string/block comment" errors can't have the line marked at all, so that's incomplete. Closes #9149.
2013-09-17Added support for a `\0` escape sequence.Daniel Rosenwasser-0/+2
This commit adds support for `\0` escapes in character and string literals. Since `\0` is equivalent to `\x00`, this is a direct translation to the latter escape sequence. Future builds will be able to compile using `\0` directly. Also updated the grammar specification and added a test for NUL characters.
2013-09-15Remove {uint,int,u64,i64,...}::from_str,from_str_radixblake2-ppc-3/+3
Remove these in favor of the two traits themselves and the wrapper function std::from_str::from_str. Add the function std::num::from_str_radix in the corresponding role for the FromStrRadix trait.
2013-09-04stop treating char as an integer typeDaniel Micay-9/+13
Closes #7609
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-6/+6
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-11libsyntax: Update from `@Object` to `@mut Object` as requiredNiko Matsakis-10/+11
2013-08-08Allow attributes to appear as macro argumentsNiko Matsakis-1/+5
Fixes #8393
2013-08-03remove obsolete `foreach` keywordDaniel Micay-1/+1
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-1/+1
2013-07-17librustc: Change repeated vector expressions to use implicit copyability.Patrick Walton-2/+5
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-7/+9
2013-07-17librustc: Add a lint mode for unnecessary `copy` and remove a bunch of them.Patrick Walton-9/+9
2013-06-28librustc: Remove the broken overloaded assign-ops from the language.Patrick Walton-4/+4
They evaluated the receiver twice. They should be added back with `AddAssign`, `SubAssign`, etc., traits.
2013-06-25great renaming propagation: syntaxCorey Richardson-6/+3
2013-06-23vec: remove BaseIter implementationDaniel Micay-1/+1
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-14add IteratorUtil to the preludeDaniel Micay-1/+0
2013-06-13Use @str instead of @~str in libsyntax and librustc. Fixes #5048.Huon Wilson-14/+14
This almost removes the StringRef wrapper, since all strings are Equiv-alent now. Removes a lot of `/* bad */ copy *`'s, and converts several things to be &'static str (the lint table and the intrinsics table). There are many instances of .to_managed(), unfortunately.
2013-06-11lexer: show correct span on unrecognized token startPhilipp Brüschweiler-1/+5
Fixes part of #7048.
2013-06-10clean-up unused import warningsHuon Wilson-2/+1
2013-06-10std: convert str::char_at* to methods.Huon Wilson-2/+2
2013-06-10std: convert str::reserve* to methods, and methodise str::push_*.Huon Wilson-16/+13
2013-06-10std: replace str::{any,all}_between with the iterator equivalent.Huon Wilson-1/+1
2013-06-10std: remove str::{len, slice, is_empty} in favour of methods.Huon Wilson-3/+3
2013-06-10std: replace str::all/any fns and methods with iteratorsHuon Wilson-1/+2
2013-06-08Lexer: Avoid unnecessary allocationsBjörn Steinbrink-38/+52
2013-06-08Avoid unnecessary (re-)allocations in the lexerBjörn Steinbrink-7/+8
2013-06-08Lexer: Fix offset handling in get_str_from()Björn Steinbrink-9/+7
As the comment said, the subtraction is bogus for multibyte characters. Fortunately, we can just use last_pos instead of pos to get the correct position without any subtraction hackery.
2013-06-05removed unused imports (and one unused argument)John Clements-2/+2
2013-06-05remove interner field from string_readerJohn Clements-22/+14
2013-06-05interner just uses uints, not idents with syntax contextJohn Clements-15/+15
2013-06-05removed some interner fieldsJohn Clements-3/+0
2013-06-05just use TLS internerJohn Clements-14/+16
2013-06-04librustc: Disallow multiple patterns from appearing in a "let" declaration.Patrick Walton-2/+6
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
2013-05-30Remove a bunch of unnecessary allocations and copiesBjörn Steinbrink-1/+2
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+5
2013-05-28Remove unnecessary allocations flagged by lintSeo Sanghyeon-1/+1
2013-05-24auto merge of #6680 : ben0x539/rust/slashslashslash, r=graydonbors-2/+9
There's currently a function in the lexer that rejects a line comment that is all slashes from being a doc comment. I think the intention was that you could draw boxes, ///////////// // like so // ///////////// Since a line doc comment split up over multiple paragraphs will have a "blank" line that is just /// between the paragraphs, that would get mistaken for a box segment, lexed as a regular comment, and go missing from the sequence of doc comment attributes before they were reassembled by rustdoc into markdown input. I figure the best plan here is to just declare that a comment that is exactly `///` is a doc comment after all, and to only omit comments with four slashes or more, which is what this commit implements. Can't really draw boxes that narrow, anyway.
2013-05-22librustc: Change `std` to `extra` throughout libsyntax and librustcPatrick Walton-2/+0
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+2
to libextra
2013-05-22declare that "///" is still a doc comment, just not "////+" (fixes #5838)Benjamin Herr-2/+9
2013-05-20getting rid of interner_key! macroJohn Clements-1/+1
2013-05-09Use a specialized string interner to reduce the need for owned stringsBjörn Steinbrink-22/+22
&str can be turned into @~str on demand, using to_owned(), so for strings, we can create a specialized interner that accepts &str for intern() and find() but stores and returns @~str.
2013-05-05Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freezeNiko Matsakis-10/+0
Conflicts: src/libcore/core.rc src/libcore/hashmap.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/num/float.rs src/libcore/num/int-template.rs src/libcore/num/num.rs src/libcore/num/strconv.rs src/libcore/num/uint-template.rs src/libcore/ops.rs src/libcore/os.rs src/libcore/prelude.rs src/libcore/rt/mod.rs src/libcore/unstable/lang.rs src/librustc/driver/session.rs src/librustc/middle/astencode.rs src/librustc/middle/borrowck/check_loans.rs src/librustc/middle/borrowck/gather_loans.rs src/librustc/middle/borrowck/loan.rs src/librustc/middle/borrowck/preserve.rs src/librustc/middle/liveness.rs src/librustc/middle/mem_categorization.rs src/librustc/middle/region.rs src/librustc/middle/trans/base.rs src/librustc/middle/trans/inline.rs src/librustc/middle/trans/reachable.rs src/librustc/middle/typeck/check/_match.rs src/librustc/middle/typeck/check/regionck.rs src/librustc/util/ppaux.rs src/libstd/arena.rs src/libstd/ebml.rs src/libstd/json.rs src/libstd/serialize.rs src/libstd/std.rc src/libsyntax/ast_map.rs src/libsyntax/parse/parser.rs src/test/compile-fail/borrowck-uniq-via-box.rs src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs src/test/run-pass/borrowck-nested-calls.rs
2013-05-02Remove 'Local Variable' commentsBrendan Zabarauskas-10/+0