-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print locations using line / col instead of offsets #1549
Conversation
@@ -71,7 +71,7 @@ def copy(**options) | |||
|
|||
# Returns a string representation of this location. | |||
def inspect | |||
"#<YARP::Location @start_offset=#{@start_offset} @length=#{@length}>" | |||
"#<YARP::Location @start_offset=#{@start_offset} @length=#{@length} start_line=#{start_line}>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change I'm slightly unsure of, since start_line
is not an instance variable. However, this output seems helpful to me for cases like printing error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only debug code, I think it's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just needs a rebase
3e350f0
to
38cd4a9
Compare
This commit changes printing of locations to use the format (start_line,start_column)-(end_line,end_column) instead of using offsets.
38cd4a9
to
c078696
Compare
A more concise format that RubyVM::AST uses is Columns are currently in number of bytes, that seems the case for RubyVM::AST too. |
@jemmaissroff could you look into the memcheck failure? Weird that it's failing on this, but I'm hoping it's surfacing something we can fix. I've found spin to be the best way to get access to valgrind. |
This commit changes printing of locations to use the format (start_line,start_column)-(end_line,end_column) instead of using offsets.