Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@naitoh
Copy link
Contributor

@naitoh naitoh commented Mar 2, 2024

Why?

We want to just change scan pointer.

#114 (comment)

I want to just change scan pointer (StringScanner#pos=) instead of changing @scanner.string.

#STDERR.puts @source.encoding
#STDERR.puts "BUFFER = #{@source.buffer.inspect}"
if @document_status == nil
pos = @source.pos
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about renaming pos to start_position or something to indicate this is the position before we parsing the next event?

Comment on lines 79 to 83
def pos
@scanner.pos
end

def pos=(pos)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about avoid abbreviation here? The original word isn't so long.

Suggested change
def pos
@scanner.pos
end
def pos=(pos)
def position
@scanner.pos
end
def position=(position)

@naitoh naitoh force-pushed the remove_source_string_method branch from b9ebca5 to ab1816b Compare March 3, 2024 09:29
@naitoh naitoh requested a review from kou March 3, 2024 09:37
## Why?

We want to just change scan pointer.

ruby#114 (comment)
> I want to just change scan pointer (StringScanner#pos=) instead of changing @scanner.string.
@naitoh naitoh force-pushed the remove_source_string_method branch from ab1816b to e59a2af Compare March 3, 2024 10:51
@kou kou merged commit d146162 into ruby:master Mar 3, 2024
@kou
Copy link
Member

kou commented Mar 3, 2024

Thanks!

@naitoh naitoh deleted the remove_source_string_method branch March 3, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants