tree-sitter / tree-sitter-ruby

Ruby grammar for tree-sitter
MIT License
176 stars 58 forks source link

Error: Binding arguments in strict mode #228

Closed drwpow closed 1 year ago

drwpow commented 2 years ago

Error

grammar.js has this line:

      const arguments = field('arguments', alias($.command_argument_list, $.argument_list))

Most JS parsers throw the following error because arguments is a reserved word:

Error: Binding arguments in strict mode

Screenshot

Screen Shot 2022-09-05 at 14 27 11

Reproduction

  1. Go to astexplorer.net
  2. Paste in grammar.js. acorn, @babel/parser, and meriyah (module mode) will show the errors.

Expected

This file should be valid JS. Simply renaming arguments solves the error.