Skip to content

Commit

Permalink
Generate real PAST::Val nodes for literals.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcurtis committed Jul 20, 2010
1 parent 3a07019 commit 117541a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Squaak/Actions.pm
Expand Up @@ -298,8 +298,12 @@ method identifier($/) {
:node($/) );
}

method term:sym<integer_constant>($/) { make $<integer>.ast; }
method term:sym<string_constant>($/) { make $<quote>.ast; }
method term:sym<integer_constant>($/) {
make PAST::Val.new(:value($<integer>.ast), :returns<Integer>);
}
method term:sym<string_constant>($/) {
make PAST::Val.new(:value($<quote>.ast), :returns<String>);
}

method quote:sym<'>($/) { make $<quote_EXPR>.ast; }
method quote:sym<">($/) { make $<quote_EXPR>.ast; }
Expand Down

0 comments on commit 117541a

Please sign in to comment.