diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-03-18 20:22:39 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-03-18 20:22:39 +0000 |
| commit | 22f5765125eea28ae158bab4d9e96ae6472b73d4 (patch) | |
| tree | 9338f48a3f070db36d95f34d4b51f861ede4c4d3 /src/main/java/org/zwobble/couscous/ast/LiteralNode.java | |
| parent | 8cb8183985558dbf722ed3c787431a58a27772e1 (diff) | |
Remove duplication of primitive types
Diffstat (limited to 'src/main/java/org/zwobble/couscous/ast/LiteralNode.java')
| -rw-r--r-- | src/main/java/org/zwobble/couscous/ast/LiteralNode.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/org/zwobble/couscous/ast/LiteralNode.java b/src/main/java/org/zwobble/couscous/ast/LiteralNode.java index f0e9af5..46a141e 100644 --- a/src/main/java/org/zwobble/couscous/ast/LiteralNode.java +++ b/src/main/java/org/zwobble/couscous/ast/LiteralNode.java @@ -1,13 +1,13 @@ package org.zwobble.couscous.ast; -import org.zwobble.couscous.types.ParameterizedType; -import org.zwobble.couscous.types.ScalarType; -import org.zwobble.couscous.types.Type; import org.zwobble.couscous.ast.visitors.ExpressionNodeMapper; import org.zwobble.couscous.ast.visitors.NodeTransformer; -import org.zwobble.couscous.values.*; +import org.zwobble.couscous.types.ScalarType; +import org.zwobble.couscous.types.Type; +import org.zwobble.couscous.values.PrimitiveValue; +import org.zwobble.couscous.values.PrimitiveValues; +import org.zwobble.couscous.values.TypeValue; -import static org.zwobble.couscous.util.ExtraLists.list; import static org.zwobble.couscous.values.PrimitiveValues.value; public class LiteralNode implements ExpressionNode { @@ -18,19 +18,19 @@ public class LiteralNode implements ExpressionNode { } public static LiteralNode literal(String value) { - return new LiteralNode(value(value), StringValue.REF); + return literal(value(value)); } public static LiteralNode literal(int value) { - return new LiteralNode(value(value), IntegerValue.REF); + return literal(value(value)); } public static LiteralNode literal(boolean value) { - return new LiteralNode(value(value), BooleanValue.REF); + return literal(value(value)); } public static LiteralNode literal(ScalarType type) { - return new LiteralNode(value(type), new ParameterizedType(ObjectValues.CLASS, list(type))); + return literal(value(type)); } public static LiteralNode of(PrimitiveValue value, Type type) { |
