-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
@deriving
type foo = {
bar: string
}
@deriving
and t = {bar: int}What I tried but without success:
Add repeat($.decorator) in _type_declaration
_type_declaration: $ => seq(
$.type_identifier,
optional($.type_parameters),
optional(seq(
choice('=', '+='),
optional('private'),
$._type,
optional(seq(
+ repeat($.decorator),
'and',
$._type_declaration
)),
)),
),yarn tree-sitter generate
yarn tree-sitter parse ../test/file.resdecorated [0, 0] - [3, 1]
decorator [0, 0] - [0, 9]
decorator_identifier [0, 1] - [0, 9]
type_declaration [1, 0] - [3, 1]
type_identifier [1, 5] - [1, 8]
record_type [1, 11] - [3, 1]
record_type_field [2, 2] - [2, 13]
property_identifier [2, 2] - [2, 5]
type_annotation [2, 5] - [2, 13]
type_identifier [2, 7] - [2, 13]
ERROR [4, 0] - [5, 7]
decorator [4, 0] - [4, 9]
decorator_identifier [4, 1] - [4, 9]
ERROR [5, 4] - [5, 5]
expression_statement [5, 8] - [5, 18]
record [5, 8] - [5, 18]
record_field [5, 9] - [5, 17]
property_identifier [5, 9] - [5, 12]
value_identifier [5, 14] - [5, 17]
This works.
@deriving
type foo = {
bar: string
} @deriving
and t = {bar: int}And that works too:
Note Add a space after }
@deriving
type foo = {
bar: string
+}
@deriving
and t = {bar: int}Maybe related this?
nkrkvnkrkv
Metadata
Metadata
Assignees
Labels
No labels