Skip to content

Composite Extract Method can produce incorrect parse tree #18405

@balsa-sarenac

Description

@balsa-sarenac

Pharo 13 (probably Pharo 14 too)

Notice the first line:

SoupParser >> parsePossibleRef: anInteger

	literal ifTrue: ^ self foo_: anInteger.
	(charRef matchesStreamPrefix: (self readStreamFrom: anInteger))
		ifTrue: [ ^ self parseCharRef: anInteger ].
	(entityRef matchesStreamPrefix: (self readStreamFrom: anInteger))
		ifTrue: [ ^ self parseEntityRef: anInteger ].
	^ self parseIncomplete: anInteger

original is: literal ifTrue: [^ self parseLiteral: anInteger].

To reproduce try to extract the entire block.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    For Later (kind of Backlog)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions