Include column number in the AST nodes #1719
andreabergia
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
Related to #1308 |
Beta Was this translation helpful? Give feedback.
0 replies
-
If you all can figure out how to get column numbers in there, I'm sure lots of people would benefit! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Rhino's AST nodes currently include the row number of the original source file. However, they do not include the column number.
The row number is used in various places:
We propose to add column numbers because they are required to implement correctly source maps. We have an internal implementation at ServiceNow, to process transpiled files, that works in this way:
LINE
bytecodes (for interpreter mode) we go through the source map to associate the current node with the location in the original file. So the line number table will refer to the original source file, not the transpiled one that rhino is actually executing.We have plans to redo part of our code related to source maps and to upstream these changes, but as a first step, we would like to add column numbers to all the AST nodes, to simplify our maintenance.
Are there any objections? If not, we can try to create a PR for this in the next few weeks.
Beta Was this translation helpful? Give feedback.
All reactions