diff --git a/src/dev/onionpancakes/chassis/compiler.clj b/src/dev/onionpancakes/chassis/compiler.clj index 8d91c7b..a91518d 100644 --- a/src/dev/onionpancakes/chassis/compiler.clj +++ b/src/dev/onionpancakes/chassis/compiler.clj @@ -273,6 +273,18 @@ ;; Works for now... (if (constant? val) val this)) this)) + java.util.Date + (attrs? [_] false) + (not-attrs? [_] true) + (constant? [_] false) ; Not constant because not immutable. + (evaluated? [_] true) + (resolved [this] this) + java.util.UUID + (attrs? [_] false) + (not-attrs? [_] true) + (constant? [_] true) + (evaluated? [_] true) + (resolved [this] this) String (attrs? [_] false) (not-attrs? [_] true) diff --git a/test/dev/onionpancakes/chassis/tests/test_compiler.clj b/test/dev/onionpancakes/chassis/tests/test_compiler.clj index adf62da..f298538 100644 --- a/test/dev/onionpancakes/chassis/tests/test_compiler.clj +++ b/test/dev/onionpancakes/chassis/tests/test_compiler.clj @@ -46,6 +46,8 @@ #{} '() [] + #inst "2007-01-04" + #uuid "00000000-0000-0000-0000-000000000000" [:div] [:div nil] @@ -140,12 +142,15 @@ 0.0M 3/2 "" + #uuid "00000000-0000-0000-0000-000000000000" + [:div] [:div#foo.bar "123"] [:div {:foo "bar"} "123"] [:div [:p "foo"] [:p "bar"]] [:div [1 2 3 4]] [:div #{1 2 3 4}] + [:div #uuid "00000000-0000-0000-0000-000000000000"] ;; Macros (example-elem-macro "123") @@ -168,6 +173,8 @@ 0.0M 3/2 "" + #uuid "00000000-0000-0000-0000-000000000000" + (short 0) (int 0) (long 0) @@ -183,6 +190,7 @@ [:div [:p "foo"] [:p "bar"]] [:div [1 2 3 4]] [:div #{1 2 3 4}] + [:div #uuid "00000000-0000-0000-0000-000000000000"] ;; Alias [::Foo] @@ -219,6 +227,10 @@ (do ;; Compile attrs reflection examples + ;; Tagged literals + (cc/compile [:div #inst "2007-01-04"]) + (cc/compile [:div #uuid "00000000-0000-0000-0000-000000000000"]) + ;; java.util.Map (let [attrs nil] (cc/compile [:div ^java.util.Map attrs "foobar"]))