Skip to content

Commit

Permalink
Swap unicode multiplication operators
Browse files Browse the repository at this point in the history
Resolves #393.
  • Loading branch information
evhub committed Feb 16, 2018
1 parent 3dd32ae commit ee8de8c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ Coconut supports Unicode alternatives to many different operator symbols. The Un
*↦ (*\u21a6) => "|*>"
↤ (\u21a4) => "<|"
↤* (\u21a4*) => "<*|"
(\u22c5) => "*"
× (\xd7) => "*"
↑ (\u2191) => "**"
÷ (\xf7) => "/"
÷/ (\xf7/) => "//"
Expand All @@ -578,7 +578,7 @@ Coconut supports Unicode alternatives to many different operator symbols. The Un
« (\xab) => "<<"
» (\xbb) => ">>"
… (\u2026) => "..."
× (\xd7) => "@" (only matrix multiplication)
(\u22c5) => "@" (only matrix multiplication)
```

## Keywords
Expand Down Expand Up @@ -974,7 +974,7 @@ def (arguments) -> statement; statement; ...
```
where `arguments` can be standard function arguments or [pattern-matching function definition](#pattern-matching-functions) arguments and `statement` can be an assignment statement or a keyword statement. If the last `statement` (not followed by a semicolon) is an `expression`, it will automatically be returned.

Statement lambdas also support implicit lambda syntax, where when the arguments are omitted, as in `def -> _`, `def (_=None) -> _` is assumed.
Statement lambdas also support implicit lambda syntax, where, as in `def -> _`, when the arguments are omitted, `def (_=None) -> _` is assumed.

##### Example

Expand Down
4 changes: 2 additions & 2 deletions coconut/compiler/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,13 +785,13 @@ class Grammar(object):
ge = Literal(">=") | fixto(Literal("\u2265"), ">=")
ne = Literal("!=") | fixto(Literal("\xac=") | Literal("\u2260"), "!=")

mul_star = star | fixto(Literal("\u22c5"), "*")
mul_star = star | fixto(Literal("\xd7"), "*")
exp_dubstar = dubstar | fixto(Literal("\u2191"), "**")
neg_minus = minus | fixto(Literal("\u207b"), "-")
sub_minus = minus | fixto(Literal("\u2212"), "-")
div_slash = slash | fixto(Literal("\xf7") + ~slash, "/")
div_dubslash = dubslash | fixto(Combine(Literal("\xf7") + slash), "//")
matrix_at_ref = at | fixto(Literal("\xd7"), "@")
matrix_at_ref = at | fixto(Literal("\u22c5"), "@")
matrix_at = Forward()

test = Forward()
Expand Down
2 changes: 1 addition & 1 deletion tests/src/cocotest/agnostic/main.coco
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,6 @@ def main(*args):
assert target_sys_test()

print(".", end="") # ........
from . import tutorial
from . import tutorial # NOQA

print("\n<success>")
2 changes: 1 addition & 1 deletion tests/src/cocotest/agnostic/specific.coco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from io import StringIO # type: ignore

from .util import mod
from .util import mod # NOQA

def non_py26_test():
"""Tests for any non-py26 version."""
Expand Down

0 comments on commit ee8de8c

Please sign in to comment.