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/outputs/test/format_spec.lua | |
| 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/outputs/test/format_spec.lua')
| -rw-r--r-- | spec/outputs/test/format_spec.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/outputs/test/format_spec.lua b/spec/outputs/test/format_spec.lua index c9ea3c2..d38a0ad 100644 --- a/spec/outputs/test/format_spec.lua +++ b/spec/outputs/test/format_spec.lua | |||
| @@ -164,7 +164,9 @@ local rewriteLineCol | |||
| 164 | rewriteLineCol = function(item) | 164 | rewriteLineCol = function(item) |
| 165 | item[2] = 0 | 165 | item[2] = 0 |
| 166 | item[3] = 0 | 166 | item[3] = 0 |
| 167 | for i = 4, #item do | 167 | item[4] = 0 |
| 168 | item[5] = 0 | ||
| 169 | for i = 6, #item do | ||
| 168 | local _exp_0 = type(item[i]) | 170 | local _exp_0 = type(item[i]) |
| 169 | if "table" == _exp_0 then | 171 | if "table" == _exp_0 then |
| 170 | if item[i][1] == "comment" then | 172 | if item[i][1] == "comment" then |
