Fix PR feedback
Better handling of malformed RA
This commit is contained in:
@@ -75,9 +75,9 @@ async function generateSummarySymbols(summaryPath: string): Promise<SummarySymbo
|
|||||||
predicateName = nonRecursiveMatch.groups!.predicateName;
|
predicateName = nonRecursiveMatch.groups!.predicateName;
|
||||||
} else {
|
} else {
|
||||||
const recursiveMatch = startLine.match(RECURSIVE_TUPLE_COUNT_REGEXP);
|
const recursiveMatch = startLine.match(RECURSIVE_TUPLE_COUNT_REGEXP);
|
||||||
if (recursiveMatch) {
|
if (recursiveMatch?.groups) {
|
||||||
predicateName = recursiveMatch.groups!.predicateName;
|
predicateName = recursiveMatch.groups.predicateName;
|
||||||
iteration = parseInt(recursiveMatch.groups!.iteration);
|
iteration = parseInt(recursiveMatch.groups.iteration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,21 +92,20 @@ async function generateSummarySymbols(summaryPath: string): Promise<SummarySymbo
|
|||||||
}
|
}
|
||||||
lineNumber++;
|
lineNumber++;
|
||||||
}
|
}
|
||||||
if (raEndLine === undefined) {
|
if (raEndLine !== undefined) {
|
||||||
raEndLine = lineNumber - 1;
|
let symbol = symbols.predicates[predicateName];
|
||||||
}
|
if (symbol === undefined) {
|
||||||
let symbol = symbols.predicates[predicateName];
|
symbol = {
|
||||||
if (symbol === undefined) {
|
iterations: {}
|
||||||
symbol = {
|
};
|
||||||
iterations: {}
|
symbols.predicates[predicateName] = symbol;
|
||||||
|
}
|
||||||
|
symbol.iterations[iteration] = {
|
||||||
|
startLine: lineNumber,
|
||||||
|
raStartLine: raStartLine,
|
||||||
|
raEndLine: raEndLine
|
||||||
};
|
};
|
||||||
symbols.predicates[predicateName] = symbol;
|
|
||||||
}
|
}
|
||||||
symbol.iterations[iteration] = {
|
|
||||||
startLine: lineNumber,
|
|
||||||
raStartLine: raStartLine,
|
|
||||||
raEndLine: raEndLine
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user