Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/parser/assembly
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10545/src/ccmtools/parser/assembly
Modified Files:
assembly.flex
Log Message:
don't remove escape sequences from strings
Index: assembly.flex
===================================================================
RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/parser/assembly/assembly.flex,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** assembly.flex 12 Feb 2007 14:08:31 -0000 1.2
--- assembly.flex 19 Feb 2007 09:38:48 -0000 1.3
***************
*** 59,64 ****
ScopedName = "::"? {Identifier} "::" {Identifier} ("::" {Identifier})*
! OctDigit = [0-7]
! StringCharacter = [^\r\n\"\\]
Number = {DecInteger} | {HexInteger} | {Double}
--- 59,63 ----
ScopedName = "::"? {Identifier} "::" {Identifier} ("::" {Identifier})*
! StringCharacter = [^\r\n\"]
Number = {DecInteger} | {HexInteger} | {Double}
***************
*** 127,145 ****
{StringCharacter}+ { string.append( yytext() ); }
- /* escape sequences */
- "\\b" { string.append( '\b' ); }
- "\\t" { string.append( '\t' ); }
- "\\n" { string.append( '\n' ); }
- "\\f" { string.append( '\f' ); }
- "\\r" { string.append( '\r' ); }
- "\\\"" { string.append( '\"' ); }
- "\\'" { string.append( '\'' ); }
- "\\\\" { string.append( '\\' ); }
- \\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8);
- string.append( val ); }
-
- /* error cases */
- \\. { throw new RuntimeException("Illegal escape sequence \""
- +yytext()+"\""); }
{LineTerminator} { throw new RuntimeException("Unterminated string at end of line"); }
}
--- 126,129 ----
|