mirror of
https://github.com/soconnor0919/nand2tetris-zed.git
synced 2025-12-15 16:44:43 -05:00
Fix HDL and Hack Assembly syntax highlighting and queries
- Fixed HDL highlights query syntax error with #match? predicate - Replaced #match? with #any-of? for exact string matching - Fixed Hack Assembly outline query invalid field name - Improved HDL syntax highlighting with comprehensive patterns - Added HDL bracket matching for all syntax types - Fixed XML scope mismatch from text.xml to source.xml - Enhanced outline queries for better code navigation
This commit is contained in:
66
languages/test-script/highlights.scm
Normal file
66
languages/test-script/highlights.scm
Normal file
@@ -0,0 +1,66 @@
|
||||
; Test script syntax highlighting queries based on actual node types
|
||||
|
||||
; Commands
|
||||
"load" @keyword
|
||||
"output-file" @keyword
|
||||
"compare-to" @keyword
|
||||
"output-list" @keyword
|
||||
"set" @keyword
|
||||
"eval" @keyword
|
||||
"output" @keyword
|
||||
"tick" @keyword
|
||||
"tock" @keyword
|
||||
"ticktock" @keyword
|
||||
"repeat" @keyword
|
||||
"while" @keyword
|
||||
"echo" @keyword
|
||||
|
||||
; Control flow keywords
|
||||
"repeat" @keyword.control
|
||||
"while" @keyword.control
|
||||
|
||||
; File operations
|
||||
(load_command "load" @keyword)
|
||||
(output_file_command "output-file" @keyword)
|
||||
(compare_to_command "compare-to" @keyword)
|
||||
|
||||
; Variable references
|
||||
(memory_reference "RAM" @type.builtin)
|
||||
(register_reference) @variable.builtin
|
||||
|
||||
; Pin references
|
||||
(pin_reference) @property
|
||||
|
||||
; Numbers and indices
|
||||
(number) @constant.numeric
|
||||
|
||||
; Binary values
|
||||
(binary_value) @constant.numeric
|
||||
|
||||
; Format specifications
|
||||
(format_spec) @string.special
|
||||
|
||||
; Filenames
|
||||
(filename) @string
|
||||
|
||||
; Strings
|
||||
(string) @string
|
||||
|
||||
; Comments
|
||||
(comment) @comment
|
||||
|
||||
; Punctuation
|
||||
"," @punctuation.delimiter
|
||||
";" @punctuation.delimiter
|
||||
"[" @punctuation.bracket
|
||||
"]" @punctuation.bracket
|
||||
"{" @punctuation.bracket
|
||||
"}" @punctuation.bracket
|
||||
|
||||
; Special memory references
|
||||
"DRegister[]" @variable.builtin
|
||||
"ARegister[]" @variable.builtin
|
||||
"PC[]" @variable.builtin
|
||||
|
||||
; Conditions in while loops
|
||||
(condition) @string.special
|
||||
Reference in New Issue
Block a user