GrammarDependencies: include all imports
For some reason, the grammar import dependency analysis only included the first import on a line. This does not work so well...
This commit is contained in:
parent
a9dfca3666
commit
d58e7e31bf
|
@ -216,14 +216,14 @@ class GrammarDependencies {
|
|||
return;
|
||||
|
||||
for (GrammarAST importDecl : grammar.getAllChildrenWithType(ANTLRParser.IMPORT)) {
|
||||
Tree id = importDecl.getFirstChildWithType(ANTLRParser.ID);
|
||||
for (Tree id: importDecl.getAllChildrenWithType(ANTLRParser.ID)) {
|
||||
// missing id is not valid, but we don't want to prevent the root cause from
|
||||
// being reported by the ANTLR tool
|
||||
if (id != null) {
|
||||
String grammarPath = getRelativePath(grammarFile);
|
||||
|
||||
// missing id is not valid, but we don't want to prevent the root cause from
|
||||
// being reported by the ANTLR tool
|
||||
if (id != null) {
|
||||
String grammarPath = getRelativePath(grammarFile);
|
||||
|
||||
graph.addEdge(id.getText() + ".g4", grammarPath);
|
||||
graph.addEdge(id.getText() + ".g4", grammarPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue