julia icon indicating copy to clipboard operation
julia copied to clipboard

Include missing sub- and superscripts in operator suffix list

Open moble opened this issue 3 months ago • 5 comments

@stevengj remarked in his original PR introducing this file that the Unicode superscripts and subscripts are annoyingly scattered all over the place — as evidenced by the fact that there are still a few good ones missing. Specifically, I was trying to use superscript alpha (\^alpha<tab>), which fails.

There are many Unicode entries with "subscript" or "superscript" in the name — not all of which need to be included in the list, but I think it would be fair to include all characters that are available in Julia with tab completion starting with either \_ or \^. The current src/flisp/julia_opsuffs.h file is just 6 short of that goal. Three of the missing are inarguably mistaken omissions: superscript alpha ᵅ, epsilon ᵋ, and (Latin) phi ᶲ. We also have subscript < ˱ and > ˲, which also seem like natural fits on a list that also include subscript = ₌, ( ₍, and ) ₎. The last candidate is subscript schwa ₔ, which is borderline since it's not really a math-y character; on the other hand, making that the only intentional omission is the kind of thing that would really bug me if I were the poor jerk who wanted it. But I won't die on that hill.

moble avatar Dec 01 '25 05:12 moble

This seems reasonable to me.

stevengj avatar Dec 01 '25 19:12 stevengj

Note that we'll also need to patch https://github.com/JuliaLang/JuliaSyntax.jl/blob/4a983f60eb8ef3d877bbeb7eac6d2ae3d98fa377/src/julia/tokenize.jl#L149-L150 — maybe you should submit a JuliaSyntax.jl patch first, actually, since that's where all of the syntax work is currently happening.

stevengj avatar Dec 01 '25 19:12 stevengj

Note that we'll also need to patch JuliaLang/JuliaSyntax.jl@4a983f6/src/julia/tokenize.jl#L149-L150 — maybe you should submit a JuliaSyntax.jl patch first, actually, since that's where all of the syntax work is currently happening.

Oh, good point! Will do.

moble avatar Dec 01 '25 21:12 moble

maybe you should submit a JuliaSyntax.jl patch first

JuliaSyntax actually lives in this repo now (as of https://github.com/JuliaLang/julia/pull/59870), so the changes can be added directly to this PR

topolarity avatar Dec 03 '25 04:12 topolarity

JuliaSyntax actually lives in this repo now (as of #59870), so the changes can be added directly to this PR

That's surprising! Alright, I've made the change here. Thanks for pointing that out.

moble avatar Dec 03 '25 04:12 moble