Skip to content

Commit

Permalink
fix grammar: highlight '$1' as variable
Browse files Browse the repository at this point in the history
  • Loading branch information
senyai committed Mar 25, 2024
1 parent 79fb135 commit dea3149
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pikchr/pikchr.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@
},
"id": {
"comment": "didn't find the rule exactly",
"match": "(?!\\b(?:then|from|at|diameter|ht|height|rad|radius|thickness|width|wid|with|dashed|dotted|fill|color|to|chop|even)\\b)(\\$?[a-zA-Z]+[a-zA-Z0-9_]*)\\s*",
"match": "(?!\\b(?:then|from|at|diameter|ht|height|rad|radius|thickness|width|wid|with|dashed|dotted|fill|color|to|chop|even)\\b)([$a-zA-Z][a-zA-Z0-9_]*)\\s*",
"captures": {
"1": {
"name": "variable.language.pikchr"
Expand Down
4 changes: 4 additions & 0 deletions pikchr/test/statements.test.pikchr
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,7 @@ line dotted

"splines"
// <--------- string.quoted.double.pikchr

box ht $1 wid $1 $2
// ^^ ^^^ support.constant.property-value.pikchr
// ^^ ^^ ^^ variable.language.pikchr

0 comments on commit dea3149

Please sign in to comment.