about summary refs log tree commit diff
path: root/src/libsyntax/parse/comments.rs
AgeCommit message (Collapse)AuthorLines
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-2/+2
2013-07-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-3/+3
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spaces, so that `rustc --cfg 'foo(bar)'` now works.
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-1/+3
2013-06-28librustc: Remove the broken overloaded assign-ops from the language.Patrick Walton-3/+3
They evaluated the receiver twice. They should be added back with `AddAssign`, `SubAssign`, etc., traits.
2013-06-25great renaming propagation: syntaxCorey Richardson-5/+3
2013-06-16Do not strip leading whitespace when parsing doc comments.SiegeLord-23/+65
This change prevents the indentation in code blocks inside the /// doc comments from being eaten. The indentation that is the same across the consecutive doc comments is removed by the uindent_pass in librustdoc.
2013-06-16auto merge of #7123 : huonw/rust/more-str, r=thestingerbors-8/+6
Moves all the remaining functions that could reasonably be methods to be methods, except for some FFI ones (which I believe @erickt is working on, possibly) and `each_split_within`, since I'm not really sure the details of it (I believe @kimundi wrote the current implementation, so maybe he could convert it to an external iterator method on `StrSlice`, e.g. `word_wrap_iter(&self) -> WordWrapIterator<'self>`, where `WordWrapIterator` impls `Iterator<&'self str>`. It probably won't be too hard, since it's already a state machine.) This also cleans up the comparison impls for the string types, except I'm not sure how the lang items `eq_str` and `eq_str_uniq` need to be handled, so they (`eq_slice` and `eq`) remain stand-alone functions.
2013-06-15auto merge of #7114 : pnkfelix/rust/issue3961-fix-whitespace-detection, r=brsonbors-14/+23
r? (yes, the review request is back, now that I got it building against incom... I mean master!) (Attempting to port from orphaned pull-request #6764 ) Fix for #3961. Also includes a test case to illustrate the issues. (All of the entries that say "should align" should align with each other, and the four lines near the end that say "compare _" for _ in {A,B,C,D} should line up with each other.) Before applying this change set: -- the "(should align)"'s are all over the place, and the form/line feeding spaces are not cut out as one might or might not expect. -- compare B and D do not match A and C. (To be honest, its hard to really say what the right behavior is here, and people who are expecting a particular behavior out of a pretty printer in these cases may well get burned.)
2013-06-16std: convert str::{map,levdistance,subslice_offset} to methods.Huon Wilson-8/+6
The first two become map_chars and lev_distance. Also, remove a few allocations in rustdoc.
2013-06-14add IteratorUtil to the preludeDaniel Micay-1/+0
2013-06-14fixed code to placate new restrictions on form of function/method invocations.Felix S. Klock II-1/+1
2013-06-13Fix #3961 : use char range methods instead of byte offsets to detect whitespace.Felix S. Klock II-14/+23
2013-06-13Use @str instead of @~str in libsyntax and librustc. Fixes #5048.Huon Wilson-2/+2
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-10std: remove str::{connect,concat}*.Huon Wilson-1/+1
2013-06-10std: convert str::reserve* to methods, and methodise str::push_*.Huon Wilson-3/+3
2013-06-10std: remove str::{len, slice, is_empty} in favour of methods.Huon Wilson-2/+2
2013-06-08auto merge of #7004 : dotdash/rust/allocs, r=thestingerbors-4/+5
This removes some unnecessary allocations in the lexer, the typechecker and the metadata decoder. Reduces the time spent in the parsing and typechecking passes by about 10% for me.
2013-06-09remove unused import warningsHuon Wilson-1/+0
2013-06-09std: remove each_char* fns and methods from str, replaced by iterators.Huon Wilson-2/+3
2013-06-08Lexer: Fix offset handling in get_str_from()Björn Steinbrink-1/+1
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-08Lexer: Avoid unnecessary allocationsBjörn Steinbrink-4/+5
2013-06-05removed unused imports (and one unused argument)John Clements-1/+0
2013-06-05remove interner field from string_readerJohn Clements-3/+1
2013-06-05just use TLS internerJohn Clements-1/+2
2013-06-04librustc: Disallow multiple patterns from appearing in a "let" declaration.Patrick Walton-1/+2
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+4
2013-05-28Remove unnecessary allocations flagged by lintSeo Sanghyeon-3/+3
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+2
to libextra
2013-05-20Remove all unnecessary allocations (as flagged by lint)Alex Crichton-8/+8
2013-05-15Rename vec::len(var) to var.len()Youngmin Yoo-1/+1
2013-05-14syntax: Remove #[allow(vecs_implicitly_copyable)]Alex Crichton-1/+1
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-1/+1
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-11Warning policeTim Chevalier-6/+5
2013-04-28parser commentsJohn Clements-0/+2
2013-04-27only use #[no_core] in libcoreDaniel Micay-8/+0
2013-04-20syntax: remove unused 'mut' variablesAlex Crichton-1/+1
2013-04-19syntax: de-mode and prepare for de-modeing rustcAlex Crichton-1/+1
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-3/+3
2013-03-28Removing unused importsAlex Crichton-1/+1
2013-03-27derive Eq and Clone impls where applicableAndrew Paseltiner-10/+1
2013-03-26Switched over a bunch of splitting funktions to non-allocating iteratorsMarvin Löbel-2/+6
2013-03-22librustc: Remove `pure` from libsyntax and librustc.Patrick Walton-2/+2
2013-03-21Un-renamed trim and substr functions.Marvin Löbel-5/+5
2013-03-21Switched over substr and trim functions in str to be non-allocating, ↵Marvin Löbel-4/+7
temporary renamed them to better track use-sites
2013-03-21back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> ↵Marvin Löbel-5/+5
slice_unique
2013-03-21renamed str::view -> slice_DBG_BRWDMarvin Löbel-5/+5
renamed str::slice -> slice_DBG_UNIQ changed vec slice method -> to_owned() renamed vec view method -> slice_V_DBG_BRWD
2013-03-20syntax: Removing some bad copiesAlex Crichton-2/+2
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-3/+5
2013-03-11Remove uses of logBrian Anderson-2/+2
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-4/+4