about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer.rs
AgeCommit message (Collapse)AuthorLines
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
2013-05-01syntax: fix up dynamic borrow errors in libsyntaxNiko Matsakis-2/+2
2013-04-28parser commentsJohn Clements-0/+2
2013-04-28remove unused functions, fix tiny lexing bugJohn Clements-10/+1
before this change, the parser would parse 14.a() as a method call, but would parse 14.ø() as the floating-point number 14. followed by a function call. This is because it was checking is_alpha, rather than ident_start, and was therefore wrong with respect to unicode.
2013-04-27only use #[no_core] in libcoreDaniel Micay-7/+0
2013-04-18core: replace unicode match exprs with bsearch in const arrays, minor perf win.Graydon Hoare-2/+2
2013-04-16libcore,std,syntax,rustc: move tests into `mod tests`, make them private (no ↵Huon Wilson-1/+1
pub mod or pub fn).
2013-04-08auto merge of #5787 : alexcrichton/rust/less-mut-fields, r=catamorphismbors-6/+4
This removes some of the easier instances of mutable fields where the explicit self can just become `&mut self` along with removing some unsafe blocks which aren't necessary any more now that purity is gone. Most of #4568 is done, except for [one case](https://github.com/alexcrichton/rust/blob/less-mut-fields/src/libcore/vec.rs#L1754) where it looks like it has to do with it being a `const` vector. Removing the unsafe block yields: ``` /Users/alex/code/rust2/src/libcore/vec.rs:1755:12: 1755:16 error: illegal borrow unless pure: creating immutable alias to const vec content /Users/alex/code/rust2/src/libcore/vec.rs:1755 for self.each |e| { ^~~~ /Users/alex/code/rust2/src/libcore/vec.rs:1757:8: 1757:9 note: impure due to access to impure function /Users/alex/code/rust2/src/libcore/vec.rs:1757 } ^ error: aborting due to previous error ``` I also didn't delve too much into removing mutable fields with `Cell` or `transmute` and friends.
2013-04-08Removing no longer needed unsafe blocksAlex Crichton-6/+4
2013-04-08libsyntax: fail lexing with an error message on an int literal larger than 2^64.Huon Wilson-2/+9
Stops an ICE. Closes #5544.
2013-04-03auto merge of #5559 : jbclements/rust/change-to-tt-based-parsing, r=jbclementsbors-1/+6
Changes the parser to parse all streams into token-trees before hitting the parser proper, in preparation for hygiene. As an added bonus, it appears to speed up the parser (albeit by a totally imperceptible 1%). Also, many comments in the parser. Also, field renaming in token-trees (readme->forest, cur->stack).