Skip to content

Commit

Permalink
parse unicode forall and exists as identifiers (JuliaLang#42314)
Browse files Browse the repository at this point in the history
Co-authored-by: Steven G. Johnson <[email protected]>
  • Loading branch information
willow-ahrens and stevengj committed Oct 4, 2021
1 parent f985b47 commit 690517a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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

0 comments on commit 690517a

Please sign in to comment.