aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-01 19:35:12 -0700
committeralon@honor <none@none>2010-10-01 19:35:12 -0700
commit73a87bedee8b225ed76c8efebe1a032d0bf91ec5 (patch)
treea240ad01146859aacc625057d51c54fef7963512
parentd5ba1375e1ed15c5a3520ff6dde6f97795f5ee1a (diff)
handle nested function calls in mathops
-rw-r--r--src/library.js19
-rw-r--r--src/parseTools.js2
2 files changed, 17 insertions, 4 deletions
diff --git a/src/library.js b/src/library.js
index f25d4a9c..a6fbcf02 100644
--- a/src/library.js
+++ b/src/library.js
@@ -115,12 +115,16 @@ var Library = {
}
},
+ isdigit: function(chr) {
+ return chr >= '0'.charCodeAt(0) && chr <= '9'.charCodeAt(0);
+ },
+
+ // LLVM specifics
+
__assert_fail: function(condition, file, line) {
throw 'Assertion failed: ' + Pointer_stringify(condition);//JSON.stringify(arguments)//condition;
},
- // Threading stuff LLVM adds sometimes
-
__cxa_guard_acquire: function() {
return 0;
},
@@ -134,8 +138,15 @@ var Library = {
}
},
- isdigit: function(chr) {
- return chr >= '0'.charCodeAt(0) && chr <= '9'.charCodeAt(0);
+ llvm_eh_exception: function() {
+ return Error();
+ },
+
+ llvm_eh_selector: function(exception, personality, num) {
+ },
+
+ __cxa_call_unexpected: function(exception) {
+ throw exception;
},
// iostream
diff --git a/src/parseTools.js b/src/parseTools.js
index 51988753..401a065c 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -280,6 +280,8 @@ function parseLLVMSegment(segment) {
ident: segment[0].text,
type: '?',
};
+ } else if (segment[0].text in PARSABLE_LLVM_FUNCTIONS) {
+ return parseLLVMFunctionCall([{text: '?'}].concat(segment));
} else if (segment[1].text in PARSABLE_LLVM_FUNCTIONS) {
return parseLLVMFunctionCall(segment);
} else {