Skip to content

Emit trivia as sibling tokens and don't generate a RuleKind for it #737

@Xanewok

Description

@Xanewok

As discussed f2f.

  • Remove LeadingTrivia and TrailingTrivia non-terminals.
  • Include the underlying trivia as siblings to the other rules/tokens in the parent directly.
  • Use FieldName::LeadingTrivia and FieldName::TrailingTrivia for the promoted siblings.
  • Remove fn is_trivia() for RuleKind, since it is impossible for any variant.
  • Implement fn is_trivia() correctly for TokenKind based on Item::Trivia, instead of returning false. (Fix parsing ambiguous call options #862)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions