Skip to content

Fix scanning of division vs regex before line ending#246

Merged
aibaars merged 2 commits intotree-sitter:masterfrom
aibaars:div-vs-regex
Jan 4, 2024
Merged

Fix scanning of division vs regex before line ending#246
aibaars merged 2 commits intotree-sitter:masterfrom
aibaars:div-vs-regex

Conversation

@aibaars
Copy link
Copy Markdown
Contributor

@aibaars aibaars commented Jan 4, 2024

This should improve parsing of expressions with a division (/) operator before a line break. Previously the scanner treated those as the start of a regular expression literal (/..../).

For example:

foo /
5

Checklist:

  • All tests pass in CI.
  • There are sufficient tests for the new fix/feature.
  • Grammar rules have not been renamed unless absolutely necessary.
  • The conflicts section hasn't grown too much.
  • The parser size hasn't grown too much (check the value of STATE_COUNT in src/parser.c).

@aibaars aibaars merged commit 1ba5af1 into tree-sitter:master Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants