hcl/zcl/zclsyntax
Martin Atkins 59a1343216 zclsyntax: allow numeric "attributes" inside attr-only splats
Terraform interprets HIL variables in such a way that it allows numeric
attribute names which then get interpreted as numeric indices into a
list. This is used to work around the fact that the splat expressions
don't work for the index operator.

zcl has "full splats" that _do_ support the index operator, but to allow
old Terraform configs to be processed by zcl we'll accept this special
case within attribute-only-splats only.

For the moment this is a special exception made by this specific
implementation of zcl rather than part of the spec, since it's
specifically a pragmatic Terraform migration strategy, but it might get
upgraded to full spec status later if we end up needing to support it
in other host languages.

This requires the scanner to be a little more picky about the ending
of numeric literals, so that they won't absorb the trailing period after
the number in foo.*.baz.1.baz . This is okay because the spec doesn't
allow trailing periods anyway, and this is not actually a change in
final behavior because the parser was already catching this situation
and rejecting it at a later point.
2017-06-24 09:39:16 -07:00
..
didyoumean_test.go zclsyntax: "Did you mean ...?" helper function 2017-05-25 07:14:29 -07:00
didyoumean.go zclsyntax: "Did you mean ...?" helper function 2017-05-25 07:14:29 -07:00
doc.go zclsyntax: Start to stub out the zclsyntax package 2017-05-23 08:05:44 -07:00
expression_ops.go zclsyntax: visit both LHS and RHS of binary op in walk 2017-06-14 07:29:37 -07:00
expression_template_test.go zclsyntax: template "for" construct 2017-06-18 08:14:55 -07:00
expression_template.go zclsyntax: template "for" construct 2017-06-18 08:14:55 -07:00
expression_test.go zclsyntax: allow numeric "attributes" inside attr-only splats 2017-06-24 09:39:16 -07:00
expression_vars_gen.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00
expression_vars.go zclsyntax: template "for" construct 2017-06-18 08:14:55 -07:00
expression.go zclsyntax: catch and test for more errors in for expressions 2017-06-18 09:36:06 -07:00
file.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00
generate.go zclsyntax: run stringer after other generators 2017-06-05 07:04:26 -07:00
keywords.go zclsyntax: parsing of template if construct 2017-06-17 10:07:59 -07:00
navigation.go zclsyntax: Implement the ContextString interface on our Nav 2017-06-04 09:52:16 -07:00
node.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00
parse_traversal_test.go zclsyntax: ParseTraversalAbs function 2017-06-22 08:00:24 -07:00
parser_template.go zclsyntax: template "for" construct 2017-06-18 08:14:55 -07:00
parser_test.go zclsyntax: template single-interpolation case as separate AST node 2017-06-18 07:44:57 -07:00
parser_traversal.go zclsyntax: ParseTraversalAbs function 2017-06-22 08:00:24 -07:00
parser.go zclsyntax: allow numeric "attributes" inside attr-only splats 2017-06-24 09:39:16 -07:00
peeker_test.go zclsyntax: "peeker" helper 2017-05-29 18:09:58 -07:00
peeker.go zclsyntax: peeker pretends single-line comments are newlines 2017-06-09 07:19:25 -07:00
public.go zclsyntax: ParseTraversalAbs function 2017-06-22 08:00:24 -07:00
scan_tokens_test.go zclsyntax: change template control sequence introducer to %{ 2017-06-17 18:33:56 -07:00
scan_tokens.go zclsyntax: allow numeric "attributes" inside attr-only splats 2017-06-24 09:39:16 -07:00
scan_tokens.rl zclsyntax: allow numeric "attributes" inside attr-only splats 2017-06-24 09:39:16 -07:00
spec.md zclsyntax: permit dashes in identifiers 2017-06-24 09:12:24 -07:00
structure_test.go zclsyntax: Body.Content and Body.PartialContent 2017-06-03 09:04:16 -07:00
structure.go Add MissingItemRange to zcl.BodyContent 2017-06-03 16:46:49 -07:00
token_type_string.go zclsyntax: Ellipsis and "fat arrow" tokens 2017-06-13 08:50:20 -07:00
token.go zclsyntax: Ellipsis and "fat arrow" tokens 2017-06-13 08:50:20 -07:00
unicode2ragel.rb zclsyntax: identifiers in the scanner 2017-05-28 09:16:53 -07:00
unicode_derived.rl zclsyntax: identifiers in the scanner 2017-05-28 09:16:53 -07:00
variables_test.go zclsyntax: In Variables, don't return traversals in child scopes 2017-06-14 08:03:32 -07:00
variables.go zclsyntax: In Variables, don't return traversals in child scopes 2017-06-14 08:03:32 -07:00
walk.go Relocate into the "zclconf" github account 2017-05-27 17:33:09 -07:00