diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-03-26 11:16:37 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-03-26 11:34:38 +0800 |
| commit | ad0cd3a39d5d77ec32d2f203c7258f727a06ba6e (patch) | |
| tree | 211f3f6e58c32d379aaf5fe0c4483f374705e4ba /spec/inputs/test/format_spec.yue | |
| parent | ffdbbbd3e286d7440af411b475c5a13d49897898 (diff) | |
| download | yuescript-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.yue | 4 |
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" | |||
| 165 | rewriteLineCol = (item)-> | 165 | rewriteLineCol = (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 |
