Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[java/compiler/JST.pm] add JST::Null and a $!type to JST::Literal
  • Loading branch information
mberends committed Jan 22, 2011
1 parent cc11e4f commit 5e43338
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion java/compiler/JST.pm
Expand Up @@ -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 }
Expand All @@ -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;

Expand Down

0 comments on commit 5e43338

Please sign in to comment.