amplify-education / python-hcl2

MIT License
255 stars 56 forks source link

Terraform escape sequences are not processed when parsing strings #171

Open weaversam8 opened 1 month ago

weaversam8 commented 1 month ago

Example code:

block "block_name" {
  a = "line1\nline2"
}

Expected output:

{'block': [{'block_name': {'a': 'line1\nline2', '__start_line__': 1, '__end_line__': 3}}]}

Actual output (note the extra backslash):

{'block': [{'block_name': {'a': 'line1\\nline2', '__start_line__': 1, '__end_line__': 3}}]}

I plan to fix this in a future PR, just creating this issue for tracking purposes.