A couple endline fixes in the lexer.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 12 Feb 2009 20:41:01 -0500
changeset 594 de6f8df3b4fe
parent 593 cce8924a022e
child 595 a72705c067dc
A couple endline fixes in the lexer.
mojoshader_lexer.re
--- a/mojoshader_lexer.re	Thu Feb 12 19:00:06 2009 -0500
+++ b/mojoshader_lexer.re	Thu Feb 12 20:41:01 2009 -0500
@@ -62,7 +62,7 @@
     IS = [uUlL]*;
     ESC = [\\] ([abfnrtv?'"\\] | "x" H+ | O+);
     PP = "#" [ \t]*;
-    NEWLINE = "\r\n" | "\r" | "\n";
+    NEWLINE = ("\r\n" | "\r" | "\n");
     WHITESPACE = [ \t\v\f]+;
 */
 
@@ -73,13 +73,13 @@
     L (L|D)*        { RET(TOKEN_IDENTIFIER); }
     
     ("0" [xX] H+ IS?) | ("0" D+ IS?) | (D+ IS?) |
-    (['] (ESC|any\[\n\\'])* ['])
+    (['] (ESC|any\[\r\n\\'])* ['])
                     { RET(TOKEN_INT_LITERAL); }
     
     (D+ E FS?) | (D* "." D+ E? FS?) | (D+ "." D* E? FS?)
                     { RET(TOKEN_FLOAT_LITERAL); }
     
-    (["] (ESC|any\[\n\\"])* ["])
+    (["] (ESC|any\[\r\n\\"])* ["])
                     { RET(TOKEN_STRING_LITERAL); }
     
     ">>="           { RET(TOKEN_RSHIFTASSIGN); }