Skip to content

Layout rule for new syntax #70

Open
@adamchristiansen

Description

@adamchristiansen

The layout rule for indentation must be implemented in the lexer with the new syntax of #69.

  • After a do, match, or when, emit a { if one is not present and push the indentation of the next token on to the stack.
  • If a line starts at the same indentation as the top of the indentation stack and the previous token was not a ;, then emit a ;.
  • If a line starts at a smaller indentation than the top of the indentation stack then pop indentations off the stack until the current indentation is seen, and emit one } for each pop minus the number of } that were seen.
  • If a line starts at a greater indentation than the top of the stack then do nothing.

Metadata

Metadata

Labels

No labels
No labels

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions