Skip to content

Unexpected behavior on dot dot #385

Description

@sorawee

Hi! Thanks for the library.

..abc is identical to .. This is because when the first . is encountered, the parser assumes that it's looking at a form like .abc / ."abc" / .[0], or a standalone .. Since the second token in ..abc doesn't fall into the category of .abc / ."abc" / .[0], it concludes that this is a standalone ., and exit immediately.

Arguably, the correct parsing should be a field access on . (current context), which is equivalent to .abc.

But IIUC, there's also a proposal to make .. an actual operator.

Would it make sense to make .. an error, reserving this syntax for the future?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions