Skip to content

Commit

Permalink
feat: highlight more redirection operators (#173)
Browse files Browse the repository at this point in the history
```scheme
[
    "o>>"   "out>>"
    "e>>"   "err>>"
    "e+o>>" "err+out>>"
    "o+e>>" "out+err>>"
    "o>|"   "out>|"
    "e>|"   "err>|"
    "e+o>|" "err+out>|"
    "o+e>|" "out+err>|"
] @operator

```

Missing redirection operators added to `highlights.scm`.
  • Loading branch information
blindFS authored Dec 20, 2024
1 parent dc22e25 commit 0921525
Show file tree
Hide file tree
Showing 5 changed files with 21,542 additions and 21,609 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ module.exports = grammar({
),
),

_unquoted_naive: (_$) => token(repeat1(none_of("{}"))),
_unquoted_naive: (_$) => token(prec(PREC().low, repeat1(none_of("{}")))),
unquoted: _unquoted_rule("command"),
_unquoted_in_list: _unquoted_rule("list"),
_unquoted_in_record: _unquoted_rule("record"),
Expand Down
7 changes: 7 additions & 0 deletions queries/nu/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ file_path: (val_string) @variable.parameter
"e>" "err>"
"e+o>" "err+out>"
"o+e>" "out+err>"
"o>>" "out>>"
"e>>" "err>>"
"e+o>>" "err+out>>"
"o+e>>" "out+err>>"
"e>|" "err>|"
"e+o>|" "err+out>|"
"o+e>|" "out+err>|"
] @operator

;;; ---
Expand Down
10 changes: 7 additions & 3 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -19372,10 +19372,14 @@
"_unquoted_naive": {
"type": "TOKEN",
"content": {
"type": "REPEAT1",
"type": "PREC",
"value": -1,
"content": {
"type": "PATTERN",
"value": "[^\\s\\r\\n\\t\\|();{}]"
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[^\\s\\r\\n\\t\\|();{}]"
}
}
}
},
Expand Down
Loading

0 comments on commit 0921525

Please sign in to comment.