From 20dc1e124d606cf4298d5112b6d3c4f6c74e9b68 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 9 Mar 2016 18:11:17 +0000 Subject: Introduce Type interface --- src/main/java/org/zwobble/couscous/ast/LiteralNode.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/org/zwobble/couscous/ast/LiteralNode.java') diff --git a/src/main/java/org/zwobble/couscous/ast/LiteralNode.java b/src/main/java/org/zwobble/couscous/ast/LiteralNode.java index a76ca80..bb38562 100644 --- a/src/main/java/org/zwobble/couscous/ast/LiteralNode.java +++ b/src/main/java/org/zwobble/couscous/ast/LiteralNode.java @@ -1,5 +1,6 @@ package org.zwobble.couscous.ast; +import org.zwobble.couscous.ast.types.ScalarType; import org.zwobble.couscous.ast.visitors.ExpressionNodeMapper; import org.zwobble.couscous.ast.visitors.NodeTransformer; import org.zwobble.couscous.values.*; @@ -25,23 +26,23 @@ public class LiteralNode implements ExpressionNode { return new LiteralNode(value(value), BooleanValue.REF); } - public static LiteralNode literal(TypeName type) { + public static LiteralNode literal(ScalarType type) { return new LiteralNode(value(type), ObjectValues.CLASS); } - public static LiteralNode of(PrimitiveValue value, TypeName type) { + public static LiteralNode of(PrimitiveValue value, ScalarType type) { return new LiteralNode(value, type); } private final PrimitiveValue value; - private final TypeName type; + private final ScalarType type; - private LiteralNode(PrimitiveValue value, TypeName type) { + private LiteralNode(PrimitiveValue value, ScalarType type) { this.value = value; this.type = type; } - public TypeName getType() { + public ScalarType getType() { return type; } -- cgit v1.2.3