tree-sitter / tree-sitter-javascript

Javascript grammar for tree-sitter
MIT License
314 stars 108 forks source link

Fail to parse a comment immediately after regex #297

Closed mingodad closed 3 months ago

mingodad commented 3 months ago

The following piece of code is valid but it is parsed incorrectly:

var nameStartChar = /a///comment

It's accepted on the browser and node, but fails on the playground:

[program](https://tree-sitter.github.io/tree-sitter/playground#) [0, 0] - [1, 0]
  [ERROR](https://tree-sitter.github.io/tree-sitter/playground#) [0, 0] - [0, 22]
    [identifier](https://tree-sitter.github.io/tree-sitter/playground#) [0, 4] - [0, 17]
    [regex_pattern](https://tree-sitter.github.io/tree-sitter/playground#) [0, 21] - [0, 22]
  [comment](https://tree-sitter.github.io/tree-sitter/playground#) [0, 22] - [0, 32]