Skip to content

Commit

Permalink
entry for \0 was missing in character classes
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Jan 1, 2016
1 parent 6a74da8 commit d86a422
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/QRegex/P6Regex/Actions.nqp
Expand Up @@ -492,6 +492,10 @@ class QRegex::P6Regex::Actions is HLL::Actions {
QAST::Regex.new( $<charspec>.ast, :rxtype('literal'), :node($/) )
}

method cclass_backslash:sym<0>($/) {
make QAST::Regex.new( "\0", :rxtype('literal'), :node($/) );
}

method cclass_backslash:sym<any>($/) {
my $qast := QAST::Regex.new( ~$/ , :rxtype('literal'), :node($/) );
make $qast;
Expand Down
1 change: 1 addition & 0 deletions src/QRegex/P6Regex/Grammar.nqp
Expand Up @@ -388,6 +388,7 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
token cclass_backslash:sym<o> { $<sym>=[<[oO]>] [ <octint> | '[' <octints> ']' ] }
token cclass_backslash:sym<x> { $<sym>=[<[xX]>] [ <hexint> | '[' <hexints> ']' ] }
token cclass_backslash:sym<c> { $<sym>=[<[cC]>] <charspec> }
token cclass_backslash:sym<0> { $<sym>=['0'] }
token cclass_backslash:sym<any> { . }

proto token assertion { <...> }
Expand Down

0 comments on commit d86a422

Please sign in to comment.