about summary refs log tree commit diff
path: root/src/libsyntax/parse/attr.rs
AgeCommit message (Collapse)AuthorLines
2019-10-16move parse::attr -> parse::parser::attrMazdak Farrokhzad-330/+0
2019-10-14Remove the `Option` in `TokenStream`.Nicholas Nethercote-1/+1
It means an allocation is required to create an empty `TokenStream`, but all other operations are simpler and marginally faster due to not having to check for `None`. Overall it simplifies the code for a negligible performance effect. The commit also removes `TokenStream::empty` by implementing `Default`, which is now possible.
2019-10-01Address review commentsVadim Petrochenkov-2/+2
2019-09-30syntax: Support modern attribute syntax in the `meta` matcherVadim Petrochenkov-13/+18
2019-09-30syntax: Split `ast::Attribute` into container and inner partsVadim Petrochenkov-2/+1
2019-09-26Rename `MetaItem.node` to `MetaItem.kind`varkor-3/+3
2019-09-26Rename `Lit.node` to `Lit.kind`varkor-1/+1
2019-09-23Auto merge of #64272 - Mark-Simulacrum:parallel-handler, r=estebankbors-2/+2
Refactor librustc_errors::Handler API This should be reviewed by-commit. The last commit moves all fields into an inner struct behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
2019-09-17Remove Handler::cancelMark Rousskov-2/+2
2019-09-11Stabilize `param_attrs` in Rust 1.39.0Caio-7/+0
2019-09-07Aggregation of cosmetic changes made during work on REPL PRs: libsyntaxAlexander Regueiro-19/+19
2019-09-06Move injection of attributes from command line to `libsyntax_ext`Vadim Petrochenkov-1/+1
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-1/+1
2019-08-20Use dedicated type for spans in pre-expansion gating.Mazdak Farrokhzad-3/+2
2019-07-31Remove AttrId from Attribute constructorsMark Rousskov-2/+2
2019-07-27Treat doc comments separatelyEvgenii P-8/+20
2019-07-27Make more informative error on outer attr after innerEvgenii P-15/+32
2019-07-16normalize use of backticks in compiler messages for libsyntax/parseSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-06-09Allow attributes in formal function parametersCaio-1/+10
2019-06-07parser: `self.span` -> `self.token.span`Vadim Petrochenkov-6/+6
2019-06-06syntax: Switch function parameter order in `TokenTree::token`Vadim Petrochenkov-1/+1
2019-06-06syntax: Use `Token` in `Parser`Vadim Petrochenkov-6/+6
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-1/+1
2019-03-29Use `SmallVec` in `TokenStreamBuilder`.Nicholas Nethercote-1/+2
This reduces by 12% the number of allocations done for a "clean incremental" of `webrender_api`, which reduces the instruction count by about 0.5%. It also reduces instruction counts by up to 1.4% across a range of rustc-perf benchmark runs.
2019-03-16Fix rebaseVadim Petrochenkov-2/+0
2019-03-16Refactor away `NestedMetaItemKind`Vadim Petrochenkov-3/+2
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16Rename `MetaItem::ident` to `MetaItem::path`Vadim Petrochenkov-3/+3
2019-03-06Surround found token with `Esteban Küber-1/+1
2019-03-05On incorrect cfg literal/identifier, point at the right spanEsteban Küber-1/+1
2019-02-25Restrict value in key-value attributes to literalsVadim Petrochenkov-4/+14
2019-02-18Remove `LazyTokenStream`.Nicholas Nethercote-2/+2
It's present within `Token::Interpolated` as an optimization, so that if a nonterminal is converted to a `TokenStream` multiple times, the first-computed value is saved and reused. But in practice it's not needed. `interpolated_to_tokenstream()` is a cold function: it's only called a few dozen times while compiling rustc itself, and a few hundred times across the entire `rustc-perf` suite. Furthermore, when it is called, it is almost always the first conversion, so no benefit is gained from it. So this commit removes `LazyTokenStream`, along with the now-unnecessary `Token::interpolated()`. As well as a significant simplification, the removal speeds things up slightly, mostly due to not having to `drop` the `LazyTokenStream` instances.
2019-02-07libsyntax => 2018Taiki Endo-8/+10
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-12Rename `TokenStream::concat` and remove `TokenStream::concat_rc_vec`.Nicholas Nethercote-1/+1
`TokenStream::new` is a better name for the former, and the latter is now just equivalent to `TokenStream::Stream`.
2018-12-04cleanup: remove static lifetimes from constsljedrz-2/+2
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-15syntax: Enforce attribute grammar in the parserVadim Petrochenkov-5/+29
2018-07-14Remove most of `PartialEq` impls from AST and HIR structuresVadim Petrochenkov-2/+2
2018-06-09Crate-ify and delete unused code in syntax::parseMark Simulacrum-6/+5
2018-05-02make it compile againflip1995-3/+3
2018-05-02Allow Path for name of MetaItemSeiichi Uchida-3/+4
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-3/+2
2018-04-06Remove more duplicated spansVadim Petrochenkov-1/+1
2018-03-17improve attribute trailing semicolon errorcsmoe-10/+1
2017-10-30edit and fix bad spacing of inner-attribute-not-allowed noteZack M. Davis-5/+4
This multiline string literal was missing a backslash, leaving an awkward newline and 35 spaces in the middle of the message. But while we're here, the existing message seems kind of long in comparison to similar notes: to cut it down, we excise the mentions of doc comments, which seems sensible because we know that this erroneous attribute is not a doc comment (notice the `is_sugared_doc: false` at the end of the function; if it had been a doc comment, that error would get set in the `token::DocComment` match branch of `parse_outer_attributes`).
2017-08-18Auto merge of #43904 - topecongiro:libsyntax/parse-attr, r=petrochenkovbors-6/+4
Eat open paren when parsing list in libsyntax/parse/attr.rs This PR adds a small refactoring: ```diff pub fn parse_meta_item_kind(&mut self) -> PResult<'a, ast::MetaItemKind> { Ok(if self.eat(&token::Eq) { ast::MetaItemKind::NameValue(self.parse_unsuffixed_lit()?) - } else if self.token == token::OpenDelim(token::Paren) { + } else if self.eat(&token::OpenDelim(token::Paren)) { ast::MetaItemKind::List(self.parse_meta_seq()?) } else { - self.eat(&token::OpenDelim(token::Paren)); ast::MetaItemKind::Word }) } ``` in `parse_meta_item_kind()`, the parser calls `self.eat(&token::OpenDelim(token::Paren));` before returning `ast::MetaItemKind::Word` just to add `(` to expected token. It seems more natural to eat the paren when parsing `ast::MetaItemKind::List`.
2017-08-16Eat open paren when parsing listSeiichi Uchida-6/+4
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-4/+4
Like #43008 (f668999), but _much more aggressive_.
2017-06-26Add `LazyTokenStream`.Jeffrey Seyfried-2/+2
2017-05-12Fix some clippy warnings in libsyntaxAndre Bogus-2/+2
This is mostly removing stray ampersands, needless returns and lifetimes.