mirror of
https://codeberg.org/ProgramSnail/tree-sitter-lang.git
synced 2025-12-15 11:08:50 +00:00
operator definitions
This commit is contained in:
parent
3b4be40ef7
commit
2e0dfdf3fa
3 changed files with 15 additions and 4 deletions
|
|
@ -53,7 +53,7 @@ module.exports = grammar({
|
|||
repeat($.annotation_info),
|
||||
repeat(seq($.constraint, ';')),
|
||||
/*optional(seq(*/optional(choice(choice('%', 'let'), choice('$', 'var')))/*, '.'))*/,
|
||||
field('name', $.simple_name_identifier),
|
||||
choice(field('name', $.simple_name_identifier), seq('(', field('name', $.operator), ')')),
|
||||
repeat(seq(
|
||||
optional($.annotation_identifier),
|
||||
$.argument_name_identifier,
|
||||
|
|
@ -248,9 +248,7 @@ module.exports = grammar({
|
|||
_type_identifier: $ => choice($.argument_type_identifier, $.simple_type_identifier),
|
||||
|
||||
placeholder: $ => '_',
|
||||
|
||||
simple_name_identifier: $ => token(seq(repeat(seq(/[a-z_][a-z0-9_]*/, '.')), /[a-z_][a-z0-9_]*/)),
|
||||
|
||||
simple_type_identifier: $ => /([a-z_][a-z0-9_]*\.)*[A-Z][a-zA-Z0-9]*/,
|
||||
typeclass_identifier: $ => /([a-z_][a-z0-9_]*\.)*#[A-Z][a-zA-Z0-9]*/,
|
||||
argument_name_identifier: $ => /'[a-z_][a-z0-9_]*/,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue