diff --git a/zcl/json/public.go b/zcl/json/public.go index c2f0285..5d20467 100644 --- a/zcl/json/public.go +++ b/zcl/json/public.go @@ -33,6 +33,7 @@ func Parse(src []byte, filename string) (*zcl.File, zcl.Diagnostics) { Body: &body{ obj: rootNode.(*objectVal), }, + Bytes: src, } } return file, diags diff --git a/zcl/structure.go b/zcl/structure.go index ec1ac60..36e431f 100644 --- a/zcl/structure.go +++ b/zcl/structure.go @@ -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.