Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow THIN SPACE U+2009 as an operator suffix #30158

Merged
merged 1 commit into from
Nov 28, 2018

Conversation

tkf
Copy link
Member

@tkf tkf commented Nov 26, 2018

I noticed #22089 allowed a THIN SPACE U+2009 to be a suffix of the operator. I guessed this was a typo since it would be very confusing:

julia> Meta.parse(string("1 ", "*", '\U2009', " 2"))
:(1 *2)

julia> eval(ans)
ERROR: UndefVarError: *  not defined

After this PR:

julia> expr = Meta.parse(string("1 ", "*", '\U2009', " 2"))
:(1 * 2)

julia> dump(expr)
Expr
  head: Symbol call
  args: Array{Any}((3,))
    1: Symbol *
    2: Int64 1
    3: Int64 2

julia> eval(expr)
2

@ararslan ararslan added unicode Related to unicode characters and encodings parser Language parsing and surface syntax labels Nov 26, 2018
@Keno
Copy link
Member

Keno commented Nov 26, 2018

FWIW, this PR seems right to me, but @stevengj should confirm.

@stevengj stevengj added bugfix This change fixes an existing bug backport pending 0.7 labels Nov 26, 2018
@KristofferC KristofferC added backport pending 1.0 minor change Marginal behavior change acceptable for a minor release and removed backport pending 0.7 labels Nov 26, 2018
@KristofferC
Copy link
Member

I don't think this should be backported.

@StefanKarpinski
Copy link
Member

Agree: it’s technically breaking just very unlikely to cause real problems.

@JeffBezanson JeffBezanson merged commit f24711c into JuliaLang:master Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug minor change Marginal behavior change acceptable for a minor release parser Language parsing and surface syntax unicode Related to unicode characters and encodings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants