]> granicus.if.org Git - re2c/commitdiff
- Detect eof in comment
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Fri, 20 Jan 2006 20:50:22 +0000 (20:50 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Fri, 20 Jan 2006 20:50:22 +0000 (20:50 +0000)
bootstrap/scanner.cc
scanner.re

index d4a87c020a1df59611457849f8fe9f9132b2e220..515e38e9b0c06919a62053b4a703fb9abb716f68 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.10.0.dev on Fri Jan 20 21:17:47 2006 */
+/* Generated by re2c 0.10.0.dev on Fri Jan 20 21:46:02 2006 */
 #line 1 "scanner.re"
 /* $Id$ */
 #include <stdlib.h>
@@ -805,8 +805,9 @@ yy132:
        if((yych = *YYCURSOR) == '/') goto yy140;
 yy133:
 #line 281 "scanner.re"
-       { goto comment; }
-#line 810 "scanner.cc"
+       { if(cursor == eof) RETURN(0);
+                                 goto comment; }
+#line 811 "scanner.cc"
 yy134:
        yych = *++YYCURSOR;
        if(yych == '*') goto yy138;
@@ -818,7 +819,7 @@ yy135:
                                  tok = pos = cursor; cline++;
                                  goto comment;
                                }
-#line 822 "scanner.cc"
+#line 823 "scanner.cc"
 yy137:
        yych = *++YYCURSOR;
        goto yy133;
@@ -828,7 +829,7 @@ yy138:
        { ++depth;
                                  fatal("ambiguous /* found");
                                  goto comment; }
-#line 832 "scanner.cc"
+#line 833 "scanner.cc"
 yy140:
        ++YYCURSOR;
 #line 270 "scanner.re"
@@ -836,14 +837,14 @@ yy140:
                                        goto scan;
                                    else
                                        goto comment; }
-#line 840 "scanner.cc"
+#line 841 "scanner.cc"
 }
-#line 282 "scanner.re"
+#line 283 "scanner.re"
 
 
 config:
 
-#line 847 "scanner.cc"
+#line 848 "scanner.cc"
 {
        YYCTYPE yych;
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -860,25 +861,25 @@ yy144:
        yych = *YYCURSOR;
        goto yy153;
 yy145:
-#line 286 "scanner.re"
+#line 287 "scanner.re"
        { goto config; }
-#line 866 "scanner.cc"
+#line 867 "scanner.cc"
 yy146:
        ++YYCURSOR;
        yych = *YYCURSOR;
        goto yy151;
 yy147:
-#line 287 "scanner.re"
+#line 288 "scanner.re"
        { iscfg = 2;
                                  cur = cursor;
                                  RETURN('='); 
                                }
-#line 877 "scanner.cc"
+#line 878 "scanner.cc"
 yy148:
        ++YYCURSOR;
-#line 291 "scanner.re"
+#line 292 "scanner.re"
        { fatal("missing '='"); }
-#line 882 "scanner.cc"
+#line 883 "scanner.cc"
 yy150:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -896,12 +897,12 @@ yy153:
        if(yych == ' ') goto yy152;
        goto yy145;
 }
-#line 292 "scanner.re"
+#line 293 "scanner.re"
 
 
 value:
 
-#line 905 "scanner.cc"
+#line 906 "scanner.cc"
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
@@ -935,13 +936,13 @@ value:
                }
        }
 yy156:
-#line 301 "scanner.re"
+#line 302 "scanner.re"
        { cur = cursor;
                                  yylval.str = new Str(token());
                                  iscfg = 0;
                                  return VALUE;
                                }
-#line 945 "scanner.cc"
+#line 946 "scanner.cc"
 yy157:
        ++YYCURSOR;
        if((yych = *YYCURSOR) <= 0x0D) {
@@ -956,13 +957,13 @@ yy157:
                }
        }
 yy158:
-#line 296 "scanner.re"
+#line 297 "scanner.re"
        { cur = cursor;
                                  yylval.number = atoi(token().to_string().c_str());
                                  iscfg = 0;
                                  return NUMBER;
                                }
-#line 966 "scanner.cc"
+#line 967 "scanner.cc"
 yy159:
        yych = *++YYCURSOR;
        if(yych <= '0') goto yy163;
@@ -1142,7 +1143,7 @@ yy177:
        if(yych == 0x0A) goto yy170;
        goto yy174;
 }
-#line 306 "scanner.re"
+#line 307 "scanner.re"
 
 }
 
index b6fd6b1042da2744df77aae0258cf4c3704781b4..16e957b5ab08fc218bbbb6b565d7b818f7792ed9 100644 (file)
@@ -278,7 +278,8 @@ comment:
                                  tok = pos = cursor; cline++;
                                  goto comment;
                                }
-       any                     { goto comment; }
+       any                     { if(cursor == eof) RETURN(0);
+                                 goto comment; }
 */
 
 config: