Skip to content

Commit

Permalink
Rename init_class to init_node
Browse files Browse the repository at this point in the history
The previous name sounded a lot like a class initializer which this is
not.
  • Loading branch information
bbannier committed Mar 18, 2023
1 parent 5af5294 commit e50434e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions corpus/test
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@ function foo()
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(expr
(constant
(integer))))))
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(expr
(constant
(integer)))))
(option_decl
(id)
(initializer
(init_class)
(init_kind)
(expr
(constant
(boolean)))))
(const_decl
(id)
(initializer
(init_class)
(init_kind)
(expr
(constant
(boolean)))))
Expand Down Expand Up @@ -89,7 +89,7 @@ function foo()
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(expr
(constant
(integer))))))))
Expand All @@ -107,7 +107,7 @@ global y = r?$a;
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(expr
(field_access
(expr
Expand All @@ -116,7 +116,7 @@ global y = r?$a;
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(expr
(field_check
(expr
Expand Down
4 changes: 2 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ module.exports = grammar({
type_spec: $ => seq($.id, ':', $.type, optional($.attr_list), ';'),

initializer: $ => seq(
optional($.init_class),
optional($.init_kind),
$.expr,
),

init_class: _ => prec_r(choice('=', '+=', '-=')),
init_kind: _ => prec_r(choice('=', '+=', '-=')),

attr_list: $ => prec_l(repeat1($.attr)),

Expand Down

0 comments on commit e50434e

Please sign in to comment.