Skip to content

Clean up tooling parser around getLiteral #315

@Pike

Description

@Pike

In reviewing #311, I found that getLiteral and getSelectorExpression are just very confusing.

For one, getLiteral doesn't do what it says, but then it also returns, in order, a ref, a ref, a literal, a ref and finally a literal again. Trying to find out what that code actually returns, and what of that's left over at which point in getSelectorExpression ... took me a while.

My ad-hoc proposal is to just rip out getLiteral entirely, and fold it in to getSelectorExpression.

I'd expect the code to be easier to read, in particular if we'd add a comment or two.

And we don't need to figure out a name for getLiteral if we'd keep it and make it do literals and non-literals in order.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions