Skip to content

Unexpected nil from SyntaxTree.parse #357

@prikha

Description

@prikha

I've stumbled upon unexpected behaviour of SyntaxTree#parse

Actual behaviour:

SyntaxTree.parse('/*/') #=> nil

Expected behaviour:

SyntaxTree.parse('/*/') #=> SyntaxTree::Parser::ParseError

It's not a bug, but more of an inconsistent interface, I expect it to return either a Node or raise an exception. And nil just doesn't give any information. I suggest raising exception in case of parser.error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions