Skip to content

Commit

Permalink
Remove confusing unicode alternatives
Browse files Browse the repository at this point in the history
Resolves   #748.
  • Loading branch information
evhub committed May 25, 2023
1 parent b26781b commit 2c7c67b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
5 changes: 2 additions & 3 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1052,9 +1052,8 @@ _Note: these are only the default, built-in unicode operators. Coconut supports
≥ (\u2265) or ⊇ (\u2287) => ">="
⊊ (\u228a) => "<"
⊋ (\u228b) => ">"
∧ (\u2227) or ∩ (\u2229) => "&"
∨ (\u2228) or ∪ (\u222a) => "|"
⊻ (\u22bb) => "^"
∩ (\u2229) => "&"
∪ (\u222a) => "|"
« (\xab) => "<<"
» (\xbb) => ">>"
… (\u2026) => "..."
Expand Down
6 changes: 3 additions & 3 deletions coconut/compiler/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,9 @@ class Grammar(object):
| invalid_syntax("<?**..", "Coconut's None-aware backward keyword composition pipe is '<**?..', not '<?**..'")
)
amp_colon = Literal("&:")
amp = ~amp_colon + Literal("&") | fixto(Literal("\u2227") | Literal("\u2229"), "&")
caret = Literal("^") | fixto(Literal("\u22bb"), "^")
unsafe_bar = ~Literal("|>") + ~Literal("|*") + Literal("|") | fixto(Literal("\u2228") | Literal("\u222a"), "|")
amp = ~amp_colon + Literal("&") | fixto(Literal("\u2229"), "&")
caret = Literal("^")
unsafe_bar = ~Literal("|>") + ~Literal("|*") + Literal("|") | fixto(Literal("\u222a"), "|")
bar = ~rbanana + unsafe_bar | invalid_syntax("\xa6", "invalid broken bar character", greedy=True)
percent = Literal("%")
dollar = Literal("$")
Expand Down
3 changes: 0 additions & 3 deletions coconut/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,8 @@ def get_bool_env_var(env_var, default=False):
"\u2260", # !=
"\u2264", # <=
"\u2265", # >=
"\u2227", # &
"\u2229", # &
"\u2228", # |
"\u222a", # |
"\u22bb", # ^
"\xab", # <<
"\xbb", # >>
"\u2026", # ...
Expand Down
2 changes: 1 addition & 1 deletion coconut/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
VERSION = "3.0.1"
VERSION_NAME = None
# False for release, int >= 1 for develop
DEVELOP = 1
DEVELOP = 2
ALPHA = False # for pre releases rather than post releases

assert DEVELOP is False or DEVELOP >= 1, "DEVELOP must be False or an int >= 1"
Expand Down
2 changes: 1 addition & 1 deletion coconut/tests/src/cocotest/agnostic/suite.coco
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def suite_test() -> bool:
assert one_to_five([1,2,3,4,5]) == [2,3,4]
assert not one_to_five([0,1,2,3,4,5])
assert one_to_five([1,5]) == []
assert -4 == neg_square_u(2) ≠ 4 0 ≤ neg_square_u(0) ≤ 0
assert -4 == neg_square_u(2) ≠ 4 0 ≤ neg_square_u(0) ≤ 0
assert is_null(null1())
assert is_null(null2())
assert empty() |> depth_1 == 0 == empty() |> depth_2
Expand Down

0 comments on commit 2c7c67b

Please sign in to comment.