Open
Description
I used the method from CircomFilesVisitor for parsing. However, the parsing result is coarse-grained and does not parse each statement in the Circom program.
test.ts
import { getCircomParser, ParserError } from '@distributedlab/circom-parser';
import CircomFilesVisitor from './CircomFilesVisitor';
let source="/mnt/sdd1/sbw/circom/test_circomParser/historyBug/circom/208.circom"
const parser = getCircomParser(source);
const visitor = new CircomFilesVisitor(source);
visitor.visit(parser.circuit());
let temp=visitor.fileData;
let templates=temp.templates;
console.log("templates",templates)
templates {
Example: {
parameters: [],
isCustom: false,
parallel: false,
context: TemplateDefinitionContext {
parentCtx: [BlockDefinitonContext],
invokingState: 176,
children: [Array],
start: [Pt],
stop: [Pt],
exception: null,
_argNames: undefined,
parser: [ExtendedCircomParser]
}
}
}

I want to obtain a fine-grained parse tree at the statement level, like the one on the far right in the image. What should I do?
Metadata
Metadata
Assignees
Labels
No labels