diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-07 15:40:53 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-07 15:40:53 -0800 |
commit | 0b3416a1dcd808fb71043a9f400f3ef2aa636abc (patch) | |
tree | 9a7ff926af193e432f5646afbcfb2c7365b17879 /src/parseTools.js | |
parent | 6fee37fceb9e06a805c8074aa68bf678f406ff5b (diff) | |
parent | e4e8063f6d568277b297f19d51801cd7dda9545c (diff) |
Merge branch 'incoming' into llvm-3.41.8.6
Conflicts:
tests/test_benchmark.py
tools/shared.py
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 655248b3..4d6d7bd3 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -49,7 +49,8 @@ function preprocess(text) { showStack.push(ident in this && this[ident] > 0); } } else if (line[2] == 'n') { // include - ret += '\n' + read(line.substr(line.indexOf(' ')+1)) + '\n' + var included = read(line.substr(line.indexOf(' ')+1)); + ret += '\n' + preprocess(included) + '\n' } } else if (line[2] == 'l') { // else showStack.push(!showStack.pop()); @@ -1639,7 +1640,10 @@ function getFastValue(a, op, b, type) { } function getFastValues(list, op, type) { - assert(op == '+'); + assert(op === '+' && type === 'i32'); + for (var i = 0; i < list.length; i++) { + if (isNumber(list[i])) list[i] = (list[i]|0) + ''; + } var changed = true; while (changed) { changed = false; @@ -1647,6 +1651,7 @@ function getFastValues(list, op, type) { var fast = getFastValue(list[i], op, list[i+1], type); var raw = list[i] + op + list[i+1]; if (fast.length < raw.length || fast.indexOf(op) < 0) { + if (isNumber(fast)) fast = (fast|0) + ''; list[i] = fast; list.splice(i+1, 1); i--; |