Adding back in keywords.
Yes, I'm your hero, @algernon
This commit is contained in:
parent
f9b13a625f
commit
289586b340
@ -1399,10 +1399,19 @@ class HyASTCompiler(object):
|
||||
|
||||
return ret
|
||||
|
||||
@checkargs(1)
|
||||
def _compile_keyword_call(self, expression):
|
||||
expression.append(expression.pop(0))
|
||||
expression.insert(0, HySymbol("get"))
|
||||
return self.compile(expression)
|
||||
|
||||
@builds(HyExpression)
|
||||
def compile_expression(self, expression):
|
||||
fn = expression[0]
|
||||
func = None
|
||||
if isinstance(fn, HyKeyword):
|
||||
return self._compile_keyword_call(expression)
|
||||
|
||||
if isinstance(fn, HyString):
|
||||
ret = self.compile_atom(fn, expression)
|
||||
if ret:
|
||||
|
@ -732,3 +732,8 @@
|
||||
(defn test-encoding-nightmares []
|
||||
"NATIVE: test unicode encoding escaping crazybits"
|
||||
(assert (= (len "ℵℵℵ♥♥♥\t♥♥\r\n") 11)))
|
||||
|
||||
|
||||
(defn test-keyword-dict-access []
|
||||
"NATIVE: test keyword dict access"
|
||||
(assert (= "test" (:foo {:foo "test"}))))
|
||||
|
Loading…
Reference in New Issue
Block a user