Skip to content

Commit

Permalink
add more missed keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoohey31 committed Dec 5, 2023
1 parent efe4569 commit 4eef46e
Show file tree
Hide file tree
Showing 5 changed files with 24,123 additions and 23,814 deletions.
19 changes: 16 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ module.exports = grammar({
$.externbody,
),
seq(optional($.fipmod), "extern", $.funid, $.externtype, $.externbody),
seq("extern", "import", $.externimpbody),
seq(
"extern",
choice(
"import",
"include", // Deprecated, but still supported.
),
$.externimpbody,
),
),
_open_round_brace: ($) =>
prec.right(seq("(", optional($._end_continuation_signal))),
Expand Down Expand Up @@ -206,7 +213,7 @@ module.exports = grammar({
),
),
typemod: ($) => choice($.structmod, "open", "extend", "co", "rec"),
structmod: (_) => choice("value", "reference"),
structmod: (_) => choice("value", "ref", "reference"),
effectmod: (_) => choice("rec", "linear", seq("linear", "rec")),
typebody: ($) =>
seq(
Expand Down Expand Up @@ -425,7 +432,13 @@ module.exports = grammar({
),
literal: ($) => choice($.int, $.float, $.char, $.string),
mask: ($) =>
seq("mask", optional("behind"), $._open_angle_brace, $.tbasic, ">"),
seq(
"mask",
optional(choice("behind", "other")),
$._open_angle_brace,
$.tbasic,
">",
),
arguments: ($) => sep1($.argument, $._comma),
argument: ($) => seq(optional(seq($.identifier, "=")), $.expr),
parameters: ($) => sep1($.parameter, $._comma),
Expand Down
3 changes: 3 additions & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"infixl"
"infixr"
"mask"
"other"
"pub"
"some"
] @keyword
Expand All @@ -155,6 +156,7 @@

[
"import"
"include"
"module"
] @keyword.control.import

Expand Down Expand Up @@ -183,6 +185,7 @@
"override"
"raw"
"rec"
"ref"
"reference"
"scoped"
"tail"
Expand Down
30 changes: 26 additions & 4 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4eef46e

Please sign in to comment.