aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/test/format_spec.yue
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-03-26 11:16:37 +0800
committerLi Jin <dragon-fly@qq.com>2026-03-26 11:34:38 +0800
commitad0cd3a39d5d77ec32d2f203c7258f727a06ba6e (patch)
tree211f3f6e58c32d379aaf5fe0c4483f374705e4ba /spec/inputs/test/format_spec.yue
parentffdbbbd3e286d7440af411b475c5a13d49897898 (diff)
downloadyuescript-ad0cd3a39d5d77ec32d2f203c7258f727a06ba6e.tar.gz
yuescript-ad0cd3a39d5d77ec32d2f203c7258f727a06ba6e.tar.bz2
yuescript-ad0cd3a39d5d77ec32d2f203c7258f727a06ba6e.zip
feat: add m_end position to AST nodes
- Add end line and column (m_end.m_line, m_end.m_col) to AST output - New AST format: [name, begin_line, begin_col, end_line, end_col, ...children] - Update format_spec.yue to normalize end positions for comparison - Add ast_spec.yue tests for AST end position feature Closes #251
Diffstat (limited to 'spec/inputs/test/format_spec.yue')
-rw-r--r--spec/inputs/test/format_spec.yue4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/inputs/test/format_spec.yue b/spec/inputs/test/format_spec.yue
index 8c6096a..310b610 100644
--- a/spec/inputs/test/format_spec.yue
+++ b/spec/inputs/test/format_spec.yue
@@ -165,7 +165,9 @@ import "yue"
165rewriteLineCol = (item)-> 165rewriteLineCol = (item)->
166 item[2] = 0 166 item[2] = 0
167 item[3] = 0 167 item[3] = 0
168 for i = 4, #item 168 item[4] = 0
169 item[5] = 0
170 for i = 6, #item
169 switch type item[i] when "table" 171 switch type item[i] when "table"
170 if item[i][1] == "comment" 172 if item[i][1] == "comment"
171 table.remove item, i 173 table.remove item, i