minor fixes, changes, required for usage

This commit is contained in:
ProgramSnail 2023-07-22 13:34:19 +03:00
parent 39f31b901d
commit df305457c8
2 changed files with 8 additions and 8 deletions

View file

@ -2,7 +2,7 @@
Test
================================================================================
#! lang
#!/usr/bin/env lang
:: module; // import module to current namespace

View file

@ -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)),
),