• Martin Atkins's avatar
    addrs: helper wrappers for parsing addresses in strings · 4833d2aa
    Martin Atkins authored
    Our "Parse..." functions all take hcl.Traversal objects rather than strings,
    assuming that in most cases we've already parsed a traversal out of some
    larger construct (usually a config file) before interpreting it as an
    address.
    
    However, there are some situations -- particularly tests -- where being
    able to easily parse a string directly is helpful. These new "Parse...Str"
    functions all wrap the function of the same name with no "Str" suffix and
    first parse the string with the HCL native syntax traversal parser.
    
    As noted in the function doc comments, this should not be used in "real"
    code except in exceptional circumstances, since it creates addresses and
    diagnostics that do not have useful source location information for
    reporting diagnostics.
    4833d2aa