[Z88dk-commits] CVS: z88dk/src/z80asm/t whitebox-scan.t,1.37,1.38

Bridge to the z88dk-commits mailing list
Post Reply
pauloscustodio

[Z88dk-commits] CVS: z88dk/src/z80asm/t whitebox-scan.t,1.37,1.38

Post by pauloscustodio »

Update of /cvsroot/z88dk/z88dk/src/z80asm/t
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15532/t

Modified Files:
whitebox-scan.t
Log Message:
CH_0023: Accept C-like escape sequences in character constants and strings
Accepts \a, \b, \e (0x1B), \f, \n, \r, \t, \v, \{any character}, \{octal}, \x{hexadecimal}, allows \0 within the string.
Existing code may have to be modified, e.g. defb '\' --> defb '\\'

Index: whitebox-scan.t
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/z80asm/t/whitebox-scan.t,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** whitebox-scan.t 29 Mar 2014 00:33:29 -0000 1.37
--- whitebox-scan.t 30 Mar 2014 10:39:51 -0000 1.38
***************
*** 66,69 ****
--- 66,73 ----
assert( strcmp( tok_string, exp_string ) == 0 );

+ #define T_STRING_N( exp_string, n ) \
+ T_GET( TK_STRING, "" ); \
+ assert( memcmp( tok_string, exp_string, n ) == 0 );
+
#define T_NEWLINE() \
T_GET( TK_NEWLINE, "\n" ); assert( EOL ); \
***************
*** 487,506 ****

/* strings - single-quote */
! SetTemporaryLine( "' \n"
! "'a \n"
! "'' \n"
! "'a' \n"
! "'aa' \n"
"0");
T_NUMBER(0);
T_NEWLINE();
T_NUMBER(0);
T_NEWLINE();
T_NUMBER(0);
T_NEWLINE();
T_NUMBER('a');
T_NEWLINE();
T_NUMBER(0);
T_NEWLINE();
T_NUMBER(0);
T_END();
--- 491,531 ----

/* strings - single-quote */
! SetTemporaryLine( "'\n"
! "'a\n"
! "''\n"
! "'a'\n"
! "'aa'\n"
! "'\\a''\\b''\\f''\\n''\\r''\\t''\\v'"
! "'\\\\''\\'''\\0''\\377''\\xff'\n"
"0");
T_NUMBER(0);
T_NEWLINE();
+
T_NUMBER(0);
T_NEWLINE();
+
T_NUMBER(0);
T_NEWLINE();
+
T_NUMBER('a');
T_NEWLINE();
+
T_NUMBER(0);
T_NEWLINE();
+
+ T_NUMBER(7);
+ T_NUMBER(8);
+ T_NUMBER(12);
+ T_NUMBER(10);
+ T_NUMBER(13);
+ T_NUMBER(9);
+ T_NUMBER(11);
+ T_NUMBER('\\');
+ T_NUMBER('\'');
+ T_NUMBER(0);
+ T_NUMBER(-1);
+ T_NUMBER(-1);
+ T_NEWLINE();
+
T_NUMBER(0);
T_END();
***************
*** 508,528 ****

/* strings - double-quote */
! SetTemporaryLine( "\" \n"
! "\"a \n"
! "\"\" \n"
! "\"a\" \n"
! "\"aa\" \n"
! "\"\"");
T_STRING("");
T_NEWLINE();
T_STRING("");
T_NEWLINE();
T_STRING("");
T_NEWLINE();
T_STRING("a");
T_NEWLINE();
T_STRING("aa");
T_NEWLINE();
T_STRING("");
T_END();

--- 533,567 ----

/* strings - double-quote */
! SetTemporaryLine( "\"\n"
! "\"a\n"
! "\"\"\n"
! "\"a\"\n"
! "\"aa\"\n"
! "\"\"\n"
! "\"\\a\\b\\f\\n\\r\\t\\v"
! "\\\\" "\\\"" "\\0\\377\\xff\"\n"
! "0");
T_STRING("");
T_NEWLINE();
+
T_STRING("");
T_NEWLINE();
+
T_STRING("");
T_NEWLINE();
+
T_STRING("a");
T_NEWLINE();
+
T_STRING("aa");
T_NEWLINE();
+
T_STRING("");
+ T_NEWLINE();
+
+ T_STRING_N("\a\b\f\n\r\t\v\\\"\0\xff\xff", 12);
+ T_NEWLINE();
+
+ T_NUMBER(0);
T_END();

***************
*** 544,547 ****
--- 583,591 ----

# $Log$
+ # Revision 1.38 2014/03/30 10:39:51 pauloscustodio
+ # CH_0023: Accept C-like escape sequences in character constants and strings
+ # Accepts \a, \b, \e (0x1B), \f, \n, \r, \t, \v, \{any character}, \{octal}, \x{hexadecimal}, allows \0 within the string.
+ # Existing code may have to be modified, e.g. defb '\' --> defb '\\'
+ #
# Revision 1.37 2014/03/29 00:33:29 pauloscustodio
# BUG_0044: binary constants with more than 8 bits not accepted


------------------------------------------------------------------------------
Post Reply