Retain the bytes used to construct a file
Later on this will be useful when printing diagnostics with source code snippets as context.
This commit is contained in:
parent
160f56abb1
commit
41527d1a3c
@ -33,6 +33,7 @@ func Parse(src []byte, filename string) (*zcl.File, zcl.Diagnostics) {
|
||||
Body: &body{
|
||||
obj: rootNode.(*objectVal),
|
||||
},
|
||||
Bytes: src,
|
||||
}
|
||||
}
|
||||
return file, diags
|
||||
|
@ -6,7 +6,8 @@ import (
|
||||
|
||||
// File is the top-level node that results from parsing a ZCL file.
|
||||
type File struct {
|
||||
Body Body
|
||||
Body Body
|
||||
Bytes []byte
|
||||
}
|
||||
|
||||
// Block represents a nested block within a Body.
|
||||
|
Loading…
x
Reference in New Issue
Block a user