about summary refs log tree commit diff
path: root/src/libsyntax/parse/mod.rs
AgeCommit message (Collapse)AuthorLines
2014-07-11Add scaffolding for assigning alpha-numeric codes to rustc diagnosticsJakub Wieczorek-1/+1
2014-07-09syntax: don't parse numeric literals in the lexerCorey Richardson-0/+109
This removes a bunch of token types. Tokens now store the original, unaltered numeric literal (that is still checked for correctness), which is parsed into an actual number later, as needed, when creating the AST. This can change how syntax extensions work, but otherwise poses no visible changes. [breaking-change]
2014-07-09syntax: don't process string/char/byte/binary litsCorey Richardson-0/+232
This shuffles things around a bit so that LIT_CHAR and co store an Ident which is the original, unaltered literal in the source. When creating the AST, unescape and postprocess them. This changes how syntax extensions can work, slightly, but otherwise poses no visible changes. To get a useful value out of one of these tokens, call `parse::{char_lit, byte_lit, bin_lit, str_lit}` [breaking-change]
2014-07-09syntax: doc comments all the thingsCorey Richardson-7/+6
2014-07-04Removed unnecessary method in testAdolfo Ochagavía-16/+2
2014-07-03Simplify PatIdent to contain an Ident rather than a PathJohn Clements-35/+18
Rationale: for what appear to be historical reasons only, the PatIdent contains a Path rather than an Ident. This means that there are many places in the code where an ident is artificially promoted to a path, and---much more problematically--- a bunch of elements from a path are simply thrown away, which seems like an invitation to some really nasty bugs. This commit replaces the Path in a PatIdent with a SpannedIdent, which just contains an ident and a span.
2014-06-18Handle CRLF properly in the lexerKevin Ballard-0/+22
The lexer already ignores CRLF in between tokens, but it doesn't properly handle carriage returns inside strings and doc comments. Teach it to treat CRLF as LF inside these tokens, and to disallow carriage returns that are not followed by linefeeds. This includes handling an escaped CRLF inside a regular string token the same way it handles an escaped LF. This is technically a breaking change, as bare carriage returns are no longer allowed, and CRLF sequences are now treated as LF inside strings and doc comments, but it's very unlikely to actually affect any real-world code. This change is necessary to have Rust code compile on Windows the same way it does on Unix. The mozilla/rust repository explicitly sets eol=lf for Rust source files, but other Rust repositories don't. Notably, rust-http cannot be compiled on Windows without converting the CRLF line endings back to LF. [breaking-change]
2014-06-18Remove TraitStore from ty_traitNick Cameron-2/+6
Use ty_rptr/ty_uniq(ty_trait) rather than TraitStore to represent trait types. Also addresses (but doesn't close) #12470. Part of the work towards DST (#12938). [breaking-change] lifetime parameters in `&mut trait` are now invariant. They used to be contravariant.
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-0/+1
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-06-13syntax: parse outer attributes in `quote_item!` calls.Huon Wilson-2/+1
Fixes #14857.
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-17/+18
2014-06-04syntax: methodify the lexerCorey Richardson-2/+1
2014-05-30libsyntax: Fix snake_case errors.Kevin Butler-3/+3
A number of functions/methods have been moved or renamed to align better with rust standard conventions. syntax::ext::mtwt::xorPush => xor_push syntax::parse::parser::Parser => Parser::new [breaking-change]
2014-05-27std: Rename strbuf operations to stringRicho Healey-16/+16
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-20/+20
[breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-2/+6
2014-05-17syntax: Tighten search paths for inner modulesAlex Crichton-1/+6
This is an implementation of RFC 16. A module can now only be loaded if the module declaring `mod name;` "owns" the current directory. A module is considered as owning its directory if it meets one of the following criteria: * It is the top-level crate file * It is a `mod.rs` file * It was loaded via `#[path]` * It was loaded via `include!` * The module was declared via an inline `mod foo { ... }` statement For example, this directory structure is now invalid // lib.rs mod foo; // foo.rs mod bar; // bar.rs; fn bar() {} With this change `foo.rs` must be renamed to `foo/mod.rs`, and `bar.rs` must be renamed to `foo/bar.rs`. This makes it clear that `bar` is a submodule of `foo`, and can only be accessed through `foo`. RFC: 0016-module-file-system-hierarchy Closes #14180 [breaking-change]
2014-05-15Add compiler flag to configure output coloringHanno Braun-2/+2
This adds the flag --color, which allows the user to force coloring or turn it off. The default behavior stays the same as before (colorize, if output goes to tty). Why this is beneficial is explained in issue #12881. Please note that this commit doesn't include any regression tests. I thought about how I'd write a test for this and it doesn't seem to be worth the effort to me for a UI change like this. Fixes #12881.
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-35/+35
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-2/+2
2014-04-27Fix repeated module documentationAlexandre Gagnon-5/+0
2014-04-21auto merge of #13435 : edwardw/rust/span, r=brsonbors-1/+1
When reporting "consider removing this semicolon" hint message, the offending semicolon may come from macro call site instead of macro itself. Using the more appropriate span makes the hint more helpful. Closes #13428.
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-15/+15
2014-04-18Use more precise span when reporting semicolon hintEdward Wang-1/+1
When reporting "consider removing this semicolon" hint message, the offending semicolon may come from macro call site instead of macro itself. Using the more appropriate span makes the hint more helpful. Closes #13428.
2014-04-10Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and ↵Kasey Carrothers-1/+1
updated associated variable and function names.
2014-04-06De-~[] Reader and WriterSteven Fackler-3/+4
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
2014-04-03syntax: Remove AbiSet, use one AbiAlex Crichton-1/+1
This change removes the AbiSet from the AST, converting all usage to have just one Abi value. The current scheme selects a relevant ABI given a list of ABIs based on the target architecture and how relevant each ABI is to that architecture. Instead of this mildly complicated scheme, only one ABI will be allowed in abi strings, and pseudo-abis will be created for special cases as necessary. For example the "system" abi exists for stdcall on win32 and C on win64. Closes #10049
2014-03-31syntax: Switch field privacy as necessaryAlex Crichton-1/+1
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