about summary refs log tree commit diff
path: root/src/libsyntax/parse/attr.rs
AgeCommit message (Collapse)AuthorLines
2017-03-29Refactor how spans are combined in the parser.Jeffrey Seyfried-17/+12
2017-03-14Liberalize attributes.Jeffrey Seyfried-7/+25
2017-03-14Refactor `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`.Jeffrey Seyfried-5/+11
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-8/+3
places.
2016-11-20Refactor `P<ast::MetaItem>` -> `ast::MetaItem`.Jeffrey Seyfried-3/+2
2016-11-20Move `MetaItemKind`'s `Name` to a field of `MetaItem`.Jeffrey Seyfried-17/+9
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-4/+3
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-11/+9
2016-11-03Reduce the size of `Token` and make it cheaper to clone by refactoringJeffrey Seyfried-1/+4
`Token::Interpolated(Nonterminal)` -> `Token::Interpolated(Rc<Nonterminal>)`.
2016-10-05Rename Parser::last_span as prev_span.Nicholas Nethercote-6/+6
This is a [breaking-change] for libsyntax.
2016-09-16fix top level attr spansMikhail Modin-1/+1
2016-09-10fix span for errors E0537, E0535 & E0536Mikhail Modin-5/+5
2016-08-25Implement RFC#1559: allow all literals in attributes.Sergio Benitez-16/+48
2016-07-15syntax: Better error message for inner attr following doc commentAravind Gollakota-14/+56
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-6/+3
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-1/+2
2016-05-03parser: show a helpful note on unexpected inner commentGeorg Brandl-1/+4
Fixes: #30318.
2016-05-02replace fileline_{help,note} with {help,note}Niko Matsakis-3/+2
The extra filename and line was mainly there to keep the indentation relative to the main snippet; now that this doesn't include filename/line-number as a prefix, it is distracted.
2016-03-22try! -> ?Jorge Aparicio-8/+8
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-02-22Use associated functions for libsyntax SepSeq constructors.Corey Farwell-2/+2
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-3/+3
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-1/+1
2016-01-27rustfmt syntax::parseTshepang Lekhonkhobe-34/+34
2015-12-31Cut out a bunch of Result and panictry! boilerplate from libsyntax.Nick Cameron-7/+7
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2015-12-30use structured errorsNick Cameron-11/+13
2015-10-28Make quote plugin use parsing functions which explicitly panic.Eli Friedman-1/+1
Rename parse_* to parse_*_panic, and add parse_attribute_panic.
2015-10-27Don't panic for fatal errors in attribute parsing.Eli Friedman-34/+35
2015-10-27Delete unnecessary ParserAttr trait.Eli Friedman-21/+4
2015-10-01Stop re-exporting AttrStyle's variants and rename them.Ms2ger-6/+6
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-4/+3
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-04-05Work towards a non-panicing parser (libsyntax)Phil Dawes-15/+15
- 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-13syntax: use lookahead to distinguish inner and outer attributes, instead of ↵Eduard Burtescu-32/+26
passing the latter around.
2015-03-03Change span_help calls to fileline_help where appropriateIvan Radanov Ivanov-1/+1
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-1/+1
where possible.
2015-02-02Tweak some ‘expected…’ error messagesP1start-3/+6
Fixes #21153.
2015-01-07use slicing sugarJorge Aparicio-1/+1
2015-01-06rollup merge of #20481: seanmonstar/fmt-show-stringAlex Crichton-2/+2
Conflicts: src/compiletest/runtest.rs src/libcore/fmt/mod.rs src/libfmt_macros/lib.rs src/libregex/parse.rs src/librustc/middle/cfg/construct.rs src/librustc/middle/dataflow.rs src/librustc/middle/infer/higher_ranked/mod.rs src/librustc/middle/ty.rs src/librustc_back/archive.rs src/librustc_borrowck/borrowck/fragments.rs src/librustc_borrowck/borrowck/gather_loans/mod.rs src/librustc_resolve/lib.rs src/librustc_trans/back/link.rs src/librustc_trans/save/mod.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/callee.rs src/librustc_trans/trans/common.rs src/librustc_trans/trans/consts.rs src/librustc_trans/trans/controlflow.rs src/librustc_trans/trans/debuginfo.rs src/librustc_trans/trans/expr.rs src/librustc_trans/trans/monomorphize.rs src/librustc_typeck/astconv.rs src/librustc_typeck/check/method/mod.rs src/librustc_typeck/check/mod.rs src/librustc_typeck/check/regionck.rs src/librustc_typeck/collect.rs src/libsyntax/ext/format.rs src/libsyntax/ext/source_util.rs src/libsyntax/ext/tt/transcribe.rs src/libsyntax/parse/mod.rs src/libsyntax/parse/token.rs src/test/run-pass/issue-8898.rs
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-2/+2
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-07Replace full slice notation with index callsNick Cameron-1/+1
2014-12-21Fallout of std::str stabilizationAlex Crichton-2/+1
2014-12-05rollup merge of #19413: P1start/more-trailing-commasCorey Richardson-1/+1
The only other place I know of that doesn’t allow trailing commas is closure types (#19414), and those are a bit tricky to fix (I suspect it might be impossible without infinite lookahead) so I didn’t implement that in this patch. There are other issues surrounding closure type parsing anyway, in particular #19410.
2014-11-30Allow trailing commas in array patterns and attributesP1start-1/+1
2014-11-30Adjust some error messages to start with a lowercase letter and not finish ↵P1start-1/+1
with a full stop
2014-11-11syntax: improve message for misused inner attributesLiigo Zhuang-0/+2
2014-10-30Use common variants for open and close delimitersBrendan Zabarauskas-6/+6
This common representation for delimeters should make pattern matching easier. Having a separate `token::DelimToken` enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in `ast::TtDelimited`, removing the need to ensure matched delimiters when working with token trees.
2014-10-28Use PascalCase for token variantsBrendan Zabarauskas-17/+16
2014-10-16libsyntax: Remove all uses of {:?}.Luqman Aden-1/+1
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-15/+21
2014-08-24Adjust the error messages to match the pattern "expected foo, found bar"Jonas Hietala-1/+1
Closes #8492
2014-07-11Fix spans for attributesSteven Fackler-1/+1
They used to be one token too long, so you'd see things like ``` rust/rust/test.rs:1:1: 2:2 warning: unused attribute, rust/rust/test.rs:1 #![foo] rust/rust/test.rs:2 #![bar] ``` instead of ``` test.rs:1:1: 1:8 warning: unused attribute, #[warn(unused_attribute)] on by default test.rs:1 #![foo] ^~~~~~~ ```