diff options
author | spew <devnull@localhost> | 2016-05-02 15:11:48 -0500 |
---|---|---|
committer | spew <devnull@localhost> | 2016-05-02 15:11:48 -0500 |
commit | 7657312dcf5b9435ff848b20dfc3a0546ab8a500 (patch) | |
tree | f21aa5320d93e59af6ac42dd41bc9c2aee29c811 | |
parent | de5cabceafbda54d1a7397e6297f5fc1fb4759ce (diff) |
fix e2 production to match regexp(6) and do it right this time
-rw-r--r-- | sys/src/libregexp/regcomp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/src/libregexp/regcomp.c b/sys/src/libregexp/regcomp.c index c937ee5c9..ad3b8cd96 100644 --- a/sys/src/libregexp/regcomp.c +++ b/sys/src/libregexp/regcomp.c @@ -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; |