hcl/hclwrite
Martin Atkins 63e2897c12 hclsyntax: Source range of IndexExpr must cover whole expression
Some HCL callers make the (reasonable) assumption that the overall source
range of an expression will be a superset of all of the ranges of its
child expressions, for purposes such as extraction of source code
snippets, parse tree annotation in hclwrite, text editor analysis
functions like "go to reference", etc.

The IndexExpr type was not previously honoring that assumption, since its
source range was placed around only the bracket portion. That is a good
region to use when reporting errors relating to the index operation, but
it is not a faithful representation of the full extent of the expression.

In order to meet both of these requirements at once, IndexExpr now has
both SrcRange covering the entire expression and BracketRange covering
the index part delimited by brackets. We can then use BracketRange in
our error messages but return SrcRange as the result of the general
Range method that is common to all expression types.
2019-12-06 09:09:18 -08:00
..
ast.go hclwrite: NewEmptyFile function 2018-11-03 20:45:25 +00:00
ast_attribute.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
ast_block.go hclwrite: Allow selecting blocks for updating 2019-10-01 15:59:10 -07:00
ast_block_test.go hclwrite: Allow selecting blocks for updating 2019-10-01 15:59:10 -07:00
ast_body.go hclwrite: Allow constructing expressions from raw tokens 2019-11-19 15:35:01 -08:00
ast_body_test.go hclwrite: Allow constructing expressions from raw tokens 2019-11-19 15:35:01 -08:00
ast_expression.go hclwrite: Allow constructing expressions from raw tokens 2019-11-19 15:35:01 -08:00
ast_test.go hclwrite: Simplify internal data structures 2018-08-01 08:46:31 -07:00
doc.go hclwrite: Split Attribute and Block into their own source files 2018-11-03 09:21:43 -07:00
examples_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
format.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
format_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
generate.go hclwrite: fix TokensForTraversal handling of index steps 2019-11-11 15:17:19 -08:00
generate_test.go hclwrite: fix TokensForTraversal handling of index steps 2019-11-11 15:17:19 -08:00
native_node_sorter.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
node.go hclwrite: Allow removing attributes and blocks from bodies 2019-10-01 15:59:10 -07:00
parser.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
parser_test.go hclsyntax: Source range of IndexExpr must cover whole expression 2019-12-06 09:09:18 -08:00
public.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
round_trip_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
tokens.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00