Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Eliminate isaPAST in favor of Protoobject.ACCEPTS.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Nov 15, 2009
1 parent ad79935 commit 26ad71a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/HLL/Actions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ our sub ints_to_string($ints) {
};
}

our sub isaPAST($x) {
Q:PIR {
$P0 = find_lex '$x'
$I0 = isa $P0, ['PAST';'Node']
%r = box $I0
}
}

method EXPR($/, $key?) {
unless $key { return 0; }
Expand Down Expand Up @@ -109,7 +102,7 @@ method binint($/) { make string_to_int( $/, 2 ); }
method quote_EXPR($/) {
my $past := $<quote_delimited>.ast;
if HLL::Grammar::quotemod_check($/, 'w') {
if isaPAST($past) {
if PAST::Node.ACCEPTS($past) {
$/.CURSOR.panic("Can't form :w list from non-constant strings (yet)");
}
else {
Expand All @@ -120,7 +113,7 @@ method quote_EXPR($/) {
}
}
}
if !isaPAST($past) {
if !PAST::Node.ACCEPTS($past) {
$past := PAST::Val.new( :value(~$past) );
}
make $past;
Expand All @@ -131,7 +124,7 @@ method quote_delimited($/) {
my $lastlit := '';
for $<quote_atom> {
my $ast := $_.ast;
if !isaPAST($ast) {
if !PAST::Node.ACCEPTS($ast) {
$lastlit := $lastlit ~ $ast;
}
elsif $ast.isa(PAST::Val) {
Expand Down

0 comments on commit 26ad71a

Please sign in to comment.