Commits
Click on a commit to change the comparison rangerefactor(parser): add `StatementContext::TopLevelStatementList` (#12806)
Pure refactor. Allow parser functions to determine whether in top level context or not, by adding `TopLevelStatementList` variant to `StatementContext`.
Also, re-order the variants to make `StatementContext::is_single_statement` as cheap as possible - with `StatementList` and `TopLevelStatementList` as first 2 variants, `is_single_statement` boils down to `self as u8 < 2`.
This new variant is used in the next PR in this stack.3 months ago
by overlookmotel