| commit | 0ee885cc2995e3536a5c54d8398a3569fd23f312 | [log] [tgz] |
|---|---|---|
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | Fri Jun 11 16:27:56 2021 +0000 |
| committer | GitHub <noreply@github.com> | Fri Jun 11 16:27:56 2021 +0000 |
| tree | a7b11a94088c566adc666d9ab1f3d49265277109 | |
| parent | 9f24a2453da6ac4646b97e5629b722add80a1772 [diff] | |
| parent | b344c9a41be74bc3ba6e641bad76690c951e9692 [diff] |
Merge #33
33: Add a `Meta` node representing attribute contents r=jonas-schievink a=jonas-schievink
The main motivation of this change is to make attribute handling easier: `#[cfg_attr]` can expand to an arbitrary nested list of attributes, and we currently just format those with `#[{}]` and parse that, which loses the assigned `TokenId`s. The `TokenId`s will be needed later to uniquely identify attributes that come from `cfg_attr`.
With this change, we can instead use `mbe::token_tree_to_syntax_node` to parse the tokens into a `FragmentKind::MetaItem`, which returns a `ast::Meta` node, and process that.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
A DSL for specifying concrete syntax trees. See this introductory post.
See ./rust.ungram for an example.