Skip to content

Commit

Permalink
fix: device name (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
luckasRanarison committed Jan 19, 2024
1 parent 0406479 commit e60fc85
Show file tree
Hide file tree
Showing 6 changed files with 723 additions and 659 deletions.
6 changes: 4 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = grammar({

section: ($) =>
seq(
choice($.name, seq($.name, ":", field("device", $.name))),
choice($.name, seq($.name, ":", field("device", $.device_name))),
"{",
$._linebreak,
repeat(choice($.assignment, $.keyword, $.section, $._linebreak)),
Expand Down Expand Up @@ -96,7 +96,9 @@ module.exports = grammar({
params: ($) =>
prec(-1, seq($._value, repeat(seq(",", optional($._value))))),

name: () => /[\w\d][\w\d\/\.\-:]*/,
name: () => /[\w][\w\d\.\-]*/,

device_name: () => /[\w\d][\w\d\/\.\-:]*/,

variable: () => seq("$", /\w[\w\d]*/),

Expand Down
2 changes: 1 addition & 1 deletion queries/hyprlang/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)

(section
device: (name) @type
device: (device_name) @type
)

(variable) @variable
Expand Down
6 changes: 5 additions & 1 deletion src/grammar.json

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

6 changes: 5 additions & 1 deletion 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 e60fc85

Please sign in to comment.