diff regexParser/regexParser.cc @ 287:2f3e7bba038e

fix \
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 31 Jan 2016 22:59:59 +0900
parents 3f3c9902bb6d
children 3e78631a6222
line wrap: on
line diff
--- a/regexParser/regexParser.cc	Sun Jan 31 22:07:53 2016 +0900
+++ b/regexParser/regexParser.cc	Sun Jan 31 22:59:59 2016 +0900
@@ -207,6 +207,11 @@
                 \\
                 \utf-8 etc...
             */
+            ri->ptr++;
+            ri->tokenType = 'a';
+            ri->tokenValue = ri->ptr;
+            ri->ptr++;
+            return;
         } else if (ri->ptr[0] == '[') {
             ri->ptr++;
             ri->tokenType = 'c';
@@ -215,9 +220,9 @@
         } else {
             ri->tokenType = 'a';
             ri->tokenValue = ri->ptr;
-            if (isalnum(ri->ptr[0])) {
+            // if (isalnum(ri->ptr[0])) {
                 ri->ptr++;
-            }
+            // }
             return;
         }
     }
@@ -237,6 +242,8 @@
         n = regex(ri);
         if (ri->tokenType != ')') {
             // error
+            fprintf(stderr,"unclosed ')' before %s \n", ri->ptr);
+            return createNode(ri,0,0,0,0);
         }
         token(ri);
     }