diff --git a/hy/lex/states.py b/hy/lex/states.py index dad9389..dcc14e7 100644 --- a/hy/lex/states.py +++ b/hy/lex/states.py @@ -61,6 +61,9 @@ def _resolve_atom(obj): if obj in table: return HySymbol(table[obj]) + if obj.startswith("*") and obj.endswith("*") and obj != "*": + obj = obj[1:-1].upper() + if "-" in obj and obj != "-": obj = obj.replace("-", "_") diff --git a/tests/native_tests/language.hy b/tests/native_tests/language.hy index 26cf266..9c079f4 100644 --- a/tests/native_tests/language.hy +++ b/tests/native_tests/language.hy @@ -124,3 +124,10 @@ (catch KeyError (do (+ 1 1) (assert (= 1 1)))))) + +(defn test-earmuffs [] + "NATIVE: Test earmuffs" + (def *foo* "2") + (def foo "3") + (assert (= *foo* FOO)) + (assert (!= *foo* foo)))