Skip to content

Remove Source#string= method#117

Merged
kou merged 1 commit into
ruby:masterfrom
naitoh:remove_source_string_method
Mar 3, 2024
Merged

Remove Source#string= method#117
kou merged 1 commit into
ruby:masterfrom
naitoh:remove_source_string_method

Conversation

@naitoh

@naitoh naitoh commented Mar 2, 2024

Copy link
Copy Markdown
Contributor

Why?

We want to just change scan pointer.

#114 (comment)

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

Comment thread lib/rexml/parsers/baseparser.rb Outdated
#STDERR.puts @source.encoding
#STDERR.puts "BUFFER = #{@source.buffer.inspect}"
if @document_status == nil
pos = @source.pos

Copy link
Copy Markdown
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 thread lib/rexml/source.rb Outdated
Comment on lines +79 to +83
def pos
@scanner.pos
end

def pos=(pos)

Copy link
Copy Markdown
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

kou commented Mar 3, 2024

Copy link
Copy Markdown
Member

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