Skip to content

Commit

Permalink
Fix alias dots
Browse files Browse the repository at this point in the history
_macro_ keys should be identifiers.
There's no valid use for `.` in local tags, so munge as if escaped.
  • Loading branch information
gilch committed Oct 30, 2024
1 parent 43b1162 commit 058dc75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/hissp/macros.lissp
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ See `hissp.macros`.
;; See also: `prelude`, `attach`, `hissp.alias`.
;;
;;
`(defmacro ,(.format "{}{}" abbreviation '#)
`(defmacro ,(.format "{}{}" (.replace abbreviation '. '\.) '#)
($#attr :/ : :* $#args :** $#kwargs)
',(.format "Aliases ``{}`` as ``{}#``." qualifier abbreviation)
(let ($#attr (if-else (hissp..is_control $#attr)
Expand Down
1 change: 1 addition & 0 deletions src/hissp/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ def _fully_qualified(tag: str):
return cast(Fn, reduce(getattr, function.split("."), import_module(module)))

def _local(self, tag: str):
tag = tag.replace(".", force_qz_encode("."))
try:
return getattr(self.lissp.env[C.MACROS], tag + munge("#"))
except (AttributeError, KeyError):
Expand Down

0 comments on commit 058dc75

Please sign in to comment.