libregexp/regcomp.c: fix parser for e2 production (thanks, spew)

This commit is contained in:
stanley lieber 2016-05-02 14:48:11 -04:00
parent 9ccbf1dcb1
commit 9c01b9a958

View file

@ -78,14 +78,14 @@ e2(Parselex *plex)
Renode *n; Renode *n;
n = e3(plex); n = e3(plex);
if(lex(plex) == LREP) { while(lex(plex) == LREP) {
switch(plex->rune) { switch(plex->rune) {
case L'*': case L'*':
return node(plex, TSTAR, n, nil); n = node(plex, TSTAR, n, nil);
case L'+': case L'+':
return node(plex, TPLUS, n, nil); n = node(plex, TPLUS, n, nil);
case L'?': case L'?':
return node(plex, TQUES, n, nil); n = node(plex, TQUES, n, nil);
} }
} }
plex->peek = 1; plex->peek = 1;