vbscript: Use wide char literals for lexer keywords.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-10-29 19:01:02 +01:00 committed by Alexandre Julliard
parent 0357dfbc7e
commit 55e9c896ca
1 changed files with 57 additions and 115 deletions

View File

@ -28,125 +28,67 @@
WINE_DEFAULT_DEBUG_CHANNEL(vbscript); WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
static const WCHAR andW[] = {'a','n','d',0};
static const WCHAR byrefW[] = {'b','y','r','e','f',0};
static const WCHAR byvalW[] = {'b','y','v','a','l',0};
static const WCHAR callW[] = {'c','a','l','l',0};
static const WCHAR caseW[] = {'c','a','s','e',0};
static const WCHAR classW[] = {'c','l','a','s','s',0};
static const WCHAR constW[] = {'c','o','n','s','t',0};
static const WCHAR defaultW[] = {'d','e','f','a','u','l','t',0};
static const WCHAR dimW[] = {'d','i','m',0};
static const WCHAR doW[] = {'d','o',0};
static const WCHAR eachW[] = {'e','a','c','h',0};
static const WCHAR elseW[] = {'e','l','s','e',0};
static const WCHAR elseifW[] = {'e','l','s','e','i','f',0};
static const WCHAR emptyW[] = {'e','m','p','t','y',0};
static const WCHAR endW[] = {'e','n','d',0};
static const WCHAR eqvW[] = {'e','q','v',0};
static const WCHAR errorW[] = {'e','r','r','o','r',0};
static const WCHAR exitW[] = {'e','x','i','t',0};
static const WCHAR explicitW[] = {'e','x','p','l','i','c','i','t',0};
static const WCHAR falseW[] = {'f','a','l','s','e',0};
static const WCHAR forW[] = {'f','o','r',0};
static const WCHAR functionW[] = {'f','u','n','c','t','i','o','n',0};
static const WCHAR getW[] = {'g','e','t',0};
static const WCHAR gotoW[] = {'g','o','t','o',0};
static const WCHAR ifW[] = {'i','f',0};
static const WCHAR impW[] = {'i','m','p',0};
static const WCHAR inW[] = {'i','n',0};
static const WCHAR isW[] = {'i','s',0};
static const WCHAR letW[] = {'l','e','t',0};
static const WCHAR loopW[] = {'l','o','o','p',0};
static const WCHAR meW[] = {'m','e',0};
static const WCHAR modW[] = {'m','o','d',0};
static const WCHAR newW[] = {'n','e','w',0};
static const WCHAR nextW[] = {'n','e','x','t',0};
static const WCHAR notW[] = {'n','o','t',0};
static const WCHAR nothingW[] = {'n','o','t','h','i','n','g',0};
static const WCHAR nullW[] = {'n','u','l','l',0};
static const WCHAR onW[] = {'o','n',0};
static const WCHAR optionW[] = {'o','p','t','i','o','n',0};
static const WCHAR orW[] = {'o','r',0};
static const WCHAR privateW[] = {'p','r','i','v','a','t','e',0};
static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0};
static const WCHAR publicW[] = {'p','u','b','l','i','c',0};
static const WCHAR remW[] = {'r','e','m',0};
static const WCHAR resumeW[] = {'r','e','s','u','m','e',0};
static const WCHAR selectW[] = {'s','e','l','e','c','t',0};
static const WCHAR setW[] = {'s','e','t',0};
static const WCHAR stepW[] = {'s','t','e','p',0};
static const WCHAR stopW[] = {'s','t','o','p',0};
static const WCHAR subW[] = {'s','u','b',0};
static const WCHAR thenW[] = {'t','h','e','n',0};
static const WCHAR toW[] = {'t','o',0};
static const WCHAR trueW[] = {'t','r','u','e',0};
static const WCHAR untilW[] = {'u','n','t','i','l',0};
static const WCHAR wendW[] = {'w','e','n','d',0};
static const WCHAR whileW[] = {'w','h','i','l','e',0};
static const WCHAR xorW[] = {'x','o','r',0};
static const struct { static const struct {
const WCHAR *word; const WCHAR *word;
int token; int token;
} keywords[] = { } keywords[] = {
{andW, tAND}, {L"and", tAND},
{byrefW, tBYREF}, {L"byref", tBYREF},
{byvalW, tBYVAL}, {L"byval", tBYVAL},
{callW, tCALL}, {L"call", tCALL},
{caseW, tCASE}, {L"case", tCASE},
{classW, tCLASS}, {L"class", tCLASS},
{constW, tCONST}, {L"const", tCONST},
{defaultW, tDEFAULT}, {L"default", tDEFAULT},
{dimW, tDIM}, {L"dim", tDIM},
{doW, tDO}, {L"do", tDO},
{eachW, tEACH}, {L"each", tEACH},
{elseW, tELSE}, {L"else", tELSE},
{elseifW, tELSEIF}, {L"elseif", tELSEIF},
{emptyW, tEMPTY}, {L"empty", tEMPTY},
{endW, tEND}, {L"end", tEND},
{eqvW, tEQV}, {L"eqv", tEQV},
{errorW, tERROR}, {L"error", tERROR},
{exitW, tEXIT}, {L"exit", tEXIT},
{explicitW, tEXPLICIT}, {L"explicit", tEXPLICIT},
{falseW, tFALSE}, {L"false", tFALSE},
{forW, tFOR}, {L"for", tFOR},
{functionW, tFUNCTION}, {L"function", tFUNCTION},
{getW, tGET}, {L"get", tGET},
{gotoW, tGOTO}, {L"goto", tGOTO},
{ifW, tIF}, {L"if", tIF},
{impW, tIMP}, {L"imp", tIMP},
{inW, tIN}, {L"in", tIN},
{isW, tIS}, {L"is", tIS},
{letW, tLET}, {L"let", tLET},
{loopW, tLOOP}, {L"loop", tLOOP},
{meW, tME}, {L"me", tME},
{modW, tMOD}, {L"mod", tMOD},
{newW, tNEW}, {L"new", tNEW},
{nextW, tNEXT}, {L"next", tNEXT},
{notW, tNOT}, {L"not", tNOT},
{nothingW, tNOTHING}, {L"nothing", tNOTHING},
{nullW, tNULL}, {L"null", tNULL},
{onW, tON}, {L"on", tON},
{optionW, tOPTION}, {L"option", tOPTION},
{orW, tOR}, {L"or", tOR},
{privateW, tPRIVATE}, {L"private", tPRIVATE},
{propertyW, tPROPERTY}, {L"property", tPROPERTY},
{publicW, tPUBLIC}, {L"public", tPUBLIC},
{remW, tREM}, {L"rem", tREM},
{resumeW, tRESUME}, {L"resume", tRESUME},
{selectW, tSELECT}, {L"select", tSELECT},
{setW, tSET}, {L"set", tSET},
{stepW, tSTEP}, {L"step", tSTEP},
{stopW, tSTOP}, {L"stop", tSTOP},
{subW, tSUB}, {L"sub", tSUB},
{thenW, tTHEN}, {L"then", tTHEN},
{toW, tTO}, {L"to", tTO},
{trueW, tTRUE}, {L"true", tTRUE},
{untilW, tUNTIL}, {L"until", tUNTIL},
{wendW, tWEND}, {L"wend", tWEND},
{whileW, tWHILE}, {L"while", tWHILE},
{xorW, tXOR} {L"xor", tXOR}
}; };
static inline BOOL is_identifier_char(WCHAR c) static inline BOOL is_identifier_char(WCHAR c)