about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer.rs
AgeCommit message (Collapse)AuthorLines
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).
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-2/+2
2013-03-29commenting parserJohn Clements-1/+6
2013-03-22librustc: Remove `pure` from libsyntax and librustc.Patrick Walton-5/+5
2013-03-22syntax: replace uses of old deriving attribute with new oneAndrew Paseltiner-1/+1
2013-03-21auto merge of #5407 : jbclements/rust/add-assert-eq-macro, r=jbclementsbors-10/+9
Adds an assert_eq! macro that asserts that its two arguments are equal. Error messages can therefore be somewhat more informative than a simple assert, because the error message includes "expected" and "given" values.
2013-03-21back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> ↵Marvin Löbel-1/+1
slice_unique
2013-03-21renamed str::view -> slice_DBG_BRWDMarvin Löbel-2/+2
renamed str::slice -> slice_DBG_UNIQ changed vec slice method -> to_owned() renamed vec view method -> slice_V_DBG_BRWD
2013-03-20change some uses of fail_unless to assert_eqJohn Clements-10/+9
2013-03-18librustc: Make the compiler ignore purity.Patrick Walton-2/+2
For bootstrapping purposes, this commit does not remove all uses of the keyword "pure" -- doing so would cause the compiler to no longer bootstrap due to some syntax extensions ("deriving" in particular). Instead, it makes the compiler ignore "pure". Post-snapshot, we can remove "pure" from the language. There are quite a few (~100) borrow check errors that were essentially all the result of mutable fields or partial borrows of `@mut`. Per discussions with Niko I think we want to allow partial borrows of `@mut` but detect obvious footguns. We should also improve the error message when `@mut` is erroneously reborrowed.
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-9/+9
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-6/+6
2013-03-04Adding missing imports for tests, and gate off othersAlex Crichton-1/+0
2013-03-04Remove unused imports throughout src/Alex Crichton-1/+0
2013-03-01Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-2/+6
2013-02-28Fix implicit leaks of imports throughout librariesAlex Crichton-2/+6
Also touch up use of 'pub' and move some tests around so the tested functions don't have to be 'pub'
2013-02-27Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-1/+49