mirror of
https://codeberg.org/ProgramSnail/tree-sitter-lang.git
synced 2025-12-15 19:18:51 +00:00
minor fixes
This commit is contained in:
parent
df305457c8
commit
4a553f24fb
2 changed files with 5 additions and 5 deletions
|
|
@ -12,7 +12,7 @@ statement: import
|
|||
;
|
||||
|
||||
import: ('::' | 'import') (SIMPLE_NAME_IDENTIFIER | '_') ('=' SIMPLE_NAME_IDENTIFIER)?
|
||||
(':' (SIMPLE_TYPE_IDENTIFIER | SIMPLE_NAME_IDENTIFIER | TYPECLASS_IDENTIFIER | ('(' OPERATOR ')'))*)? ';'
|
||||
(':' (SIMPLE_TYPE_IDENTIFIER | SIMPLE_NAME_IDENTIFIER | TYPECLASS_IDENTIFIER | ('(' OPERATOR ')'))+)? ';'
|
||||
;
|
||||
|
||||
constraint: '?' expression ;
|
||||
|
|
@ -30,7 +30,7 @@ function_definition: (definietion_info)? (ANNOTATION_INFO)* (constraint ';')*
|
|||
;
|
||||
|
||||
typeclass_definition: (DEFINITION_INFO)? (ANNOTATION_INFO)*
|
||||
TYPECLASS_IDENTIFIER (seq(':', (TYPECLASS_IDENTIFIER)*))?
|
||||
TYPECLASS_IDENTIFIER (seq(':', (TYPECLASS_IDENTIFIER)+))?
|
||||
(('{' (function_definition)* '}') | ';')
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ module.exports = grammar({
|
|||
choice('::', 'import'),
|
||||
field('name', choice($.simple_name_identifier, '_')),
|
||||
optional(seq('=', field('module', $.simple_name_identifier))),
|
||||
optional(seq(':', repeat(choice(
|
||||
optional(seq(':', repeat1(choice(
|
||||
$.simple_type_identifier,
|
||||
$.simple_name_identifier,
|
||||
$.typeclass_identifier,
|
||||
|
|
@ -72,8 +72,8 @@ module.exports = grammar({
|
|||
typeclass_definition: $ => seq(
|
||||
optional($.definition_info),
|
||||
repeat($.annotation_info),
|
||||
$.typeclass_identifier,
|
||||
optional(seq(':', repeat($.typeclass_identifier))),
|
||||
field('name', $.typeclass_identifier),
|
||||
optional(seq(':', repeat1($.typeclass_identifier))),
|
||||
choice(seq('{', repeat($.function_definition), '}'), ';'),
|
||||
),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue