Skip to content

Ambiguity parsing operators with suffixes ending in subscript/superscript letter #608

@moble

Description

@moble

Per this discussion, there's an ambiguity in an expression like 1 +ᵃx — which could mean either 1 +ᵃ x or 1 + ᵃx. As of this writing, the manual says (emphasis mine)

A space is required between an operator that ends with a subscript/superscript letter and a subsequent variable name. For example, if +ᵃ is an operator, then +ᵃx must be written as +ᵃ x to distinguish it from + ᵃx where ᵃx is the variable name.

Those emphasized words would suggest that a missing space would raise an error, just as 1.+x does — but that is not the case. The current behavior in both the native Julia parser and in JuliaSyntax is to parse +ᵃx as +ᵃ x. @stevengj suggests it should be an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    error messagesBetter, more actionable diagnosticsinvalidThis doesn't seem rightparser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions