zclparse: keep ParseZCL results in the files registry
This is important to make the source code and context available for printing diagnostics.
This commit is contained in:
parent
19064ef9ee
commit
44670ddd50
@ -43,7 +43,9 @@ func (p *Parser) ParseZCL(src []byte, filename string) (*zcl.File, zcl.Diagnosti
|
||||
return existing, nil
|
||||
}
|
||||
|
||||
return zclsyntax.ParseConfig(src, filename, zcl.Pos{Byte: 0, Line: 1, Column: 1})
|
||||
file, diags := zclsyntax.ParseConfig(src, filename, zcl.Pos{Byte: 0, Line: 1, Column: 1})
|
||||
p.files[filename] = file
|
||||
return file, diags
|
||||
}
|
||||
|
||||
// ParseZCLFile reads the given filename and parses it as a native-syntax zcl
|
||||
|
Loading…
Reference in New Issue
Block a user