aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authormax99x <max99x@gmail.com>2011-06-27 21:27:19 +0300
committermax99x <max99x@gmail.com>2011-06-27 21:27:19 +0300
commit5824029a7ccabe7f59f2015fb860cbfadc547c35 (patch)
treead046587a634273f27cef181df00f886ae303884 /src/parseTools.js
parenta0ac176b22bbcf252dff23b89583bb077fafe371 (diff)
parent30c5db3696ff9b45da570eb9d5c19cc1cbb1d01c (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index fd021166..3855c633 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1040,19 +1040,21 @@ function handleOverflow(text, bits) {
// From parseLLVMSegment
function finalizeLLVMParameter(param) {
+ var ret;
if (isNumber(param)) {
return param;
} else if (typeof param === 'string') {
- return toNiceIdentCarefully(param);
+ ret = toNiceIdentCarefully(param);
} else if (param.intertype in PARSABLE_LLVM_FUNCTIONS) {
- return finalizeLLVMFunctionCall(param);
+ ret = finalizeLLVMFunctionCall(param);
} else if (param.intertype == 'value') {
- return parseNumerical(param.ident);
+ ret = parseNumerical(param.ident);
} else if (param.intertype == 'structvalue') {
- return param.values.map(finalizeLLVMParameter);
+ ret = param.values.map(finalizeLLVMParameter);
} else {
throw 'invalid llvm parameter: ' + param.intertype;
}
+ return indexizeFunctions(ret);
}
function makeSignOp(value, type, op) {
@@ -1104,7 +1106,7 @@ function isSignedOp(op, variant) {
function processMathop(item) { with(item) {
for (var i = 1; i <= 4; i++) {
if (item['param'+i]) {
- item['ident'+i] = indexizeFunctions(finalizeLLVMParameter(item['param'+i]));
+ item['ident'+i] = finalizeLLVMParameter(item['param'+i]);
if (!isNumber(item['ident'+i])) {
item['ident'+i] = '(' + item['ident'+i] + ')'; // we may have nested expressions. So enforce the order of operations we want
}