mirror of
https://codeberg.org/ProgramSnail/tree-sitter-lang.git
synced 2025-12-10 00:28:48 +00:00
minor fixes
This commit is contained in:
parent
4a553f24fb
commit
1b517b8723
3 changed files with 34 additions and 31 deletions
10
grammar.js
10
grammar.js
|
|
@ -25,7 +25,7 @@ module.exports = grammar({
|
|||
|
||||
import: $ => seq(
|
||||
choice('::', 'import'),
|
||||
field('name', choice($.simple_name_identifier, '_')),
|
||||
field('name', choice($.simple_name_identifier, $.placeholder)),
|
||||
optional(seq('=', field('module', $.simple_name_identifier))),
|
||||
optional(seq(':', repeat1(choice(
|
||||
$.simple_type_identifier,
|
||||
|
|
@ -45,7 +45,7 @@ module.exports = grammar({
|
|||
repeat($.annotation_info),
|
||||
optional('^'),
|
||||
field('name', $.simple_type_identifier),
|
||||
optional(seq(repeat($.argument_type_identifier), '=', choice($.variant_type, $.tuple_type))),
|
||||
optional(seq(repeat($.argument_type_identifier), '=', $.variant_type)),
|
||||
choice(seq('{', repeat($.function_definition), '}'), ';')
|
||||
),
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ module.exports = grammar({
|
|||
optional($.definition_info),
|
||||
repeat($.annotation_info),
|
||||
repeat(seq($.constraint, ';')),
|
||||
/*optional(seq(*/optional($._var_let)/*, '.'))*/,
|
||||
optional($._var_let),
|
||||
choice(field('name', $.simple_name_identifier), seq('(', field('name', $.operator), ')')),
|
||||
repeat(seq(
|
||||
optional($.annotation_identifier),
|
||||
|
|
@ -71,7 +71,7 @@ module.exports = grammar({
|
|||
|
||||
typeclass_definition: $ => seq(
|
||||
optional($.definition_info),
|
||||
repeat($.annotation_info),
|
||||
// no argumenmts => no annotation info
|
||||
field('name', $.typeclass_identifier),
|
||||
optional(seq(':', repeat1($.typeclass_identifier))),
|
||||
choice(seq('{', repeat($.function_definition), '}'), ';'),
|
||||
|
|
@ -218,7 +218,7 @@ module.exports = grammar({
|
|||
variant_type: $ => seq(
|
||||
optional('|'),
|
||||
$.tuple_type,
|
||||
repeat1(seq('|', $.tuple_type)),
|
||||
repeat(seq('|', $.tuple_type)),
|
||||
),
|
||||
|
||||
tuple_type: $ => seq(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue