]> git.lizzy.rs Git - plan9front.git/commitdiff
libregexp/regcomp.c: fix parser for e2 production (thanks, spew)
authorstanley lieber <stanley.lieber@gmail.com>
Mon, 2 May 2016 18:48:11 +0000 (14:48 -0400)
committerstanley lieber <stanley.lieber@gmail.com>
Mon, 2 May 2016 18:48:11 +0000 (14:48 -0400)
sys/src/libregexp/regcomp.c

index c937ee5c9a007d399127ad312f5eec22a9bd8840..b54c77597b704b002ca3b7d287274f7f6f919bfc 100644 (file)
@@ -78,14 +78,14 @@ 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);
                case L'+':
-                       return node(plex, TPLUS, n, nil);
+                       n = node(plex, TPLUS, n, nil);
                case L'?':
-                       return node(plex, TQUES, n, nil);
+                       n = node(plex, TQUES, n, nil);
                }
        }
        plex->peek = 1;