Skip to content

Commit

Permalink
grammar: Imports
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Aug 12, 2024
1 parent c2159a1 commit c4444e1
Show file tree
Hide file tree
Showing 5 changed files with 3,729 additions and 3,418 deletions.
4 changes: 3 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ module.exports = grammar({

block: $ => seq("{", field("body", repeat($.statement)), "}"),

import: $ => seq("import", field("path", $.identifier)),
import: $ => seq("import", optional($.import_relative_dot), field("path", $.import_path)),
import_path: $ => choice($.identifier, seq($.identifier, ".", $.import_path)),
import_relative_dot: _ => ".",

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

0 comments on commit c4444e1

Please sign in to comment.