Skip to content

Commit

Permalink
grammar: Qualifier lists
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Jul 3, 2024
1 parent d684ed7 commit 97ae78c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ module.exports = grammar({

import: $ => seq("import", field("path", $.identifier)),

qualifier: _ => choice("extern", "pure"),
qualifier_list: $ => choice($.qualifier, seq($.qualifier, $.qualifier_list)),

function_declaration: $ =>
prec(
100,
seq(
field("qualifiers", optional($.qualifier_list)),
"fn",
field("name", $.identifier),
optional(seq("(", optional(field("params", $.param_list)), ")")),
Expand Down

0 comments on commit 97ae78c

Please sign in to comment.