From 95d7b3cf67027a07da76f5254e93d5f595da266d Mon Sep 17 00:00:00 2001 From: mingodad Date: Mon, 8 Jan 2018 10:17:46 +0100 Subject: [PATCH 1/2] Fix for enums with initialization --- squirrel/sqcompiler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/squirrel/sqcompiler.cpp b/squirrel/sqcompiler.cpp index 9b1c205e..80ada017 100644 --- a/squirrel/sqcompiler.cpp +++ b/squirrel/sqcompiler.cpp @@ -1365,6 +1365,7 @@ class SQCompiler if(_token == _SC('=')) { Lex(); val = ExpectScalar(); + nval = _integer(val)+1; } else { val._type = OT_INTEGER; From da91ef2b3f46cee0c424554b954511aa169526d3 Mon Sep 17 00:00:00 2001 From: mingodad Date: Mon, 8 Jan 2018 10:35:33 +0100 Subject: [PATCH 2/2] Accept C/C++ style multiline string continuation. --- squirrel/sqlexer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/squirrel/sqlexer.cpp b/squirrel/sqlexer.cpp index 63c8f972..a679922d 100644 --- a/squirrel/sqlexer.cpp +++ b/squirrel/sqlexer.cpp @@ -409,6 +409,13 @@ SQInteger SQLexer::ReadString(SQInteger ndelim,bool verbatim) case _SC('\\'): APPEND_CHAR(_SC('\\')); NEXT(); break; case _SC('"'): APPEND_CHAR(_SC('"')); NEXT(); break; case _SC('\''): APPEND_CHAR(_SC('\'')); NEXT(); break; + case _SC('\n'): + if(ndelim == _SC('"')){ + _currentline++; + NEXT(); + break; + } + //fallthrough default: Error(_SC("unrecognised escaper char")); break;