Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[dotnet] Add an (optional) type attr to DNST::Literal.
  • Loading branch information
jnthn committed Dec 4, 2010
1 parent e2f7447 commit a4cb083
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dotnet/compiler/DNST.pm
Expand Up @@ -375,6 +375,7 @@ class DNST::Bind is DNST::Node {
class DNST::Literal is DNST::Node {
has $!value;
has $!escape;
has $!type;

method value($set?) {
if pir::defined($set) { $!value := $set }
Expand All @@ -386,10 +387,16 @@ class DNST::Literal is DNST::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;
}
}
Expand Down

0 comments on commit a4cb083

Please sign in to comment.