diff options
Diffstat (limited to 'grammar.js')
| -rw-r--r-- | grammar.js | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -83,12 +83,20 @@ module.exports = grammar({ ) ), identifier: $ => prec.left(seq( - $._label, + choice( + $.optional_value, + $._label, + ), optional($.type_annotation), optional($.parameter_list), optional($.return_statement), optional($.throw_statement), )), + optional_value: $ => seq( + '[', + $._label, + ']' + ), type_annotation: $ => seq( '<', $._entry_list, |