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:
54
languages/vm/highlights.scm
Normal file
54
languages/vm/highlights.scm
Normal file
@@ -0,0 +1,54 @@
|
||||
; VM language syntax highlighting queries based on actual node types
|
||||
|
||||
; Arithmetic and logical commands
|
||||
(arithmetic_command) @keyword
|
||||
|
||||
; Memory access commands
|
||||
"push" @keyword
|
||||
"pop" @keyword
|
||||
|
||||
; Memory segments
|
||||
(memory_segment) @type
|
||||
|
||||
; Program flow commands
|
||||
"label" @keyword.control
|
||||
"goto" @keyword.control
|
||||
"if-goto" @keyword.control
|
||||
|
||||
; Function commands
|
||||
"function" @keyword.function
|
||||
"call" @keyword.function
|
||||
(return_command) @keyword.function
|
||||
|
||||
; Numbers (indices, counts)
|
||||
(index) @constant.numeric
|
||||
(local_vars_count) @constant.numeric
|
||||
(args_count) @constant.numeric
|
||||
|
||||
; Identifiers
|
||||
(label_name) @label
|
||||
(function_name) @function
|
||||
|
||||
; Comments
|
||||
(comment) @comment
|
||||
|
||||
; Specific memory segments highlighting
|
||||
"argument" @type.builtin
|
||||
"local" @type.builtin
|
||||
"static" @type.builtin
|
||||
"constant" @type.builtin
|
||||
"this" @type.builtin
|
||||
"that" @type.builtin
|
||||
"pointer" @type.builtin
|
||||
"temp" @type.builtin
|
||||
|
||||
; Arithmetic operations
|
||||
"add" @operator
|
||||
"sub" @operator
|
||||
"neg" @operator
|
||||
"eq" @operator
|
||||
"gt" @operator
|
||||
"lt" @operator
|
||||
"and" @operator
|
||||
"or" @operator
|
||||
"not" @operator
|
||||
Reference in New Issue
Block a user