diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-11-18 21:06:36 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-11-18 21:06:36 -0800 |
commit | f30d5d97a0090777a871f93b76a4657836828443 (patch) | |
tree | eeb864831bb7a81bb026d13f4bef6f4d335688ca /src | |
parent | daa624b9f9be7abdff1c4551e193a26f913b695b (diff) |
correct lineNums in unparsedFunctions
Diffstat (limited to 'src')
-rw-r--r-- | src/intertyper.js | 5 | ||||
-rw-r--r-- | src/jsifier.js | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 2ffae602..78827e87 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -5,8 +5,9 @@ var LLVM_STYLE = null; //! @param parseFunctions We parse functions only on later passes, since we do not //! want to parse all of them at once, and have all their //! lines and data in memory at the same time. -function intertyper(data, parseFunctions) { +function intertyper(data, parseFunctions, baseLineNum) { //parseFunctions = true; // Uncomment to do all parsing in a single big RAM-heavy pass. Faster, if you have the RAM + baseLineNum = baseLineNum || 0; // Substrate @@ -45,7 +46,7 @@ function intertyper(data, parseFunctions) { } else { ret.push({ lineText: line, - lineNum: i + 1, + lineNum: i + 1 + baseLineNum, }); if (new RegExp(/^\ +switch\ .*/g).test(line)) { // beginning of llvm switch diff --git a/src/jsifier.js b/src/jsifier.js index 4c02cf26..6bf3e712 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -15,7 +15,7 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions) { for (var i = 0; i < data.unparsedFunctions.length; i++) { var func = data.unparsedFunctions[i]; dprint('unparsedFunctions', 'processing |' + func.ident + '|, ' + i + '/' + data.unparsedFunctions.length); - func.JS = JSify(analyzer(intertyper(func.lines, true), TYPES), true, TYPES, FUNCTIONS); + func.JS = JSify(analyzer(intertyper(func.lines, true, func.lineNum-1), TYPES), true, TYPES, FUNCTIONS); delete func.lines; // clean up memory as much as possible } |