diff options
Diffstat (limited to 'source4/lib/appweb/ejs')
-rw-r--r-- | source4/lib/appweb/ejs/ejsLex.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source4/lib/appweb/ejs/ejsLex.c b/source4/lib/appweb/ejs/ejsLex.c index b4617a638e..b9a363cfc9 100644 --- a/source4/lib/appweb/ejs/ejsLex.c +++ b/source4/lib/appweb/ejs/ejsLex.c @@ -633,12 +633,19 @@ static int getLexicalToken(Ejs *ep, int state) break; } if (tolower(c) == 'x') { - if (tokenAddChar(ep, c) < 0) { - return EJS_TOK_ERR; - } - if ((c = inputGetc(ep)) < 0) { - break; - } + do { + if (tokenAddChar(ep, c) < 0) { + return EJS_TOK_ERR; + } + if ((c = inputGetc(ep)) < 0) { + break; + } + } while (isdigit(c) || (tolower(c) >= 'a' && tolower(c) <= 'f')); + + mprDestroyVar(&ep->tokenNumber); + ep->tokenNumber = mprParseVar(ep->token, type); + inputPutback(ep, c); + return EJS_TOK_NUMBER; } if (! isdigit(c)) { #if BLD_FEATURE_FLOATING_POINT |