You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After parsing the above file as a config, if you take bytes from the range of the "foo" expression (<<EOF\n{}\nEOF) and parse it again as an expression based on its start position and the bytes, you expect to get the expression correctly.
Actual behavior
Failed to parse bytes as an expression. It says "Unterminated template string; No closing marker was found for the string."
But it's understandable that it fails to parse this. When you retrieve an expression based on the range, the last newline is always lost. This is invalid as heredoc.
<<EOF{}EOF
\ No newline at end of file
In addition, I noticed that ParseExpression always parses the bytes in "ignore newlines" mode.
// Bare expressions are always parsed in "ignore newlines" mode, as if
// they were wrapped in parentheses.
parser.PushIncludeNewlines(false)
The problem I want to solve with this issue is that I want to know if I should fix the ParseExpression for this problem or if it's the user's responsibility to always add a newline at the end of the passed bytes.
HCL Template
Expected behavior
After parsing the above file as a config, if you take bytes from the range of the "foo" expression (
<<EOF\n{}\nEOF
) and parse it again as an expression based on its start position and the bytes, you expect to get the expression correctly.Actual behavior
Failed to parse bytes as an expression. It says "Unterminated template string; No closing marker was found for the string."
Steps to reproduce
Run the following code:
References
ParseExpression
to serializehcl.Expression
and communicate over RPC between processes.The text was updated successfully, but these errors were encountered: