tree-sitter-javascript icon indicating copy to clipboard operation
tree-sitter-javascript copied to clipboard

Regexp Lookbehind does not parse

Open bennypowers opened this issue 2 years ago • 1 comments

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

/(?<=u)@/;

Here's a link to the TypeScript Playground showing that the snippet above is valid JavaScript or TypeScript:

https://www.typescriptlang.org/play?#code/PQCg-APAvArglAAWEA

The issue template asked me to run tree-sitter parse, but after 15 minutes of fiddling with it and googling i couldn't figure out how to install the js parser. Nonetheless, here's the output of neovim's :TSPlaygroundToggle

expression_statement [0, 0] - [0, 11]
  regex [0, 0] - [0, 10]
    pattern: regex_pattern [0, 1] - [0, 9]
      term [0, 1] - [0, 9]
        pattern_character [0, 1] - [0, 2]
        ERROR [0, 2] - [0, 8]
          pattern_character [0, 6] - [0, 7]
        pattern_character [0, 8] - [0, 9]
Screen Shot 2022-02-22 at 0 46 22

bennypowers avatar Feb 22 '22 05:02 bennypowers

See https://github.com/tree-sitter/tree-sitter-regex/issues/13

bennypowers avatar Mar 10 '22 23:03 bennypowers