-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements/error management #111
Conversation
- Internal template should handle <no value> error - ellipsis error should only report the error, not the file position - Add debugging information on error retry
- Multiline errors were not handled properly due to a bad regex conversion - Add more flexibility to set options on template - assert method has been renamed to avoid conflict with assert test package
I also changed the code to be less dumb
a3cd941
to
190dcd6
Compare
{"Invalid", "@typeOf(data(`\"a\": 1, \"b\": 2`))", `"<RUN_ERROR>"`, fmt.Errorf("")}, | ||
{"Json", "@typeOf(data(`{\"a\": 1, \"b\": 2}`))", "json.jsonDict", nil}, | ||
{"Yaml", "@typeOf(data(`a: 1\nb: 2`))", "yaml.yamlDict", nil}, | ||
{"Flexible Hcl", "@typeOf(data(`a = 1 b = hello`))", "yaml.yamlDict", nil}, // TODO: Change that to hcl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO for now or later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shit, I really don't remember. I merged an old branch that has never been submitted as a PR.
I would say later. I think that I wrote that test when I started to look at HCL2 when it was still in Beta IIRC.
@@ -17,18 +17,25 @@ const ( | |||
literalTripleBackticks = "_=!TRIPLE_BT!=_" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@
and triple backticks can't go in the reservedKeywords slice below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Too risky to induce side effects IMO.
Some errors were not reported correctly. If a system call returned multi-line error, only the first line was kept.
struct keyword has been added as a go reserved keyword (this avoided using a variable named struct)