blueloveTH 2 years ago
parent
commit
81feb7a245
2 changed files with 3 additions and 4 deletions
  1. 0 1
      src/config.h
  2. 3 3
      src/lexer.h

+ 0 - 1
src/config.h

@@ -64,7 +64,6 @@ inline const float kTypeAttrLoadFactor = 0.5f;
 #pragma warning (disable:4101)
 #pragma warning (disable:4244)
 #define _CRT_NONSTDC_NO_DEPRECATE
-#define strdup _strdup
 #endif
 
 #ifdef _MSC_VER

+ 3 - 3
src/lexer.h

@@ -394,7 +394,7 @@ struct Lexer {
                         }
                     }
                     SyntaxError("invalid special token");
-                }
+                } return false;
                 case '%': add_token_2('=', TK("%"), TK("%=")); return true;
                 case '&': add_token_2('=', TK("&"), TK("&=")); return true;
                 case '|': add_token_2('=', TK("|"), TK("|=")); return true;
@@ -481,8 +481,8 @@ struct Lexer {
                     switch (eat_name())
                     {
                         case 0: break;
-                        case 1: SyntaxError("invalid char: " + std::string(1, c));
-                        case 2: SyntaxError("invalid utf8 sequence: " + std::string(1, c));
+                        case 1: SyntaxError("invalid char: " + std::string(1, c)); break;
+                        case 2: SyntaxError("invalid utf8 sequence: " + std::string(1, c)); break;
                         case 3: SyntaxError("@id contains invalid char"); break;
                         case 4: SyntaxError("invalid JSON token"); break;
                         default: FATAL_ERROR();