correct lineNums in unparsedFunctions

This commit is contained in:
Alon Zakai 2010-11-18 21:06:36 -08:00
Родитель daa624b9f9
Коммит f30d5d97a0
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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
}