mirror of
https://codeberg.org/ProgramSnail/tree-sitter-lang.git
synced 2025-12-06 06:38:51 +00:00
minor fixes, changes, required for usage
This commit is contained in:
parent
39f31b901d
commit
df305457c8
2 changed files with 8 additions and 8 deletions
|
|
@ -2,7 +2,7 @@
|
|||
Test
|
||||
================================================================================
|
||||
|
||||
#! lang
|
||||
#!/usr/bin/env lang
|
||||
|
||||
:: module; // import module to current namespace
|
||||
|
||||
|
|
|
|||
14
grammar.js
14
grammar.js
|
|
@ -82,8 +82,8 @@ module.exports = grammar({
|
|||
case: $ => seq(
|
||||
choice(':=', '=:'),
|
||||
$._expression,
|
||||
optional(seq(choice('??', 'if'), $._expression)),
|
||||
optional(seq($._do, $._expression)),
|
||||
optional(seq(choice('??', 'if'), field('condition', $._expression))),
|
||||
optional(field('expression', seq($._do, $._expression))),
|
||||
),
|
||||
|
||||
match: $ => seq(
|
||||
|
|
@ -108,11 +108,11 @@ module.exports = grammar({
|
|||
loop: $ => seq(
|
||||
choice('@', 'for'),
|
||||
optional(choice(
|
||||
field('condition', $._expression),
|
||||
seq(field('variable', $._expression), ':', field('interval', $._expression)),
|
||||
$._expression,
|
||||
seq($._expression, ':', $._expression),
|
||||
)),
|
||||
$._do,
|
||||
field('expression', $._expression),
|
||||
$._expression,
|
||||
),
|
||||
|
||||
// --- operators
|
||||
|
|
@ -134,7 +134,7 @@ module.exports = grammar({
|
|||
|
||||
// --- modifiers
|
||||
|
||||
return: $ => seq(choice('return', 'bring'), field('value', $._expression)),
|
||||
return: $ => seq(choice('return', 'bring'), $._expression),
|
||||
|
||||
name_definition: $ => seq(
|
||||
$._var_let,
|
||||
|
|
@ -164,7 +164,7 @@ module.exports = grammar({
|
|||
),
|
||||
|
||||
constructor: $ => seq(
|
||||
$.type,
|
||||
field('type', $.type),
|
||||
repeat1(seq(optional($.annotation_identifier), $._scoped_expression)),
|
||||
),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue