# HG changeset patch # User Masataka Kohagura # Date 1448977858 -32400 # Node ID f827682d4687c05107ae124971b1b61baa106840 # Parent b061cd8205ccc577037f29f80eaf85cc15b5fed8 fix diff -r b061cd8205cc -r f827682d4687 c/regexParser/regexParser.cc --- a/c/regexParser/regexParser.cc Tue Dec 01 21:50:09 2015 +0900 +++ b/c/regexParser/regexParser.cc Tue Dec 01 22:50:58 2015 +0900 @@ -166,13 +166,15 @@ token(ri); NodePtr n = NULL; if (ri->tokenType == 'c') n = charClass(ri); + if (ri->tokenType == 'a') n = literal(ri); + if (ri->tokenType == '(') n = group(ri); return n; } // ::= | '*' | '|' | | '(' regex ')' NodePtr regex(RegexInfoPtr ri) { - NodePtr n = NULL; + NodePtr n = regexAtom(ri); while (ri->ptr[0]) { token(ri); if (ri->tokenType == '*') { @@ -182,11 +184,6 @@ n = createNode(ri,'|',n,n1); } else if (ri->tokenType == ')') { return n; - } else if (ri->tokenType == 'a') { - NodePtr n1 = literal(ri); - unsigned char *syntax = (unsigned char*)malloc(sizeof(unsigned char)); - syntax[0] = '+'; - n = createNode(ri,syntax,n,n1); } else { // return NULL NodePtr n1 = regex(ri);