Analyzer now no longer attempts to analyze an invalid tree

This commit is contained in:
Sasha Koshka 2022-10-12 13:14:53 -04:00
parent 5d27befb6f
commit b2fadd2fd3
1 changed files with 3 additions and 1 deletions

View File

@ -49,7 +49,9 @@ func Analyze (modulePath string, skim bool) (table SectionTable, err error) {
// analyze performs an analysis operation given the state of the operation
// struct.
func (analyzer *analysisOperation) analyze () (err error) {
tree, err := parser.Fetch(analyzer.modulePath, false)
var tree parser.SyntaxTree
tree, err = parser.Fetch(analyzer.modulePath, false)
if err != nil { return }
sections := tree.Sections()
for !sections.End() {