Skip to content

Layout processor should use token IDs, not their String rendering #352

@andreasabel

Description

@andreasabel

The current layout preprocessor renders tokens as String to check whether they match layout keywords or { } ;. However, each keyword/symbol token comes with an ID that could be checked faster.

Steps to rewrite layout processor (generator) to use IDs instead of String:

  • LBNF: check whether { } ; occur in grammar when layout is used.
  • Give each symbol a name, like ( is LPAREN.
  • Define token constants in generated lexer for all the keywords and symbols.
  • Reference these constants in the layouter, rather than strings.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions