about summary refs log tree commit diff
path: root/src/libsyntax/parse/mod.rs
AgeCommit message (Collapse)AuthorLines
2015-11-13Auto merge of #29761 - eefriedman:rename-nopanic, r=sanxiynbors-4/+4
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-10Rename _nopanic methods to remove the suffix.Eli Friedman-4/+4
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-10Use deref coercionsSeo Sanghyeon-5/+5
2015-11-06remove `Tt` prefix from TokenType variantsOliver Schneider-21/+21
[breaking change]
2015-10-27Update libsyntax tests.Eli Friedman-2/+2
2015-10-27Make fatal errors more consistent.Eli Friedman-1/+1
2015-10-27Don't panic for fatal errors in attribute parsing.Eli Friedman-3/+4
2015-10-27Delete unnecessary ParserAttr trait.Eli Friedman-1/+0
2015-10-27Don't use panicking helpers in Parser.Eli Friedman-4/+4
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-4/+4
Make sure Name, SyntaxContext and Ident are passed by value Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-09-20Replace `ast::Mac_` enum with structAndrew Paseltiner-4/+1
Closes #28527.
2015-09-03Use consistent terminology for byte string literalsVadim Petrochenkov-2/+2
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-07-29Replace illegal with invalid in most diagnosticsSimonas Kazlauskas-7/+7
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-17/+22
2015-07-21Use a span from the correct file for the inner span of a moduleNick Cameron-2/+9
This basically only affects modules which are empty (or only contain comments). Closes #26755
2015-05-22Two more small fixes.Niko Matsakis-0/+1
2015-05-14syntax: abstract over the file loading mechanism.Eduard Burtescu-10/+10
2015-05-14syntax::parse: optimize file_to_filemap to read a string directly.Eduard Burtescu-21/+7
2015-05-14syntax: replace sess.span_diagnostic.cm with sess.codemap().Eduard Burtescu-11/+7
2015-05-14syntax: refactor (Span)Handler and ParseSess constructors to be methods.Eduard Burtescu-13/+13
2015-05-14Move tracking of the next NodeId from syntax's ParseSess to rustc's Session.Eduard Burtescu-20/+1
2015-04-25Interpolate AST nodes in quasiquote.Geoffry Song-72/+0
This changes the `ToTokens` implementations for expressions, statements, etc. with almost-trivial ones that produce `Interpolated(*Nt(...))` pseudo-tokens. In this way, quasiquote now works the same way as macros do: already-parsed AST fragments are used as-is, not reparsed. The `ToSource` trait is removed. Quasiquote no longer involves pretty-printing at all, which removes the need for the `encode_with_hygiene` hack. All associated machinery is removed. A new `Nonterminal` is added, NtArm, which the parser now interpolates. This is just for quasiquote, not macros (although it could be in the future). `ToTokens` is no longer implemented for `Arg` (although this could be added again) and `Generics` (which I don't think makes sense). This breaks any compiler extensions that relied on the ability of `ToTokens` to turn AST fragments back into inspectable token trees. For this reason, this closes #16987. As such, this is a [breaking-change]. Fixes #16472. Fixes #15962. Fixes #17397. Fixes #16617.
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-2/+0
Conflicts: src/libcore/result.rs
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-2/+0
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-21syntax: Copy unstable str::char_at into libsyntaxErick Tryzelaar-4/+4
2015-04-21syntax: Remove uses of #[feature(slice_patterns)]Erick Tryzelaar-15/+31
2015-04-21syntax: remove #![feature(box_syntax, box_patterns)]Erick Tryzelaar-3/+3
2015-04-15Forbid is/us suffixes. Fixes #22496Brian Anderson-2/+0
It was an oversight that this was not done in the great int upheaval. [breaking-change]
2015-04-05Work towards a non-panicing parser (libsyntax)Phil Dawes-10/+13
- Functions in parser.rs return PResult<> rather than panicing - Other functions in libsyntax call panic! explicitly for now if they rely on panicing behaviour. - 'panictry!' macro added as scaffolding while converting panicing functions. (This does the same as 'unwrap()' but is easier to grep for and turn into try!()) - Leaves panicing wrappers for the following functions so that the quote_* macros behave the same: - parse_expr, parse_item, parse_pat, parse_arm, parse_ty, parse_stmt
2015-03-31rollup merge of #23872: huonw/eager-lexingAlex Crichton-1/+14
Conflicts: src/libsyntax/parse/lexer/mod.rs
2015-03-31Stabilize std::numAaron Turon-5/+6
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]
2015-03-31Lex binary and octal literals more eagerly.Huon Wilson-1/+14
Previously 0b12 was considered two tokens, 0b1 and 2, as 2 isn't a valid base 2 digit. This patch changes that to collapse them into one (and makes `0b12` etc. an error: 2 isn't a valid base 2 digit). This may break some macro invocations of macros with `tt` (or syntax extensions) that rely on adjacent digits being separate tokens and hence is a [breaking-change] The fix is to separate the tokens, e.g. `0b12` -> `0b1 2`. cc https://github.com/rust-lang/rfcs/pull/879
2015-03-25rustc: Remove support for int/uintAlex Crichton-4/+4
This commit removes all parsing, resolve, and compiler support for the old and long-deprecated int/uint types.
2015-03-24rustc: Add support for `extern crate foo as bar`Alex Crichton-1/+1
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc #23533
2015-03-18Require braces when a closure has an explicit return type. This is aNiko Matsakis-2/+3
[breaking-change]: instead of a closure like `|| -> i32 22`, prefer `|| -> i32 { 22 }`. Fixes #23420.
2015-03-16Auto merge of #23331 - eddyb:attr-lookahead, r=nikomatsakisbors-9/+5
Most of the changes are cleanup facilitated by straight-forward attribute handling. This is a minor [breaking-change] for users of `quote_stmt!` (returns `Option<P<Stmt>>` now) and some of the public methods in `Parser` (a few `Vec<Attribute>` arguments/returns were removed). r? @nikomatsakis
2015-03-13rm unused importManish Goregaokar-1/+0
2015-03-13syntax: use lookahead to distinguish inner and outer attributes, instead of ↵Eduard Burtescu-9/+5
passing the latter around.
2015-03-09Rename #[should_fail] to #[should_panic]Steven Fackler-1/+1
2015-03-05Rollup merge of #22764 - ivanradanov:fileline_help, r=huonwManish Goregaokar-1/+1
When warnings and errors occur, the associated help message should not print the same code snippet. https://github.com/rust-lang/rust/issues/21938
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-13/+15
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-03-04Encode codemap and span information in crate metadata.Michael Woerister-110/+44
This allows to create proper debuginfo line information for items inlined from other crates (e.g. instantiations of generics). Only the codemap's 'metadata' is stored in a crate's metadata. That is, just filename, line-beginnings, etc. but not the actual source code itself. We are thus missing the opportunity of making Rust the first "open-source-only" programming language out there. Pity.
2015-03-03Change span_help calls to fileline_help where appropriateIvan Radanov Ivanov-1/+1
2015-02-24Implement `<T>::method` UFCS expression syntax.Eduard Burtescu-6/+6
2015-02-24syntax: don't store a secondary NodeId for TyPath.Eduard Burtescu-1/+1
2015-02-22Fix errors from #22592Manish Goregaokar-4/+4
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-6/+6
where possible.
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-12/+12
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-12/+12