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 Feb 10, 2023
1 parent 38afcb2 commit 8596344
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,31 +34,31 @@ function foo()
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(init
(expr
(constant
(integer)))))))
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(init
(expr
(constant
(integer))))))
(option_decl
(id)
(initializer
(init_class)
(init_kind)
(init
(expr
(constant
(boolean))))))
(const_decl
(id)
(initializer
(init_class)
(init_kind)
(init
(expr
(constant
Expand Down Expand Up @@ -93,7 +93,7 @@ function foo()
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(init
(expr
(constant
Expand All @@ -112,7 +112,7 @@ global y = r?$a;
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(init
(expr
(field_access
Expand All @@ -122,7 +122,7 @@ global y = r?$a;
(var_decl
(id)
(initializer
(init_class)
(init_kind)
(init
(expr
(field_check
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),
$.init,
),

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

init: $ => choice(
seq('{', optional(list1($.expr, ',', true)), '}'),
Expand Down

0 comments on commit 8596344

Please sign in to comment.