Skip to content

Commit

Permalink
Allow strings in impl calls
Browse files Browse the repository at this point in the history
Resolves   #821.
  • Loading branch information
evhub committed Jan 18, 2024
1 parent 17ff2a3 commit e357041
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ test-any-of: test-univ
.PHONY: test-mypy-univ
test-mypy-univ: export COCONUT_USE_COLOR=TRUE
test-mypy-univ: clean
python ./coconut/tests --strict --keep-lines --force --mypy --follow-imports silent --ignore-missing-imports --allow-redefinition
python ./coconut/tests --strict --keep-lines --force --no-cache --mypy --follow-imports silent --ignore-missing-imports --allow-redefinition
python ./coconut/tests/dest/runner.py
python ./coconut/tests/dest/extras.py

# same as test-mypy-univ but uses --target sys
.PHONY: test-mypy
test-mypy: export COCONUT_USE_COLOR=TRUE
test-mypy: clean
python ./coconut/tests --strict --keep-lines --force --target sys --mypy --follow-imports silent --ignore-missing-imports --allow-redefinition
python ./coconut/tests --strict --keep-lines --force --target sys --no-cache --mypy --follow-imports silent --ignore-missing-imports --allow-redefinition
python ./coconut/tests/dest/runner.py
python ./coconut/tests/dest/extras.py

Expand Down Expand Up @@ -198,7 +198,7 @@ test-mypy-verbose: clean
.PHONY: test-mypy-all
test-mypy-all: export COCONUT_USE_COLOR=TRUE
test-mypy-all: clean
python ./coconut/tests --strict --keep-lines --force --target sys --mypy --follow-imports silent --ignore-missing-imports --allow-redefinition --check-untyped-defs
python ./coconut/tests --strict --keep-lines --force --target sys --no-cache --mypy --follow-imports silent --ignore-missing-imports --allow-redefinition --check-untyped-defs
python ./coconut/tests/dest/runner.py
python ./coconut/tests/dest/extras.py

Expand Down
1 change: 0 additions & 1 deletion coconut/compiler/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,6 @@ class Grammar(object):
) + Optional(power_in_impl_call))
impl_call_item = condense(
disallow_keywords(reserved_vars)
+ ~any_string
+ ~non_decimal_num
+ atom_item
+ Optional(power_in_impl_call)
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.4"
VERSION_NAME = None
# False for release, int >= 1 for develop
DEVELOP = 15
DEVELOP = 16
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
3 changes: 3 additions & 0 deletions coconut/tests/src/cocotest/agnostic/primary_2.coco
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ def primary_test_2() -> bool:
if"0":assert True
if"0":
assert True
b = "b"
assert "abc".find b == 1
assert_raises(-> "a" 10, TypeError)

with process_map.multiple_sequential_calls(): # type: ignore
assert map((+), range(3), range(4)$[:-1], strict=True) |> list == [0, 2, 4] == process_map((+), range(3), range(4)$[:-1], strict=True) |> list # type: ignore
Expand Down
4 changes: 0 additions & 4 deletions coconut/tests/src/extras.coco
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ def f() =
"\n ^",
"\n \\~~~~~^",
))
assert_raises(-> parse('"a" 10'), CoconutParseError, err_has=(
"\n ^",
"\n \\~~~^",
))
assert_raises(-> parse("A. ."), CoconutParseError, err_has=(
"\n \\~^",
"\n \\~~^",
Expand Down

0 comments on commit e357041

Please sign in to comment.