summary refs log tree commit diff
path: root/src/libsyntax/parse/mod.rs
AgeCommit message (Collapse)AuthorLines
2014-03-29auto merge of #13188 : FlaPer87/rust/master, r=alexcrichtonbors-10/+0
2014-03-29Register new snapshotFlavio Percoco-10/+0
2014-03-28De-@ TokenTree.Eduard Burtescu-3/+3
2014-03-27serialize: use ResultSean McArthur-1/+10
All of Decoder and Encoder's methods now return a Result. Encodable.encode() and Decodable.decode() return a Result as well. fixes #12292
2014-03-22Migrate all users of opt_vec to owned_slice, delete opt_vec.Huon Wilson-11/+11
syntax::opt_vec is now entirely unused, and so can go.
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-2/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-2/+2
Closes #12771
2014-03-17Fix rustdoc and tests.Eduard Burtescu-1/+2
2014-03-17De-@ codemap and diagnostic.Eduard Burtescu-38/+28
2014-03-17De-@ ParseSess uses.Eduard Burtescu-39/+39
2014-03-12Changed lists of lifetimes in ast and ty to use Vec instead of OptVec.Felix S. Klock II-7/+7
There is a broader revision (that does this across the board) pending in #12675, but that is awaiting the arrival of more data (to decide whether to keep OptVec alive by using a non-Vec internally). For this code, the representation of lifetime lists needs to be the same in both ScopeChain and in the ast and ty structures. So it seemed cleanest to just use `vec_ng::Vec`, now that it has a cheaper empty representation than the current `vec` code.
2014-03-12alpha-rename .ident to .name in Lifetime, including in rustdoc.Felix S. Klock II-3/+3
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-4/+7
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-33/+33
2014-03-01auto merge of #12627 : alexcrichton/rust/issue-12623, r=brsonbors-2/+2
This helps prevent the unfortunate interleavings found in #12623.
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-6/+6
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-28syntax: Refactor diagnostics to focus on WritersAlex Crichton-2/+2
This commit alters the diagnostic emission machinery to be focused around a Writer for emitting errors. This allows it to not hard-code emission of errors to stderr (useful for other applications).
2014-02-24Move extra::json to libserializeAlex Crichton-3/+1
This also inverts the dependency between libserialize and libcollections. cc #8784
2014-02-20move extra::test to libtestLiigo Zhuang-3/+4
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-25/+33
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-07Removed @self and @Trait.Eduard Burtescu-5/+5
2014-02-06auto merge of #12048 : sanxiyn/rust/crate-config, r=alexcrichtonbors-3/+3
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-1/+1
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-02-06Avoid cloning ast::CrateConfigSeo Sanghyeon-3/+3
2014-02-03syntax: Remove io_error usageAlex Crichton-3/+2
2014-02-02libsyntax: Fix tests.Patrick Walton-12/+12
2014-02-02libsyntax: De-`@str` pathnamesPatrick Walton-16/+12
2014-02-02librustc: Stop using `@str` for source.Patrick Walton-47/+41
2014-01-23Redo exported macro serializationSteven Fackler-1/+1
The old method of serializing the AST gives totally bogus spans if the expansion of an imported macro causes compilation errors. The best solution seems to be to serialize the actual textual macro definition and load it the same way the std-macros are. I'm not totally confident that getting the source from the CodeMap will always do the right thing, but it seems to work in simple cases.
2014-01-21[std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old ↵Simon Sapin-2/+2
from_utf8_owned() behavior
2014-01-17auto merge of #11598 : alexcrichton/rust/io-export, r=brsonbors-1/+1
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered private modules * Remove with_mem_writer * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered) cc #11119
2014-01-17Tweak the interface of std::ioAlex Crichton-1/+1
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered private modules * Remove with_mem_writer * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered)
2014-01-17rustc::driver: Capitalize structs and enumsklutzy-1/+1
driver::session::crate_metadata is unused; removed.
2014-01-15libsyntax: Remove the obsolete ability to parse from substrings.Patrick Walton-40/+1
This was used by the quasiquoter.
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-47/+46
2014-01-08Remove the io::Decorator traitAlex Crichton-2/+1
This is just an unnecessary trait that no one's ever going to parameterize over and it's more useful to just define the methods directly on the types themselves. The implementors of this type almost always don't want inner_mut_ref() but they're forced to define it as well.
2014-01-03librustc: De-`@mut` the span handlerPatrick Walton-3/+3
2014-01-03libsyntax: De-`@mut` `StringReader`, `TtReader`, and `reader`Patrick Walton-2/+2
2014-01-03librustc: De-`@mut` the parse sessionPatrick Walton-25/+25
2014-01-03libsyntax: De-`@mut` `ParseSess::included_mod_stack`Patrick Walton-3/+4
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