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

parse unicode forall and exists as identifiers #42314

Merged
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ New language features
to enforce the involved function calls to be (or not to be) inlined. ([#41312])
* The default behavior of observing `@inbounds` declarations is now an option via `auto` in `--check-bounds=yes|no|auto` ([#41551])
* New function `eachsplit(str)` for iteratively performing `split(str)`.
* `∀`, `∃`, and `∄` are now allowed as identifier characters ([#42314]).

Language changes
----------------
Expand Down
3 changes: 2 additions & 1 deletion src/flisp/julia_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ static int is_wc_cat_id_start(uint32_t wc, utf8proc_category_t cat)
wc == 0x223f || wc == 0x22be || wc == 0x22bf || // ∿, ⊾, ⊿
wc == 0x22a4 || wc == 0x22a5 || // ⊤ ⊥

(wc >= 0x2202 && wc <= 0x2233 &&
(wc >= 0x2200 && wc <= 0x2233 &&
(wc == 0x2202 || wc == 0x2205 || wc == 0x2206 || // ∂, ∅, ∆
wc == 0x2207 || wc == 0x220e || wc == 0x220f || // ∇, ∎, ∏
wc == 0x2200 || wc == 0x2203 || wc == 0x2204 || // ∀, ∃, ∄
wc == 0x2210 || wc == 0x2211 || // ∐, ∑
wc == 0x221e || wc == 0x221f || // ∞, ∟
wc >= 0x222b)) || // ∫, ∬, ∭, ∮, ∯, ∰, ∱, ∲, ∳
Expand Down
6 changes: 6 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2967,6 +2967,12 @@ end
@generated g25678(x) = return :x
@test g25678(7) === 7

# issue #19012
@test Meta.parse("\U2200", raise=false) == Symbol("∀")
@test Meta.parse("\U2203", raise=false) == Symbol("∃")
@test Meta.parse("a\U2203", raise=false) == Symbol("a∃")
@test Meta.parse("\U2204", raise=false) == Symbol("∄")

# issue 42220
macro m42220()
return quote
Expand Down