Commit Graph

7 Commits

Author SHA1 Message Date
Martin Atkins
5477fecfad zclsyntax: require newlines after block items
Previously we tolerated EOF as an alias for newline, but a file without
a newline at the end is a edge case primarily limited to contrived
examples in unit tests, and requiring it simplifies tasks such as code
generation in zclwrite, since we can always assume that every block item
comes with a built-in line terminator.
2017-06-09 08:19:47 -07:00
Martin Atkins
cd85a1f0a6 zcldec: convert AttrSpec results to the given type 2017-06-04 13:22:03 -07:00
Martin Atkins
446387109d zcldec: AttrSpec should return null for missing attributes
Previously it was returning DynamicVal, but that's incorrect since it
would mean that even an otherwise-complete result that has an unpopulated
optional attribute would include an unknown.
2017-06-04 13:05:35 -07:00
Martin Atkins
1979cb4c56 zcldec: flesh out and test the Variables function
It no longer produces diagnostics, since that's redundant with the
diagnostics that Decode itself will produce, and it wasn't going to be
complete anyway due to our use of partial decoding and our inability
to thread through nested specs in child blocks.
2017-06-04 08:30:54 -07:00
Martin Atkins
a9f913f830 zcldec: SourceRange function
This allows callers to determine the source location where a particular
value (identified by a spec) came from, for use in application-level
diagnostic messages.
2017-06-04 08:13:36 -07:00
Martin Atkins
d3703888b6 zcldec: BlockSpec decode implementation 2017-06-04 07:43:13 -07:00
Martin Atkins
f220c26836 zcldec: initial work on decoding bodies directly to cty.Value
This package is an alternative to gocty for situations where static Go
types are not desired and the application instead wishes to remain in the
cty dynamic type system.
2017-06-03 17:34:32 -07:00