Skip to content

Commit 347c462

Browse files
authored
enh(nix): major improvements to grammar (#4140)
* nix: add function type, import regex library * nix: update keywords - Add a bunch of new keywords - List all `builtins` explicitly - Sort alphabetically, to make it easier to spot missing builtins - Remove `add`, not a real builtin - Move `or` to `keywords`, this is not a `literal` * nix: fix string handling - The different string variants have different modes of escapes. Split `STRING.contains` into their different variants to reflect this. - Add escape logic for `'''` - Add escape logic for backslash escaped characters. * nix: handle path, lookup paths, and operators * nix: handle markdown comments Also ensure comments are handled before any other expressions * nix: handle REPL keywords * nix: handle basic function params * nix: better parsing for attrsets * nix: update tests * CHANGES.md: update with changes to nix
1 parent 0dd843b commit 347c462

File tree

4 files changed

+506
-56
lines changed

4 files changed

+506
-56
lines changed

CHANGES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,26 @@ Core Grammars:
1717
- enh(csharp) add Contextual keywords `file`, `args`, `dynamic`, `record`, `required` and `scoped` [Alvin Joy][]
1818
- enh(lua) add 'pluto' as an alias [Sainan]
1919
- enh(bash) add reserved keywords `time` and `coproc` [Álvaro Mondéjar][]
20+
- enh(nix) update keywords [h7x4][]
21+
- enh(nix) support paths [h7x4][]
22+
- enh(nix) support lookup paths [h7x4][]
23+
- enh(nix) support operators [h7x4][]
24+
- enh(nix) support REPL keywords [h7x4][]
25+
- enh(nix) support markdown comments [h7x4][]
26+
- enh(nix) support basic function params [h7x4][]
27+
- enh(nix) better parsing of attrsets [h7x4][]
2028
- fix(c) - Fixed hex numbers with decimals [Dxuian]
2129
- fix(typescript) - Fixedoptional property not highlighted correctly [Dxuian]
2230
- fix(ruby) - fix `|=` operator false positives (as block arguments) [Aboobacker MK]
2331
- fix(sql) - Fixed sql primary key and foreign key spacing issue [Dxuian]
2432
- fix(cpp) added flat_set and flat_map as a part of cpp 23 version [Lavan]
2533
- fix(yaml) - Fixed special chars in yaml [Dxuian]
2634
- fix(basic) - Fixed closing quotation marks not required for a PRINT statement [Somya]
35+
- fix(nix) remove `add` builtin [h7x4][]
36+
- fix(nix) mark `or` as builtin instead of literal [h7x4][]
37+
- fix(nix) handle `'''` string escapes [h7x4][]
38+
- fix(nix) handle backslash string escapes [h7x4][]
39+
- fix(nix) don't mix escapes for `"` and `''` strings [h7x4][]
2740
- fix(swift) - Fixed syntax highlighting for class func/var declarations [guuido]
2841

2942
New Grammars:

0 commit comments

Comments
 (0)