c3cbe9a9e2
Fixes #338 Add methods to update block type and labels to enable us to refactor HCL configurations such as renaming Terraform resources. - `*Block.SetType(typeName string)` - `*Block.SetLabels(labels []string)` Some additional notes about SetLabels: Since we cannot assume that old and new labels are equal in length, remove old labels and insert new ones before TokenOBrace. To implement this, I also added the following methods. - `*nodes.Insert(pos *node, c nodeContent) *node` - `*nodes.InsertNode(pos *node, n *node) *node` They are similar to the existing Append / AppendNode, but insert a node before a given position. |
||
---|---|---|
.. | ||
fuzz | ||
ast_attribute.go | ||
ast_block_test.go | ||
ast_block.go | ||
ast_body_test.go | ||
ast_body.go | ||
ast_expression.go | ||
ast_test.go | ||
ast.go | ||
doc.go | ||
examples_test.go | ||
format_test.go | ||
format.go | ||
generate_test.go | ||
generate.go | ||
native_node_sorter.go | ||
node.go | ||
parser_test.go | ||
parser.go | ||
public.go | ||
round_trip_test.go | ||
tokens.go |