sub _Lexer { for( $input ) { if( @heredoc ) { /\A(.*?)\n$heredoc[0][0]/s or die "Unterminated heredoc"; $strings[ $heredoc[0][1] ] = $1; shift @heredoc; } s/^\s*//; return ($1,$1) if s/^([;.])//; return ('IDENT',$1) if s/^(\w+)//; if( s/^<<(\w+)// ) { push @heredoc, [ $1, $id ]; return ( 'HEREDOC', $id++ ); } } return ('',undef); }