*** Regex.pm 1998/03/22 04:15:00 1.1 --- Regex.pm 1998/03/22 04:35:00 *************** *** 48,53 **** --- 48,55 ---- $PARSE_ERROR = "Did not expect $c!\n\t@seen\n\t*\n\t@_\n"; return undef; } + } elsif ($c eq '.') { + push @terms, [ DOT => undef ] } elsif ($c eq '\\') { push @terms, [ LITERAL => (shift) ]; } else { *************** *** 93,98 **** --- 95,103 ---- # So invoke the special atom-compiler and return that result instead. if ($operator eq LITERAL) { return $pack->literal($operands); + } elsif ($operator eq DOT) { + # `.' is like a literal, only special. + return $pack->literal(ANY); } my $startsym = "S" . &gensym(); *************** *** 303,310 **** sub transit { my $self = shift; my $symbol = shift; ! $self->{states} = $self->transition_table->{$symbol}; } # --- 308,324 ---- sub transit { my $self = shift; my $symbol = shift; + # $symbol is the symbol the machine just read. + + my $ttab = $self->transition_table(); ! $self->{states} = []; ! ! # We are allowed to make transitions to states when the arrow ! # is marked with $symbol or with ANY. ! foreach $ss (@{$ttab}{$symbol,ANY}) { ! push @{$self->{states}}, @$ss; ! } } #