Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Turns out that fixing the negation of literals renders the backlit st…
…uff unrequired; remove it.
  • Loading branch information
jnthn committed Nov 20, 2011
1 parent 98ef1a1 commit cc3918c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
11 changes: 0 additions & 11 deletions src/QRegex/P6Regex/Actions.nqp
Expand Up @@ -304,12 +304,6 @@ class QRegex::P6Regex::Actions is HLL::Actions {
my $qast := QAST::Regex.new( ~$/ , :rxtype('literal'), :node($/) );
make $qast;
}

method backlit($/) {
my $qast := QAST::Regex.new( ~$/, :rxtype('enumcharlist'),
:node($/) );
make $qast;
}

method assertion:sym<?>($/) {
my $qast;
Expand Down Expand Up @@ -423,11 +417,6 @@ class QRegex::P6Regex::Actions is HLL::Actions {
$bs.negate(!$bs.negate) if $<sign> eq '-';
@alts.push($bs);
}
elsif $_<backlit> {
my $bslit := $_<backlit>.ast;
$bslit.negate(!$bslit.negate) if $<sign> eq '-';
@alts.push($bslit);
}
elsif $_[1] {
my $ord0 := nqp::ord($_[0]);
my $ord1 := nqp::ord($_[1][0]);
Expand Down
3 changes: 0 additions & 3 deletions src/QRegex/P6Regex/Grammar.nqp
Expand Up @@ -195,15 +195,12 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {

token assertion:sym<[> { <?before '['|'+'|'-'> <cclass_elem>+ }

token backlit { '\\' | '-' }

token cclass_elem {
$<sign>=['+'|'-'|<?>]
<.normspace>?
[
| '[' $<charspec>=(
|| \s* '-' <!before \s* ']'> <.obs: '- as character range','.. for range, for explicit - in character class, escape it or place as last thing'>
|| \s* '\\' <backlit>
|| \s* '\\' <backslash>
|| \s* (<-[\]\\]>) [ \s* '..' \s* (.) ]?
)*
Expand Down

0 comments on commit cc3918c

Please sign in to comment.