diff options
author | Rich Hickey <richhickey@gmail.com> | 2007-09-19 12:47:01 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2007-09-19 12:47:01 +0000 |
commit | 22cc068ed0721477c222e4e7419ec7e71bca8713 (patch) | |
tree | 87c464346564f527bd1ce35cc0734cd5e4b2e1ca /src | |
parent | 2ec1a0d5d2a636c1a4686982c12d5a72a0ea59ce (diff) |
flow-through quoted literals
Diffstat (limited to 'src')
-rw-r--r-- | src/jvm/clojure/lang/Compiler.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index e6d58211..aefd72b2 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -894,7 +894,22 @@ static class QuoteExpr extends LiteralExpr{ static class Parser implements IParser{ public Expr parse(C context, Object form){ Object v = RT.second(form); - return new QuoteExpr(v); + + if(v == null) + return NIL_EXPR; + Class fclass = v.getClass(); + if(fclass == Keyword.class) + return registerKeyword((Keyword) v); + else if(v instanceof Num) + return new NumExpr((Num) v); + else if(fclass == String.class) + return new StringExpr((String) v); + else if(fclass == Character.class) + return new CharExpr((Character) v); + else if(v instanceof IPersistentCollection && ((IPersistentCollection) form).count() == 0) + return new EmptyExpr(v); + else + return new QuoteExpr(v); } } } |