Skip to content

Commit eab3633

Browse files
authored
Allow . characters in keyword names (#901)
Fixes #899
1 parent c4f6a31 commit eab3633

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
* Fix a bug where `.` characters were not allowed in keyword names (#899)
810

911
## [v0.1.0b2]
1012
### Added

src/basilisp/lang/reader.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,9 +1044,6 @@ def _read_kw(ctx: ReaderContext) -> kw.Keyword:
10441044
should_autoresolve = False
10451045

10461046
ns, name = _read_namespaced(ctx)
1047-
if "." in name:
1048-
raise ctx.syntax_error("Found '.' in keyword name")
1049-
10501047
if should_autoresolve:
10511048
current_ns = get_current_ns()
10521049
if ns is not None:

tests/basilisp/prompt_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ def test_multiline_input(self, handler: Binding, lines: Tuple[str]):
250250
"\\fakeescape",
251251
"#?@(:clj [:a :b :c])",
252252
"ns.of..a/badsymbol",
253-
":bad.keyword",
254253
],
255254
)
256255
def test_syntax_error(

tests/basilisp/reader_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ class TestKeyword:
422422
("kw", ":kw"),
423423
("kebab-kw", ":kebab-kw"),
424424
("underscore_kw", ":underscore_kw"),
425+
("dotted.kw", ":dotted.kw"),
425426
("kw?", ":kw?"),
426427
("+", ":+"),
427428
("?", ":?"),
@@ -460,7 +461,7 @@ def test_legal_ns_symbol(self, k: str, ns: str, raw: str):
460461
assert kw.keyword(k, ns=ns) == read_str_first(raw)
461462

462463
@pytest.mark.parametrize(
463-
"v", ["://", ":ns//kw", ":some/ns/sym", ":ns/sym/", ":/kw", ":dotted.kw"]
464+
"v", ["://", ":ns//kw", ":some/ns/sym", ":ns/sym/", ":/kw"]
464465
)
465466
def test_illegal_symbol(self, v: str):
466467
with pytest.raises(reader.SyntaxError):

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ deps =
5555
sphinx
5656
commands =
5757
pylint src/
58-
ruff src/
58+
ruff check src/
5959

6060
[testenv:safety]
6161
deps = safety
6262
commands =
63-
safety check -i 40291 -i 67599
63+
safety check -i 40291 -i 67599 -i 70612

0 commit comments

Comments
 (0)