]> git.gag.com Git - fw/sdcc/commitdiff
fixed bug in stringLiteral()
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 20 Jan 2007 19:40:45 +0000 (19:40 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 20 Jan 2007 19:40:45 +0000 (19:40 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4588 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCC.lex

index f4c69a87bc5e029af6c675f7afdfc1b260b84ede..dd28b35ea431ca5847bf4de252dccd56644f57f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-20 Borut Razem <borut.razem AT siol.net>
+
+       * src/SDCC.lex, src/SDCCmain.c, sdc/SDCCglobl.h, doc/sdccman.lyx:
+         implemented RFE #1470316: allow "$" in variable names
+
 2007-01-20 Raphael Neider <rneider AT web.de>
 
        * device/include/pic/pic14regs.h: reverted accidental wipe of the file
index 06033d83aeede9aff65afb4162c738988657cf15..7fbe4e7f456ff670b835ff1518fd85f10682ee9e 100644 (file)
@@ -444,11 +444,10 @@ static const char *stringLiteral(void)
           dbuf_append_char(&dbuf, '"');  /* Pass end of this string or substring to evaluator */
           while ((ch = input()) && (isspace(ch) || ch == '\\' || ch == '#'))
             {
-              count_char(ch);
-
               switch (ch)
                 {
                 case '\\':
+                  count_char(ch);
                   if ((ch = input()) != '\n')
                     {
                       werror(W_STRAY_BACKSLASH, column);
@@ -457,9 +456,9 @@ static const char *stringLiteral(void)
                       else
                         count_char(ch);
                     }
-                    else
-                      count_char(ch);
-                    break;
+                  else
+                    count_char(ch);
+                  break;
 
                 case '\n':
                   count_char(ch);
@@ -472,6 +471,8 @@ static const char *stringLiteral(void)
                       struct dbuf_s linebuf;
                       const char *line;
 
+                      count_char(ch);
+
                       dbuf_init(&linebuf, STR_BUF_CHUNCK_LEN);
                       dbuf_append_char(&linebuf, '#');
 
@@ -491,6 +492,13 @@ static const char *stringLiteral(void)
 
                       dbuf_destroy(&linebuf);
                     }
+                  else
+                    unput(ch);
+                  break;
+
+                default:
+                  count_char(ch);
+                  break;
                 }
             }