Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Conversation

@ANAVHEOBA
Copy link

Summary

  • Fix Indent token handling by adding it to LHS_KINDS
  • Remove erroneous Newline expectation from global_binding (Newline is trivia)
  • Enable 3 previously commented-out/broken tests

Changes

  • expr.rs: Add SyntaxKind::Indent to LHS_KINDS, fix test_parse_indented_continuation
  • decl.rs: Remove p.expect(Newline) since it's handled as trivia
  • grammar.rs: Enable test_parse_multiple_declarations
  • expr.rs: Enable test_parse_binary_expression_interspersed_with_comments

Test plan

  • All 51 tests pass
  • Indented expressions correctly wrapped in Exp_Indented nodes

Closes #8

- Add SyntaxKind::Indent to LHS_KINDS so indented expressions are
  properly parsed instead of being treated as errors
- Convert test() to test_parse_indented_continuation with proper
  expect assertions for whitespace-sensitive parsing
- Remove erroneous p.expect(Newline) from global_binding since Newline
  is treated as trivia and automatically attached to expressions
- Uncomment and enable test_parse_multiple_declarations test
Enable and update the test for parsing binary expressions with
interspersed comments and nested indentation. The expected output
reflects the correct handling of Exp_Indented nodes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revise parser tests to acknowledge whitespace sensitivity

2 participants