Inline References as First-Class Values (string or reference) #9
Closed
pewpewpotato
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Adopt inline references as first-class value expressions alongside string literals. Any key’s value can be either:
reference:{alias}:{path}Top-level
reference:statements are deprecated and will be removed in a future major version.Motivation
Syntax
name: 'prod-vpc'cidr: reference:network:vpc.cidrExample:
infrastructure: vpc: cidr: reference:network:vpc.cidr # reference value name: 'prod-vpc' # string valueParser/AST
Expr) that can be:StringLiteralReferenceExpr(alias + dotted path)SourceSpaninfo for diagnostics.ReferenceStmtremains temporarily for back-compat with deprecation warnings.See also:
libs/parser/README.md— updated to document that a key’s value can be a string literal or an inline reference, and thatReferenceExpris a supported expression type.Compiler/Analyzer changes
ReferenceExprafter symbol tables/imports are established; respect aliasing and shadowing rules.Backward compatibility & migration
reference:with deprecation warnings.reference:form; provide codemod guidance.Testing
Open questions
reference:.Acceptance criteria
StringLiteralorReferenceExprwith correct spans.All reactions