Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Expose complex character classes to LTM
  • Loading branch information
sorear committed Nov 25, 2010
1 parent ccbb9b8 commit 85bf01e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Niecza/Actions.pm
Expand Up @@ -757,7 +757,13 @@ sub do_cclass { my ($cl, $M) = @_;
RxOp::CClassElem->new(cc => $_->{quibble}{_ast}) :
RxOp::Subrule->new(captures => [], method => $_->{name}->Str);

if ($sign) {
if ($exp->isa('RxOp::CClassElem') && (!$rxop || $rxop->isa('RxOp::CClassElem'))) {
if ($sign) {
$rxop = $rxop ? RxOp::CClassElem->new(cc => $exp->cc->plus($rxop->cc)) : $exp;
} else {
$rxop = RxOp::CClassElem->new(cc => ($rxop ? $rxop->cc : $CClass::Full)->minus($exp->cc));
}
} elsif ($sign) {
$rxop = $rxop ? RxOp::SeqAlt->new(zyg => [ $exp, $rxop ]) : $exp;
} else {
$rxop = RxOp::Sequence->new(zyg => [
Expand Down

0 comments on commit 85bf01e

Please sign in to comment.