Skip to content

ParseResult#continuable? for code ending with whitespace or newline #3957

@tompng

Description

@tompng

I expect these to be all true.

Prism.parse("class A").continuable? #=> true
Prism.parse("class A\n").continuable? #=> false
Prism.parse("def f").continuable? #=> true
Prism.parse("def f ").continuable? #=> false
Prism.parse("def f\n").continuable? #=> false
Prism.parse("def f\n  ").continuable? #=> true
Prism.parse("(").continuable? #=> true
Prism.parse("( ").continuable? #=> false
Prism.parse("(\n").continuable? #=> false
Prism.parse("1 +").continuable? #=> true
Prism.parse("1 +\n").continuable? #=> false

I found these with IRB's test code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions