From 5b2985a15bd87ed58731c503453a4d303b45aba6 Mon Sep 17 00:00:00 2001 From: Peter Ahrens Date: Sun, 19 Sep 2021 14:00:52 -0400 Subject: [PATCH 1/6] parse unicode forall and exists as identifiers --- src/flisp/julia_extensions.c | 1 + test/syntax.jl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/flisp/julia_extensions.c b/src/flisp/julia_extensions.c index dbe94e1388069..b0e3b78f1021d 100644 --- a/src/flisp/julia_extensions.c +++ b/src/flisp/julia_extensions.c @@ -82,6 +82,7 @@ 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 == 0x2200 || wc == 0x2203 || // ∀, ∃ (wc >= 0x2202 && wc <= 0x2233 && (wc == 0x2202 || wc == 0x2205 || wc == 0x2206 || // ∂, ∅, ∆ wc == 0x2207 || wc == 0x220e || wc == 0x220f || // ∇, ∎, ∏ diff --git a/test/syntax.jl b/test/syntax.jl index 09a91a31305f3..5c1e56d97b6b7 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -2966,3 +2966,8 @@ 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∃") \ No newline at end of file From 12b717b3ae28f0d39f1f0d0a39139230bf5db15b Mon Sep 17 00:00:00 2001 From: Peter Ahrens Date: Sun, 19 Sep 2021 14:13:00 -0400 Subject: [PATCH 2/6] move checks inside character range block --- src/flisp/julia_extensions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flisp/julia_extensions.c b/src/flisp/julia_extensions.c index b0e3b78f1021d..56698b74c7596 100644 --- a/src/flisp/julia_extensions.c +++ b/src/flisp/julia_extensions.c @@ -82,10 +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 == 0x2200 || wc == 0x2203 || // ∀, ∃ - (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 == 0x2210 || wc == 0x2211 || // ∐, ∑ wc == 0x221e || wc == 0x221f || // ∞, ∟ wc >= 0x222b)) || // ∫, ∬, ∭, ∮, ∯, ∰, ∱, ∲, ∳ From 52526789ea109590aba2e20205d8ad3fc52252d9 Mon Sep 17 00:00:00 2001 From: Peter Ahrens Date: Sun, 19 Sep 2021 17:51:39 -0400 Subject: [PATCH 3/6] add news --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index b1442f0192350..1c542835c0e95 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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. Language changes ---------------- From 319d27c39e696820b3bb410a2b9d798821e01c10 Mon Sep 17 00:00:00 2001 From: Peter Ahrens Date: Sun, 19 Sep 2021 22:14:02 -0400 Subject: [PATCH 4/6] add pr to news Co-authored-by: Steven G. Johnson --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index c7472817fd201..c4f7653a5cff0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,7 +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. +* `∀` and `∃` are now allowed as identifier characters ([#42314]). Language changes ---------------- From 5ac26bf10379a5283b284a7ec6ab7d3142672756 Mon Sep 17 00:00:00 2001 From: Peter Ahrens Date: Thu, 30 Sep 2021 14:59:02 -0400 Subject: [PATCH 5/6] add not exists --- src/flisp/julia_extensions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flisp/julia_extensions.c b/src/flisp/julia_extensions.c index 56698b74c7596..e4bb731355eb8 100644 --- a/src/flisp/julia_extensions.c +++ b/src/flisp/julia_extensions.c @@ -85,7 +85,7 @@ static int is_wc_cat_id_start(uint32_t wc, utf8proc_category_t cat) (wc >= 0x2200 && wc <= 0x2233 && (wc == 0x2202 || wc == 0x2205 || wc == 0x2206 || // ∂, ∅, ∆ wc == 0x2207 || wc == 0x220e || wc == 0x220f || // ∇, ∎, ∏ - wc == 0x2200 || wc == 0x2203 || // ∀, ∃ + wc == 0x2200 || wc == 0x2203 || wc == 0x2204 || // ∀, ∃, ∄ wc == 0x2210 || wc == 0x2211 || // ∐, ∑ wc == 0x221e || wc == 0x221f || // ∞, ∟ wc >= 0x222b)) || // ∫, ∬, ∭, ∮, ∯, ∰, ∱, ∲, ∳ From 081ef96b48399c37080255c6acf08107031e6710 Mon Sep 17 00:00:00 2001 From: Peter Ahrens Date: Thu, 30 Sep 2021 15:02:15 -0400 Subject: [PATCH 6/6] news and tests. --- NEWS.md | 2 +- test/syntax.jl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index c7472817fd201..cc79a35e0d542 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,7 +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. +* `∀`, `∃`, and `∄` are now allowed as identifier characters. Language changes ---------------- diff --git a/test/syntax.jl b/test/syntax.jl index d07401cbcfbc6..ecfc703635c29 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -2971,6 +2971,7 @@ end @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()