Comments (5)
Hi @johakoch!
Looking in your fork, I see that you've implemented it only for the native syntax, in package hclsyntax
.
For this to be merged upstream it would need to work in the JSON variant too, but that's not really possible because it makes the interpretation of the syntax ambiguous. That's why this isn't supported in HCL today.
If you only care about the native syntax and are willing to keep maintaining your fork then of course this is fine! But for this upstream HCL we expect language designers to use a different block type name for each block header signature, because that then gives the JSON syntax decoder a hook to understand which interpretation the author intended.
from hcl.
Hi @apparentlymart
Yes, we only support the HCL native syntax.
So we will keep a fork and try to maintain it as time allows.
Thanks anyway
from hcl.
Hi @apparentlymart
Could the optional label
api {
}
be a short form of an empty label
api "" {
}
, which could have a JSON representation of
{
"api" {
"": {
}
}
}
?
from hcl.
Related Issues (20)
- GoHCL does not support interpolation HOT 3
- hclsyntax: Template expression produces too large value refinements HOT 3
- Tuple Specification is inconsistent with Terraform
- StringLit is not part of the Expression Grammar
- PartialContent documentation mismatch with behavior? HOT 4
- hclwrite: SetAttributeRaw() after Clear() is not present in hcl.Bytes() output
- how to convert HCL2 into json? HOT 9
- Conditionals with unknown conditions and marked branches are erroring.
- how to convert json to hcl using hclv2? HOT 4
- merged: set attributes even if diagnosed as duplicated HOT 2
- raw parse and decode without evaluating variables and functions? HOT 3
- hclsyntax: Recovery of outer `ObjectConsExpr` with empty `TemplateExpr` HOT 1
- Question: How to evaluate unknown functions without errors? HOT 2
- hclsyntax: Recovery of incomplete `ConditionalExpr` HOT 1
- Introduce `Code` to `Diagnostic`
- Report ambiguous attribute keys earlier than in `expression.Value()` HOT 2
- hclsyntax: Recovery of incomplete parenthesis
- Wrong `NameRange` for namespaced function call expressions
- hcldec: how to use `block_attrs`? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hcl.