fix e2 production to match regexp(6) and do it right this time
This commit is contained in:
parent
de5cabceaf
commit
7657312dcf
1 changed files with 7 additions and 4 deletions
|
@ -78,14 +78,17 @@ e2(Parselex *plex)
|
|||
Renode *n;
|
||||
|
||||
n = e3(plex);
|
||||
if(lex(plex) == LREP) {
|
||||
while(lex(plex) == LREP) {
|
||||
switch(plex->rune) {
|
||||
case L'*':
|
||||
return node(plex, TSTAR, n, nil);
|
||||
n = node(plex, TSTAR, n, nil);
|
||||
break;
|
||||
case L'+':
|
||||
return node(plex, TPLUS, n, nil);
|
||||
n = node(plex, TPLUS, n, nil);
|
||||
break;
|
||||
case L'?':
|
||||
return node(plex, TQUES, n, nil);
|
||||
n = node(plex, TQUES, n, nil);
|
||||
break;
|
||||
}
|
||||
}
|
||||
plex->peek = 1;
|
||||
|
|
Loading…
Reference in a new issue