diff options
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 3856c17e..bc151843 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -230,9 +230,9 @@ function isFunctionDef(token, out) { if (nonPointing[0] != '(' || nonPointing.substr(-1) != ')') return false; if (nonPointing === '()') return true; - if (!token.item) return false; + if (!token.tokens) return false; var fail = false; - var segments = splitTokenList(token.item.tokens); + var segments = splitTokenList(token.tokens); segments.forEach(function(segment) { var subtext = segment[0].text; fail = fail || segment.length > 1 || !(isType(subtext) || subtext == '...'); @@ -280,7 +280,7 @@ function isFunctionType(type, out) { i--; } assert(argText); - return isFunctionDef({ text: argText, item: tokenize(argText.substr(1, argText.length-2)) }, out); + return isFunctionDef({ text: argText, tokens: tokenize(argText.substr(1, argText.length-2)).tokens }, out); } function getReturnType(type) { @@ -615,13 +615,13 @@ function parseLLVMFunctionCall(segment) { segment = cleanSegment(segment); // Remove additional modifiers var variant = null; - if (!segment[2] || !segment[2].item) { + if (!segment[2] || !segment[2].tokens) { variant = segment.splice(2, 1)[0]; if (variant && variant.text) variant = variant.text; // needed for mathops } assertTrue(['inreg', 'byval'].indexOf(segment[1].text) == -1); assert(segment[1].text in PARSABLE_LLVM_FUNCTIONS); - while (!segment[2].item) { + while (!segment[2].tokens) { segment.splice(2, 1); // Remove modifiers if (!segment[2]) throw 'Invalid segment!'; } @@ -630,15 +630,15 @@ function parseLLVMFunctionCall(segment) { if (type === '?') { if (intertype === 'getelementptr') { type = '*'; // a pointer, we can easily say, this is - } else if (segment[2].item.tokens.slice(-2)[0].text === 'to') { - type = segment[2].item.tokens.slice(-1)[0].text; + } else if (segment[2].tokens.slice(-2)[0].text === 'to') { + type = segment[2].tokens.slice(-1)[0].text; } } var ret = { intertype: intertype, variant: variant, type: type, - params: parseParamTokens(segment[2].item.tokens) + params: parseParamTokens(segment[2].tokens) }; Types.needAnalysis[ret.type] = 0; ret.ident = toNiceIdent(ret.params[0].ident || 'NOIDENT'); @@ -2493,7 +2493,7 @@ function walkAndModifyInterdata(item, pre) { } function parseBlockAddress(segment) { - return { intertype: 'blockaddress', func: toNiceIdent(segment[2].item.tokens[0].text), label: toNiceIdent(segment[2].item.tokens[2].text), type: 'i32' }; + return { intertype: 'blockaddress', func: toNiceIdent(segment[2].tokens[0].text), label: toNiceIdent(segment[2].tokens[2].text), type: 'i32' }; } function finalizeBlockAddress(param) { |