Updated build of mojoshader_lexer.c ...
authorRyan C. Gordon <icculus@icculus.org>
Fri, 13 Feb 2009 00:37:26 -0500
changeset 600 f42d58194dc1
parent 599 cef9f9f0f4f4
child 601 bb1484be4e1b
Updated build of mojoshader_lexer.c ...
mojoshader_lexer.c
--- a/mojoshader_lexer.c	Fri Feb 13 00:37:02 2009 -0500
+++ b/mojoshader_lexer.c	Fri Feb 13 00:37:26 2009 -0500
@@ -1,5 +1,4 @@
-/* Generated by re2c 0.12.1 on Thu Feb 12 13:52:20 2009 */
-#line 1 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
+/* Generated by re2c 0.12.1 on Fri Feb 13 00:36:29 2009 */
 /**
  * MojoShader; generate shader programs from bytecode of compiled
  *  Direct3D shaders.
@@ -44,6 +43,7 @@
 {
     const uchar *cursor = (const uchar *) s->source;
     const uchar *token;
+    const uchar *matchptr;
     const uchar *limit = cursor + s->bytes_left;
     int saw_newline = 0;
 
@@ -53,11 +53,9 @@
     if (YYLIMIT == YYCURSOR)
         RET(TOKEN_EOI);
 
-#line 67 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 
 
 
-#line 61 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 {
 	YYCTYPE yych;
 	unsigned int yyaccept = 0;
@@ -172,17 +170,13 @@
 		if(yych <= '/') goto yy228;
 		if(yych == '=') goto yy226;
 	}
-#line 118 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('/'); }
-#line 178 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy4:
 	++YYCURSOR;
 	yych = *YYCURSOR;
 	goto yy225;
 yy5:
-#line 73 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_IDENTIFIER); }
-#line 186 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy6:
 	yyaccept = 0;
 	yych = *(YYMARKER = ++YYCURSOR);
@@ -206,9 +200,7 @@
 		}
 	}
 yy7:
-#line 77 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_INT_LITERAL); }
-#line 212 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy8:
 	yyaccept = 0;
 	yych = *(YYMARKER = ++YYCURSOR);
@@ -216,23 +208,21 @@
 yy9:
 	yyaccept = 1;
 	yych = *(YYMARKER = ++YYCURSOR);
-	if(yych != 0x0A) goto yy188;
+	if(yych == 0x0A) goto yy10;
+	if(yych != 0x0D) goto yy188;
 yy10:
-#line 147 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
-	{ printf("bad char\n"); goto scanner_loop; }
-#line 224 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
+	{ goto bad_chars; }
 yy11:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) <= '/') goto yy12;
 	if(yych <= '9') goto yy179;
 yy12:
-#line 110 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('.'); }
-#line 232 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy13:
 	yyaccept = 1;
 	yych = *(YYMARKER = ++YYCURSOR);
 	if(yych == 0x0A) goto yy10;
+	if(yych == 0x0D) goto yy10;
 	goto yy170;
 yy14:
 	++YYCURSOR;
@@ -240,76 +230,54 @@
 	if(yych <= '=') goto yy163;
 	if(yych <= '>') goto yy165;
 yy15:
-#line 121 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('>'); }
-#line 246 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy16:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) <= ';') goto yy17;
 	if(yych <= '<') goto yy159;
 	if(yych <= '=') goto yy157;
 yy17:
-#line 120 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('<'); }
-#line 255 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy18:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '+') goto yy153;
 	if(yych == '=') goto yy155;
-#line 116 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('+'); }
-#line 262 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy20:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '-') goto yy149;
 	if(yych == '=') goto yy151;
-#line 115 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('-'); }
-#line 269 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy22:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '=') goto yy147;
-#line 117 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('*'); }
-#line 275 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy24:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '=') goto yy145;
-#line 119 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('%'); }
-#line 281 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy26:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '=') goto yy143;
-#line 122 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('^'); }
-#line 287 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy28:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '&') goto yy139;
 	if(yych == '=') goto yy141;
-#line 112 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('&'); }
-#line 294 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy30:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '=') goto yy137;
 	if(yych == '|') goto yy135;
-#line 123 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('|'); }
-#line 301 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy32:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '=') goto yy133;
-#line 128 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('='); }
-#line 307 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy34:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '=') goto yy131;
-#line 113 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('!'); }
-#line 313 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy36:
 	yyaccept = 2;
 	yych = *(YYMARKER = ++YYCURSOR);
@@ -330,83 +298,53 @@
 		}
 	}
 yy37:
-#line 131 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('#'); }
-#line 336 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy38:
 	++YYCURSOR;
-#line 106 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('('); }
-#line 341 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy40:
 	++YYCURSOR;
-#line 107 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(')'); }
-#line 346 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy42:
 	++YYCURSOR;
-#line 108 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('['); }
-#line 351 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy44:
 	++YYCURSOR;
-#line 109 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(']'); }
-#line 356 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy46:
 	++YYCURSOR;
-#line 111 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(','); }
-#line 361 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy48:
 	++YYCURSOR;
-#line 114 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('~'); }
-#line 366 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy50:
 	++YYCURSOR;
-#line 124 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(':'); }
-#line 371 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy52:
 	++YYCURSOR;
-#line 125 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(';'); }
-#line 376 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy54:
 	++YYCURSOR;
-#line 126 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('{'); }
-#line 381 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy56:
 	++YYCURSOR;
-#line 127 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('}'); }
-#line 386 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy58:
 	++YYCURSOR;
-#line 129 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('?'); }
-#line 391 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy60:
 	++YYCURSOR;
-#line 130 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET('\\'); }
-#line 396 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy62:
 	++YYCURSOR;
 	yych = *YYCURSOR;
 	goto yy70;
 yy63:
-#line 145 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ goto scanner_loop; }
-#line 404 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy64:
 	++YYCURSOR;
 yy65:
-#line 146 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ s->line++; RET('\n'); }
-#line 410 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy66:
 	yych = *++YYCURSOR;
 	if(yych == 0x0A) goto yy68;
@@ -500,18 +438,14 @@
 	goto yy73;
 yy79:
 	++YYCURSOR;
-#line 105 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_HASHHASH); }
-#line 506 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy81:
 	yych = *++YYCURSOR;
 	if(yych != 'n') goto yy73;
 	yych = *++YYCURSOR;
 	if(yych != 'e') goto yy73;
 	++YYCURSOR;
-#line 134 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_LINE); }
-#line 515 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy85:
 	yych = *++YYCURSOR;
 	if(yych != 'f') goto yy73;
@@ -522,9 +456,7 @@
 	yych = *++YYCURSOR;
 	if(yych != 'e') goto yy73;
 	++YYCURSOR;
-#line 135 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_DEFINE); }
-#line 528 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy91:
 	yych = *++YYCURSOR;
 	if(yych != 'd') goto yy73;
@@ -533,9 +465,7 @@
 	yych = *++YYCURSOR;
 	if(yych != 'f') goto yy73;
 	++YYCURSOR;
-#line 136 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_UNDEF); }
-#line 539 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy96:
 	yych = *++YYCURSOR;
 	if(yych == 'c') goto yy108;
@@ -546,9 +476,7 @@
 	if(yych == 'd') goto yy100;
 	if(yych == 'n') goto yy99;
 yy98:
-#line 137 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_IF); }
-#line 552 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy99:
 	yych = *++YYCURSOR;
 	if(yych == 'd') goto yy104;
@@ -559,18 +487,14 @@
 	yych = *++YYCURSOR;
 	if(yych != 'f') goto yy73;
 	++YYCURSOR;
-#line 138 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_IFDEF); }
-#line 565 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy104:
 	yych = *++YYCURSOR;
 	if(yych != 'e') goto yy73;
 	yych = *++YYCURSOR;
 	if(yych != 'f') goto yy73;
 	++YYCURSOR;
-#line 139 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_IFNDEF); }
-#line 574 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy108:
 	yych = *++YYCURSOR;
 	if(yych != 'l') goto yy73;
@@ -581,9 +505,7 @@
 	yych = *++YYCURSOR;
 	if(yych != 'e') goto yy73;
 	++YYCURSOR;
-#line 133 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_INCLUDE); }
-#line 587 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy114:
 	yych = *++YYCURSOR;
 	if(yych == 'i') goto yy125;
@@ -601,18 +523,14 @@
 	yych = *++YYCURSOR;
 	if(yych != 'r') goto yy73;
 	++YYCURSOR;
-#line 143 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_ERROR); }
-#line 607 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy121:
 	yych = *++YYCURSOR;
 	if(yych != 'i') goto yy73;
 	yych = *++YYCURSOR;
 	if(yych != 'f') goto yy73;
 	++YYCURSOR;
-#line 142 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_ENDIF); }
-#line 616 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy125:
 	yych = *++YYCURSOR;
 	if(yych == 'f') goto yy129;
@@ -621,122 +539,85 @@
 	yych = *++YYCURSOR;
 	if(yych != 'e') goto yy73;
 	++YYCURSOR;
-#line 140 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_ELSE); }
-#line 627 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy129:
 	++YYCURSOR;
-#line 141 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_PP_ELIF); }
-#line 632 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy131:
 	++YYCURSOR;
-#line 104 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_NEQ); }
-#line 637 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy133:
 	++YYCURSOR;
-#line 103 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_EQL); }
-#line 642 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy135:
 	++YYCURSOR;
-#line 100 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_OROR); }
-#line 647 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy137:
 	++YYCURSOR;
-#line 94 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_ORASSIGN); }
-#line 652 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy139:
 	++YYCURSOR;
-#line 99 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_ANDAND); }
-#line 657 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy141:
 	++YYCURSOR;
-#line 93 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_ANDASSIGN); }
-#line 662 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy143:
 	++YYCURSOR;
-#line 92 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_XORASSIGN); }
-#line 667 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy145:
 	++YYCURSOR;
-#line 91 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_MODASSIGN); }
-#line 672 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy147:
 	++YYCURSOR;
-#line 89 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_MULTASSIGN); }
-#line 677 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy149:
 	++YYCURSOR;
-#line 96 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_DECREMENT); }
-#line 682 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy151:
 	++YYCURSOR;
-#line 88 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_SUBASSIGN); }
-#line 687 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy153:
 	++YYCURSOR;
-#line 95 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_INCREMENT); }
-#line 692 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy155:
 	++YYCURSOR;
-#line 87 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_ADDASSIGN); }
-#line 697 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy157:
 	++YYCURSOR;
-#line 101 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_LEQ); }
-#line 702 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy159:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '=') goto yy161;
-#line 98 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_LSHIFT); }
-#line 708 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy161:
 	++YYCURSOR;
-#line 86 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_LSHIFTASSIGN); }
-#line 713 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy163:
 	++YYCURSOR;
-#line 102 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_GEQ); }
-#line 718 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy165:
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '=') goto yy167;
-#line 97 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_RSHIFT); }
-#line 724 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy167:
 	++YYCURSOR;
-#line 85 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_RSHIFTASSIGN); }
-#line 729 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy169:
 	++YYCURSOR;
 	if(YYLIMIT == YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
 yy170:
-	if(yych <= '!') {
+	if(yych <= 0x0D) {
 		if(yych == 0x0A) goto yy73;
-		goto yy169;
+		if(yych <= 0x0C) goto yy169;
+		goto yy73;
 	} else {
-		if(yych <= '"') goto yy172;
-		if(yych != '\\') goto yy169;
+		if(yych <= '"') {
+			if(yych <= '!') goto yy169;
+			goto yy172;
+		} else {
+			if(yych != '\\') goto yy169;
+		}
 	}
 yy171:
 	++YYCURSOR;
@@ -785,9 +666,7 @@
 	}
 yy172:
 	++YYCURSOR;
-#line 83 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_STRING_LITERAL); }
-#line 791 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy174:
 	++YYCURSOR;
 	if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -806,12 +685,17 @@
 	++YYCURSOR;
 	if(YYLIMIT == YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-	if(yych <= '"') {
-		if(yych == 0x0A) goto yy73;
-		if(yych <= '!') goto yy169;
-		goto yy172;
+	if(yych <= '!') {
+		if(yych <= 0x0A) {
+			if(yych <= 0x09) goto yy169;
+			goto yy73;
+		} else {
+			if(yych == 0x0D) goto yy73;
+			goto yy169;
+		}
 	} else {
 		if(yych <= '7') {
+			if(yych <= '"') goto yy172;
 			if(yych <= '/') goto yy169;
 			goto yy175;
 		} else {
@@ -823,17 +707,18 @@
 	++YYCURSOR;
 	if(YYLIMIT == YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-	if(yych <= '9') {
-		if(yych <= '!') {
+	if(yych <= '/') {
+		if(yych <= 0x0C) {
 			if(yych == 0x0A) goto yy73;
 			goto yy169;
 		} else {
-			if(yych <= '"') goto yy172;
-			if(yych <= '/') goto yy169;
-			goto yy177;
+			if(yych <= 0x0D) goto yy73;
+			if(yych == '"') goto yy172;
+			goto yy169;
 		}
 	} else {
 		if(yych <= '[') {
+			if(yych <= '9') goto yy177;
 			if(yych <= '@') goto yy169;
 			if(yych <= 'F') goto yy177;
 			goto yy169;
@@ -867,9 +752,7 @@
 		}
 	}
 yy181:
-#line 80 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_FLOAT_LITERAL); }
-#line 873 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy182:
 	yych = *++YYCURSOR;
 	if(yych <= ',') {
@@ -915,12 +798,17 @@
 	if(YYLIMIT == YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
 yy188:
-	if(yych <= '&') {
+	if(yych <= 0x0D) {
 		if(yych == 0x0A) goto yy73;
-		goto yy187;
+		if(yych <= 0x0C) goto yy187;
+		goto yy73;
 	} else {
-		if(yych <= '\'') goto yy190;
-		if(yych != '\\') goto yy187;
+		if(yych <= '\'') {
+			if(yych <= '&') goto yy187;
+			goto yy190;
+		} else {
+			if(yych != '\\') goto yy187;
+		}
 	}
 yy189:
 	++YYCURSOR;
@@ -988,12 +876,17 @@
 	++YYCURSOR;
 	if(YYLIMIT == YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-	if(yych <= '\'') {
-		if(yych == 0x0A) goto yy73;
-		if(yych <= '&') goto yy187;
-		goto yy190;
+	if(yych <= '&') {
+		if(yych <= 0x0A) {
+			if(yych <= 0x09) goto yy187;
+			goto yy73;
+		} else {
+			if(yych == 0x0D) goto yy73;
+			goto yy187;
+		}
 	} else {
 		if(yych <= '7') {
+			if(yych <= '\'') goto yy190;
 			if(yych <= '/') goto yy187;
 			goto yy192;
 		} else {
@@ -1005,17 +898,18 @@
 	++YYCURSOR;
 	if(YYLIMIT == YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-	if(yych <= '9') {
-		if(yych <= '&') {
+	if(yych <= '/') {
+		if(yych <= 0x0C) {
 			if(yych == 0x0A) goto yy73;
 			goto yy187;
 		} else {
-			if(yych <= '\'') goto yy190;
-			if(yych <= '/') goto yy187;
-			goto yy194;
+			if(yych <= 0x0D) goto yy73;
+			if(yych == '\'') goto yy190;
+			goto yy187;
 		}
 	} else {
 		if(yych <= '[') {
+			if(yych <= '9') goto yy194;
 			if(yych <= '@') goto yy187;
 			if(yych <= 'F') goto yy194;
 			goto yy187;
@@ -1336,29 +1230,22 @@
 	}
 yy226:
 	++YYCURSOR;
-#line 90 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ RET(TOKEN_DIVASSIGN); }
-#line 1342 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy228:
 	++YYCURSOR;
-#line 71 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ goto singlelinecomment; }
-#line 1347 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy230:
 	++YYCURSOR;
-#line 70 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ goto multilinecomment; }
-#line 1352 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 }
-#line 148 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 
 
 multilinecomment:
     if (YYLIMIT == YYCURSOR)
         RET(TOKEN_PP_INCOMPLETE_COMMENT);
+    matchptr = cursor;
 // The "*\/" is just to avoid screwing up text editor syntax highlighting.
 
-#line 1362 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 {
 	YYCTYPE yych;
 	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -1373,20 +1260,16 @@
 	++YYCURSOR;
 	if((yych = *YYCURSOR) == '/') goto yy241;
 yy235:
-#line 166 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ goto multilinecomment; }
-#line 1379 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy236:
 	++YYCURSOR;
 yy237:
-#line 160 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{
                         s->line++;
-                        token = cursor-1;
+                        token = matchptr;
                         saw_newline = 1;
                         goto multilinecomment;
                     }
-#line 1390 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy238:
 	yych = *++YYCURSOR;
 	if(yych == 0x0A) goto yy240;
@@ -1399,22 +1282,19 @@
 	goto yy237;
 yy241:
 	++YYCURSOR;
-#line 155 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{
                         if (saw_newline)
                             RET('\n');
                         goto scanner_loop;
                     }
-#line 1409 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 }
-#line 167 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 
 
 singlelinecomment:
     if (YYLIMIT == YYCURSOR)
         RET(TOKEN_EOI);
+    matchptr = cursor;
 
-#line 1418 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 {
 	YYCTYPE yych;
 	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -1425,88 +1305,52 @@
 yy245:
 	++YYCURSOR;
 yy246:
-#line 173 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
-	{ s->line++; token = cursor-1; RET('\n'); }
-#line 1431 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
+	{ s->line++; token = matchptr; RET('\n'); }
 yy247:
 	yych = *++YYCURSOR;
 	if(yych == 0x0A) goto yy250;
 	goto yy246;
 yy248:
 	++YYCURSOR;
-#line 174 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 	{ goto singlelinecomment; }
-#line 1440 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 yy250:
 	++YYCURSOR;
 	yych = *YYCURSOR;
 	goto yy246;
 }
-#line 175 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 
 
-// !!! FIXME
-/*
 bad_chars:
     if (YYLIMIT == YYCURSOR)
-        RET(TOKEN_BAD_TOKEN);
-*/
+        RET(TOKEN_PP_BAD_CHARS);
 
 
-#line 1457 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
 {
 	YYCTYPE yych;
-	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+	if(YYLIMIT == YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-	if(yych <= 0x0C) {
-		if(yych <= 0x08) goto yy258;
-		if(yych != 0x0A) goto yy256;
+	if(yych <= '#') {
+		if(yych <= 0x1F) {
+			if(yych <= 0x08) goto yy255;
+			if(yych >= 0x0E) goto yy255;
+		} else {
+			if(yych == '"') goto yy255;
+		}
 	} else {
-		if(yych <= 0x0D) goto yy255;
-		if(yych == ' ') goto yy256;
-		goto yy258;
+		if(yych <= '@') {
+			if(yych <= '$') goto yy255;
+			if(yych >= '@') goto yy255;
+		} else {
+			if(yych == '`') goto yy255;
+			if(yych >= 0x7F) goto yy255;
+		}
 	}
 	++YYCURSOR;
-yy254:
-#line 185 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
-	{ s->line++; goto scanner_loop; }
-#line 1474 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
+	{ cursor--; RET(TOKEN_PP_BAD_CHARS); }
 yy255:
-	yych = *++YYCURSOR;
-	if(yych == 0x0A) goto yy262;
-	goto yy254;
-yy256:
-	++YYCURSOR;
-	yych = *YYCURSOR;
-	goto yy261;
-yy257:
-#line 186 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
-	{ goto scanner_loop; }
-#line 1486 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
-yy258:
 	++YYCURSOR;
-#line 187 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
-	{ goto singlelinecomment; }
-#line 1491 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
-yy260:
-	++YYCURSOR;
-	if(YYLIMIT == YYCURSOR) YYFILL(1);
-	yych = *YYCURSOR;
-yy261:
-	if(yych <= 0x0A) {
-		if(yych == 0x09) goto yy260;
-		goto yy257;
-	} else {
-		if(yych <= 0x0C) goto yy260;
-		if(yych == ' ') goto yy260;
-		goto yy257;
-	}
-yy262:
-	++YYCURSOR;
-	yych = *YYCURSOR;
-	goto yy254;
+	{ goto bad_chars; }
 }
-#line 188 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
 
 
     assert(0 && "Shouldn't hit this code");