Skip to content

Commit 53afb89

Browse files
committed
Bit by interaction in Function name and Unicode...
If an operator name like "Function" has unicode associated with it, then the YAML key *has* to be the operator name. This is because we are doing weird Function-name to unicode translation in *input* If there is an ASCII version of it like "&" for the function, then the YAML name doesn't have to match (since there is no auto unicode translation going on).
1 parent 2438a91 commit 53afb89

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

mathics_scanner/data/named-characters.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ Apply:
9595
is-letter-like: false
9696
operator-name: Apply
9797
# @@@ replaces heads at level 1 of expr by f.
98-
# We add "1" at the end so keys are unique, but
98+
# We add "3Ats" at the end so keys are unique, but
9999
# the WL operator is still "Apply".
100-
Apply1:
100+
Apply3Ats:
101101
ascii: "@@@"
102102
has-unicode-inverse: false
103103
is-letter-like: false
@@ -3469,15 +3469,22 @@ FreakedSmiley:
34693469
has-unicode-inverse: false
34703470
is-letter-like: true
34713471
wl-unicode: "\uF721"
3472-
# See also RawAmpersand
3473-
Function:
3474-
ascii: "&"
3475-
has-unicode-inverse: false
3476-
is-letter-like: false
3477-
operator-name: Function
3478-
# Alternative form of Function
3472+
34793473
# See also RightTeeArrow
3480-
Function1:
3474+
3475+
# IMPORTANT!
3476+
# ----------
3477+
# For the Mathics Parser to work circa 2021...
3478+
# If an operator name like "Function" has unicode associated with it, then
3479+
# the YAML key *has* to be the operator name.
3480+
# This is because we are doing weird Function-name to unicode translation
3481+
# in the parse.
3482+
#
3483+
# The auto-unicode translation might not be a good thing to do.
3484+
#
3485+
# The ASCII-only version of the Function operator therefore has a
3486+
# different (from the operator) YAML key name.
3487+
Function:
34813488
ascii: "|->"
34823489
has-unicode-inverse: false
34833490
is-letter-like: false
@@ -3486,6 +3493,15 @@ Function1:
34863493
unicode-equivalent-name: RIGHTWARDS ARROW FROM BAR
34873494
wl-unicode: "\uF4A1"
34883495
wl-unicode-name: RIGHTWARDS ARROW FROM BAR
3496+
3497+
# Alternative form of Function. We use FunctionAmpersand
3498+
# since Function is already taken. See note above.
3499+
# See also RawAmpersand.
3500+
FunctionAmpersand:
3501+
ascii: "&"
3502+
has-unicode-inverse: false
3503+
is-letter-like: false
3504+
operator-name: Function
34893505
Gamma:
34903506
esc-alias: g
34913507
has-unicode-inverse: false

mathics_scanner/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# This file is suitable for sourcing inside POSIX shell as
55
# well as importing into Python. That's why there is no
66
# space around "=" below.
7-
__version__="1.1.1" # noqa
7+
__version__="1.1.2.dev0" # noqa

0 commit comments

Comments
 (0)