-
Notifications
You must be signed in to change notification settings - Fork 110
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
Updates TDL syntax for macro invocations, expr groups, and variable expansions #951
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ion-11-encoding #951 +/- ##
==================================================
Coverage ? 70.02%
Complexity ? 6879
==================================================
Files ? 196
Lines ? 27110
Branches ? 4899
==================================================
Hits ? 18985
Misses ? 6612
Partials ? 1513 ☔ View full report in Codecov by Sentry. |
@@ -30,6 +30,8 @@ | |||
|
|||
/** | |||
* Tests that Ion 1.1 encoding directives are correctly compiled from streams of Ion data. | |||
* | |||
* Don't attempt fix this without ensuring that MacroCompilerTest and IonManagesWriter_1_1_Test are working first. |
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.
What does this mean?
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.
Oh, that was a note to myself that I should resolve failing tests in the other test classes before dealing with the tests in this class. I'll remove it.
@@ -115,7 +115,7 @@ class MacroCompilerTest { | |||
BoolValue(emptyList(), false), | |||
) | |||
), | |||
"""(macro using_expr_group () (values (; 42 "hello" false)))""" shouldCompileTo TemplateMacro( | |||
"""(macro using_expr_group () (.values (.. 42 "hello" false)))""" shouldCompileTo TemplateMacro( |
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.
Are we allowing (..42 "hello" false)
(i.e., no whitespace after ..
)?
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.
In this case, they are already syntactically identical because of the rules for parsing symbols inside of s-expressions. For example, (+x)
is equivalent to ( + x )
, and this falls under those same rules.
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.
Agreed, just wanted to make sure we're not planning to go out of our way to prohibit that in this case. I'm happy not to.
Issue #, if available:
amazon-ion/ion-docs#343
amazon-ion/ion-docs#344
Description of changes:
This updates
ion-java
to use the TDL syntax proposed in the above issues. (But this PR does not include updating the E-Expression syntax for expression groups.)Overall, I think the proposed syntax results in simpler code for writing macro definitions in the managed writer and simpler code for compiling the macro templates. So it seems like the proposed changes are positive for users and implementors.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.