about summary refs log tree commit diff
path: root/src/libsyntax/parse/mod.rs
AgeCommit message (Collapse)AuthorLines
2014-01-02libsyntax: Fix test and merge fallout.Patrick Walton-1/+1
2014-01-02libsyntax: De-`@mut` `token` in the parserPatrick Walton-1/+1
2014-01-02libsyntax: De-`@mut` `quote_depth` in the parserPatrick Walton-1/+1
2014-01-02libsyntax: Make the parser mutablePatrick Walton-34/+19
2014-01-01syntax::diagnostic: Remove unnecessary traitsklutzy-3/+3
This removes trait `handler` and `span_handler`, and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2013-12-20rustc: Improve crate id extractionAlex Crichton-0/+24
Right now the --crate-id and related flags are all process *after* the entire crate is parsed. This is less than desirable when used with makefiles because it means that just to learn the output name of the crate you have to parse the entire crate (unnecessary). This commit changes the behavior to lift the handling of these flags much sooner in the compilation process. This allows us to not have to parse the entire crate and only have to worry about parsing the crate attributes themselves. The related methods have all been updated to take an array of attributes rather than a crate. Additionally, this ceases duplication of the "what output are we producing" logic in order to correctly handle things in the case of --test. Finally, this adds tests for all of this functionality to ensure that it does not regress.
2013-12-04Rename extra::json::*::init() constructors to *::new()Kevin Ballard-1/+1
2013-12-01auto merge of #10676 : eddyb/rust/ast-box-in-enums, r=cmrbors-10/+10
**Note**: I only tested on top of my #10670 PR, size reductions come from both change sets. With this, [more enums are shrinked](https://gist.github.com/eddyb/08fef0dfc6ff54e890bc), the most significant one being `ast_node`, from 104 bytes (master) to 96 (#10670) and now to 32 bytes. My own testcase requires **200MB** less when compiling (not including the other **200MB** gained in #10670), and rustc-stage2 is down by about **130MB**. I believe there is more to gain by fiddling with the enums' layouts.
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-10/+10
critical enum sizes.
2013-11-29extra: missed a couple `@` in jsonErick Tryzelaar-1/+1
2013-11-29extra: json::Encoder should take a &mut io::WriterErick Tryzelaar-3/+4
2013-11-29extra: Rename json constructors into *::initErick Tryzelaar-1/+1
2013-11-20auto merge of #10567 : sanxiyn/rust/bytepos, r=alexcrichtonbors-1/+1
2013-11-21Fix parsing testsSeo Sanghyeon-1/+1
2013-11-19libsyntax: Change all uses of `&fn` to `||`.Patrick Walton-13/+8
2013-11-11Move std::rt::io to std::ioAlex Crichton-5/+5
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-10/+10
2013-11-04libsyntax/librustc: Allow calling variadic foreign functions.Luqman Aden-1/+2
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-3/+2
This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-10/+6
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
2013-10-28Remove the extension traits for Readers/WritersAlex Crichton-1/+1
These methods are all excellent candidates for default methods, so there's no need to require extra imports of various traits.
2013-10-25libsyntax/librustc: Allow mut qualifier in patterns.Luqman Aden-3/+2
2013-10-24Remove io::read_errorAlex Crichton-3/+1
The general idea is to remove conditions completely from I/O, so in the meantime remove the read_error condition to mean the same thing as the io_error condition.
2013-10-24Remove even more of std::ioAlex Crichton-14/+38
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-3/+3
Who doesn't like a massive renaming?
2013-10-15path2: Replace the path module outrightKevin Ballard-1/+2
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-09-30syntax: Remove usage of fmt!Alex Crichton-3/+3
2013-09-29Remove all usage of @ast::CrateAlex Crichton-2/+2
2013-09-24added test case for tokenization of macro_rulesJohn Clements-0/+45
2013-09-24cleanupJohn Clements-9/+2
2013-09-23librustc: Remove the remaining direct uses of `@fn` from librustc.Patrick Walton-1/+1
2013-09-16Update syntax testCorey Richardson-1/+123
2013-09-16Fix hardcoded string in libsyntaxCorey Richardson-24/+2
2013-09-10Delay assignment of node ids until after expansion. Ensures that each AST nodeNiko Matsakis-32/+17
has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two representative tests. Fixes #7971 Fixes #6304 Fixes #8367 Fixes #8754 Fixes #8852 Fixes #2543 Fixes #7654
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-19/+19
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-8/+8
2013-08-30fix various warningsErick Tryzelaar-1/+1
2013-08-27librustc: Fix merge fallout.Patrick Walton-45/+3
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-2/+2
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-27librustc: Add support for type parameters in the middle of paths.Patrick Walton-78/+149
For example, `foo::<T>::bar::<U>`. This doesn't enforce that the type parameters are in the right positions, however.
2013-08-11libsyntax: Update from `@Object` to `@mut Object` as requiredNiko Matsakis-4/+4
2013-07-29New naming convention for ast::{node_id, local_crate, crate_node_id, ↵Michael Woerister-5/+5
blk_check_mode, ty_field, ty_method}
2013-07-25syntax: Fix #6416 by aborting on errors after test parse.Graydon Hoare-4/+2
2013-07-22Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.Michael Woerister-18/+18
`crate => Crate` `local => Local` `blk => Block` `crate_num => CrateNum` `crate_cfg => CrateConfig` Also, Crate and Local are not wrapped in spanned<T> anymore.
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-8/+6
2013-07-17librustc: Add a lint mode for unnecessary `copy` and remove a bunch of them.Patrick Walton-6/+2
2013-07-17Made ast::blk not use spanned<T> anymore.Michael Woerister-20/+19
2013-07-07auto merge of #7615 : Aatch/rust/syntax-deshare, r=graydonbors-15/+15
In an ideal world, the AST would be completely sendable, this gets us a step closer. It removes the local heap allocations for `view_item`, `Path`, `Lifetime` `trait_ref` `OptVec<TyParamBounds>` and `Ty`. There are also a few other smaller changes I made as things went along.
2013-07-07Fix broken testsJames Miller-5/+5