mirror of
https://github.com/soconnor0919/nand2tetris-zed.git
synced 2025-12-13 07:34:45 -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:
5
languages/compare-output/brackets.scm
Normal file
5
languages/compare-output/brackets.scm
Normal file
@@ -0,0 +1,5 @@
|
||||
; Compare/Output file bracket matching
|
||||
|
||||
; No brackets are used in compare/output file syntax
|
||||
; These files contain simple tabular data with pipe separators
|
||||
; No nested structures or bracket pairs to match
|
||||
6
languages/compare-output/config.toml
Normal file
6
languages/compare-output/config.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
name = "Compare Output"
|
||||
grammar = "compare_output"
|
||||
scope = "source.compare_output"
|
||||
path_suffixes = ["cmp", "out"]
|
||||
tab_size = 2
|
||||
hard_tabs = false
|
||||
40
languages/compare-output/highlights.scm
Normal file
40
languages/compare-output/highlights.scm
Normal file
@@ -0,0 +1,40 @@
|
||||
; Compare/Output file syntax highlighting queries based on actual node types
|
||||
|
||||
; Header row elements
|
||||
(header_row) @markup.heading
|
||||
|
||||
; Column names in headers
|
||||
(column_name) @property
|
||||
|
||||
; Register names in headers (RAM[0], RAM[256], etc.)
|
||||
(register_name) @variable.builtin
|
||||
|
||||
; Pin names in headers
|
||||
(pin_name) @property
|
||||
|
||||
; Generic names in headers
|
||||
(generic_name) @property
|
||||
|
||||
; Data values
|
||||
(binary_value) @constant.numeric
|
||||
(decimal_value) @constant.numeric
|
||||
(register_reference) @variable
|
||||
|
||||
; Table structure
|
||||
"|" @punctuation.delimiter
|
||||
|
||||
; Separator rows
|
||||
(separator_row) @comment
|
||||
|
||||
; Specific highlighting for common patterns
|
||||
; Binary patterns (16-bit values)
|
||||
(binary_value) @constant.numeric
|
||||
|
||||
; Decimal numbers
|
||||
(decimal_value) @constant.numeric
|
||||
|
||||
; RAM references in headers
|
||||
(register_name) @variable.builtin
|
||||
|
||||
; Common pin names
|
||||
(pin_name) @property
|
||||
9
languages/compare-output/indents.scm
Normal file
9
languages/compare-output/indents.scm
Normal file
@@ -0,0 +1,9 @@
|
||||
; Compare/Output file indentation rules
|
||||
|
||||
; No special indentation rules needed for compare/output files
|
||||
; These files contain simple tabular data with consistent formatting
|
||||
; All rows should be at the same indentation level
|
||||
|
||||
; Table rows should align consistently
|
||||
; The pipe characters (|) provide natural alignment guides
|
||||
; No nested structures require indentation changes
|
||||
13
languages/compare-output/outline.scm
Normal file
13
languages/compare-output/outline.scm
Normal file
@@ -0,0 +1,13 @@
|
||||
; Compare/Output file outline queries
|
||||
|
||||
; Show header rows in the outline for navigation
|
||||
(header_row
|
||||
(header_cell (column_name) @name)) @item
|
||||
(#set! item.kind "table")
|
||||
|
||||
; Show table structure - group data rows by sections
|
||||
(table_row) @item
|
||||
(#set! item.kind "row")
|
||||
|
||||
; No other special outline patterns needed for simple tabular data
|
||||
; The header row provides the main navigation structure
|
||||
Reference in New Issue
Block a user