We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e9f589 commit a2b942bCopy full SHA for a2b942b
src/parse.ts
@@ -24,7 +24,6 @@ export class YosysJsonStatsParseError extends Error {
24
}
25
26
27
-const STAT_FILE_HEADER = "Printing statistics."
28
const TOP_METANAME = "@Top@"
29
30
export function parseTextStats(input: string): ParsedModule[] {
@@ -38,7 +37,10 @@ export function parseTextStats(input: string): ParsedModule[] {
38
37
if (rawModules.length === 0) {
39
return []
40
41
- if (rawModules[0].length !== 1 || !rawModules[0][0].trim().endsWith(STAT_FILE_HEADER)) {
+ if (
+ rawModules[0].length !== 1 ||
42
+ !rawModules[0][0].trim().match(/^[0-9]+\. Printing statistics\.$/)
43
+ ) {
44
throw new TextStatsParseError("Bad header")
45
46
const parsedRawModules: (ParsedModule | string)[] = rawModules.slice(1).map((rawModule) => {
0 commit comments