diff options
-rw-r--r-- | src/parseTools.js | 2 | ||||
-rw-r--r-- | src/utility.js | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 3489964f..455cbe8b 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -479,7 +479,7 @@ function parseParamTokens(params) { segment[0].text += segment[1].text; segment.splice(1, 1); // TODO: merge tokens nicely } - var num = isNumber(segment[1].text); + var num = isNumber(segment[1].text) || (segment[1].text[0] === '0'); // handle 0x... as well var ident = parseNumerical(segment[1].text, segment[0].text); if (!num) ident = toNiceIdent(ident); ret.push({ diff --git a/src/utility.js b/src/utility.js index ac821a89..62adb807 100644 --- a/src/utility.js +++ b/src/utility.js @@ -222,6 +222,7 @@ function mergeInto(obj, other) { } function isNumber(x) { + // XXX this does not handle 0xabc123 etc return x == parseFloat(x) || (typeof x == 'string' && x.match(/^-?\d+$/)); } |