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>
tree: a7b11a94088c566adc666d9ab1f3d49265277109
  1. .github/
  2. src/
  3. ungrammar2json/
  4. .gitignore
  5. bors.toml
  6. Cargo.toml
  7. README.md
  8. rust.ungram
  9. ungrammar.ungram
README.md

ungrammar

A DSL for specifying concrete syntax trees. See this introductory post.

See ./rust.ungram for an example.