]>
git.r.bdr.sh - rbdr/tree-sitter-api-notation/blob - grammar.js
e74c27b6a9cd718f5f73b087acc0ea31fc57669c
1 module
.exports
= grammar({
5 source_file: $ => repeat(
14 definition: $ => prec
.right(seq(
24 entry: $ => prec
.right(seq(
36 optional($.type_annotation
),
37 optional($.parameter_list
),
38 optional($.return_statement
),
39 optional($.throw_statement
),
42 member_type: $ => choice(
54 parameter_list: $ => seq(
56 optional($._identifier_list
),
59 return_statement: $ => seq(
63 throw_statement: $ => seq(
67 _entry_list: $ => prec
.left(seq(
76 _identifier_list: $ => seq(
85 identifier: $ => prec
.left(seq(
87 optional($.type_annotation
),
88 optional($.parameter_list
),
89 optional($.return_statement
),
90 optional($.throw_statement
),
92 type_annotation: $ => seq(
102 _label: $ => /[a-zA-Z0-9][a-zA-Z0-9_-]*/,
103 _newline: $ => token('\n')