aboutsummaryrefslogtreecommitdiff
path: root/src/parser.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-09-09 21:22:12 -0700
committeralon@honor <none@none>2010-09-09 21:22:12 -0700
commit5bc458f7a3675ea2f36c71e4456fc1948526cae7 (patch)
tree824f3b2f9cdf48d05a45971e1025f20ccbd0c1fa /src/parser.js
parenta523ad539ccf91b7a162ac1ac18f9e1bf88f5147 (diff)
fix some regexps that v8 and sm do not agree on
Diffstat (limited to 'src/parser.js')
-rw-r--r--src/parser.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parser.js b/src/parser.js
index 2ba20e45..6d74deff 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -85,7 +85,7 @@ function isStructPointerType(type) {
}
function isStructType(type) {
- if (/^\[\d+\ x\ (.*)\]/g.test(type)) return true; // [15 x ?] blocks. Like structs
+ if (new RegExp(/^\[\d+\ x\ (.*)\]/g).test(type)) return true; // [15 x ?] blocks. Like structs
if (isPointerType(type)) return false;
var proofs = ['%struct', '%"struct'];
return type.substr(0, proofs[0].length) == proofs[0] ||
@@ -377,10 +377,10 @@ function intertyper(data) {
var inContinual = false;
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
- if (inContinual || /^\ +to.*/g.test(line)) {
+ if (inContinual || new RegExp(/^\ +to.*/g).test(line)) {
// to after invoke
ret.slice(-1)[0].lineText += line;
- if (/^\ +\]/g.test(line)) { // end of llvm switch
+ if (new RegExp(/^\ +\]/g).test(line)) { // end of llvm switch
inContinual = false;
}
} else {
@@ -388,7 +388,7 @@ function intertyper(data) {
lineText: line,
lineNum: i + 1,
});
- if (/^\ +switch\ .*/g.test(line)) {
+ if (new RegExp(/^\ +switch\ .*/g).test(line)) {
// beginning of llvm switch
inContinual = true;
}
@@ -1018,7 +1018,7 @@ function analyzer(data) {
if (data.types[type]) return;
if (['internal', 'inbounds', 'void'].indexOf(type) != -1) return;
dprint('types', '// addType: ' + type);
- var check = /^\[(\d+)\ x\ (.*)\]$/g.exec(type);
+ var check = new RegExp(/^\[(\d+)\ x\ (.*)\]$/g).exec(type);
// 'blocks': [14 x %struct.X] etc.
if (check) {
var num = parseInt(check[1]);