Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
prepare to handle __DATA__ and __END__ blocks
Currently we only capture the content, but this way scripts
having this term are parseable.
  • Loading branch information
FROGGS committed Mar 30, 2013
1 parent 3922187 commit fbfa1ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Perl6/P5Actions.pm
Expand Up @@ -5316,6 +5316,10 @@ class Perl6::P5Actions is HLL::Actions does STDActions {
method quote:sym<" ">($/) { $DEBUG && say("method quote:sym<\" \">($/)"); make $<nibble>.ast; }
method quote:sym<` `>($/) { $DEBUG && say("method quote:sym<` `>($/)");
make QAST::Op.new( :name('&QX'), :op('call'), :node($/), $<nibble>.ast ); }
method quote:sym<__DATA__>($/) {
$DEBUG && say("method quote:sym<__DATA__>($/)");
# do something with $<text>
}
method quote:sym<qq>($/) { $DEBUG && say("method quote:sym<qq>($/)"); make $<quibble>.ast; }
method quote:sym<q>($/) { $DEBUG && say("method quote:sym<q>($/)"); make $<quibble>.ast; }
method quote:sym<Q>($/) { $DEBUG && say("method quote:sym<Q>($/)"); make $<quibble>.ast; }
Expand Down
1 change: 1 addition & 0 deletions lib/Perl6/P5Grammar.pm
Expand Up @@ -2721,6 +2721,7 @@ grammar Perl6::P5Grammar is HLL::Grammar does STD5 {
token quote:sym<' '> { :dba('single quotes') "'" ~ "'" <nibble(self.quote_lang(%*LANG<Q>, "'", "'", ['q']))> }
token quote:sym<" "> { :dba('double quotes') '"' ~ '"' <nibble(self.quote_lang(%*LANG<Q>, '"', '"', ['qq']))> }
token quote:sym<` `> { :dba('backticks') '`' ~ '`' <nibble(self.quote_lang(%*LANG<Q>, '`', '`', ['qq']))> }
token quote:sym<__DATA__> { :dba('pseudo filehandle') ^^ [ '__DATA__' | '__END__' ] \h* $<text>=[.*] }

# XXX why does this get picked up?
# token quote:sym«<<» { '<<'
Expand Down

0 comments on commit fbfa1ac

Please sign in to comment.