parent
3739b7794e
commit
0113bd28a4
2 changed files with 17 additions and 4 deletions
|
|
@ -2,11 +2,12 @@
|
|||
Method calls
|
||||
======================================
|
||||
|
||||
a.b(c(d.e));
|
||||
*a.b(c(d.e));
|
||||
|
||||
---
|
||||
|
||||
(statement
|
||||
(star_aliased)
|
||||
(call_expression
|
||||
(member_expression
|
||||
(variable_name)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
module.exports = grammar({
|
||||
name: 'aliased_rules',
|
||||
|
||||
extras: $ => [/\s/],
|
||||
extras: $ => [
|
||||
/\s/,
|
||||
$.star,
|
||||
],
|
||||
|
||||
rules: {
|
||||
statement: $ => seq($._expression, ';'),
|
||||
|
|
@ -25,6 +28,15 @@ module.exports = grammar({
|
|||
alias($.identifier, $.property_name)
|
||||
)),
|
||||
|
||||
identifier: $ => /[a-z]+/
|
||||
identifier: $ => /[a-z]+/,
|
||||
|
||||
// Tests for https://github.com/tree-sitter/tree-sitter/issues/1834
|
||||
//
|
||||
// Even though the alias is unused, that issue causes all instances of
|
||||
// the extra that appear in the tree to be renamed to `star_aliased`.
|
||||
//
|
||||
// Instead, this alias should have no effect because it is unused.
|
||||
star: $ => '*',
|
||||
unused: $ => alias($.star, $.star_aliased),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue