* support/Utils/dbuf_string.[ch]: added dbuf_chomp(),
[fw/sdcc] / src / SDCC.lex
index 1fc106256dbb66462bd6458ebb4f3b35ff4bc606..6567003c575dfd329e9cfdadf1736369e48975de 100644 (file)
@@ -1,6 +1,6 @@
 /*-----------------------------------------------------------------------
-  SDCC.lex - lexical analyser for use with sdcc ( a freeware compiler for
-  8/16 bit microcontrollers)
+  SDCC.lex - lexical analyser for use with sdcc (free open source
+  compiler for 8/16 bit microcontrollers)
   Written by : Sandeep Dutta . sandeep.dutta@usa.net (1997)
 
   This program is free software; you can redistribute it and/or modify it
@@ -383,7 +383,7 @@ static int check_type(void)
 
   /* check if it is in the table as a typedef */
   if (!ignoreTypedefType && sym && IS_SPEC (sym->etype)
-      && SPEC_TYPEDEF (sym->etype))
+      && SPEC_TYPEDEF (sym->etype) && findSym(TypedefTab, NULL, yytext))
     return (TYPE_NAME);
   else
     return(IDENTIFIER);
@@ -501,8 +501,10 @@ static const char *stringLiteral(void)
                       dbuf_destroy(&linebuf);
                     }
                   else
-                    unput(ch);
-                  break;
+                    {
+                      unput(ch);
+                      goto out;
+                    }
 
                 default:
                   count_char(ch);