Permalink
Browse files

[java/compiler/JST.pm] add JST::Null and a $!type to JST::Literal

  • Loading branch information...
1 parent cc11e4f commit 5e43338ac32a93acf2e81040870900040fff2efc @mberends mberends committed Jan 22, 2011
Showing with 14 additions and 1 deletion.
  1. +14 −1 java/compiler/JST.pm
View
@@ -333,6 +333,7 @@ class JST::Bind is JST::Node {
class JST::Literal is JST::Node {
has $!value;
has $!escape;
+ has $!type;
method value($set?) {
if pir::defined($set) { $!value := $set }
@@ -344,14 +345,26 @@ class JST::Literal is JST::Node {
$!escape
}
- method new(:$value!, :$escape) {
+ method type($set?) {
+ if pir::defined($set) { $!type := $set }
+ $!type
+ }
+
+ method new(:$value!, :$escape, :$type) {
my $obj := self.CREATE;
$obj.value($value);
$obj.escape($escape);
+ $obj.type($type);
$obj;
}
}
+class JST::Null is JST::Node {
+ method new() {
+ self.CREATE
+ }
+}
+
class JST::ArrayLiteral is JST::Node {
has $!type;

0 comments on commit 5e43338

Please sign in to comment.