-
Notifications
You must be signed in to change notification settings - Fork 111
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
Adds macro compiler #697
Adds macro compiler #697
Conversation
263be46
to
17d884a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## ion-11-encoding #697 +/- ##
==================================================
Coverage ? 65.38%
Complexity ? 5963
==================================================
Files ? 201
Lines ? 25499
Branches ? 4534
==================================================
Hits ? 16673
Misses ? 7488
Partials ? 1338 ☔ View full report in Codecov by Sentry. |
data class IntValue(val annotations: List<SymbolToken> = emptyList(), val value: Long) : TemplateBodyExpression | ||
data class BigIntValue(val annotations: List<SymbolToken> = emptyList(), val value: BigInteger) : TemplateBodyExpression | ||
data class FloatValue(val annotations: List<SymbolToken> = emptyList(), val value: Double) : TemplateBodyExpression | ||
data class DecimalValue(val annotations: List<SymbolToken> = emptyList(), val value: BigDecimal) : TemplateBodyExpression |
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.
Will probably have to be Decimal
to support -0...
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.
Decimal
extends BigDecimal
, so this can be constructed with a -0
decimal, but I can't think of any problem with changing it to Decimal
here.
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.
So it ends up making the tests (or other programmatic construction of a template body) more annoying if I change this to Decimal
. I'm going to leave it for now, and we can revisit it later if it causes problems.
93cea44
to
82d4497
Compare
17d884a
to
f484715
Compare
Issue #, if available:
None
Description of changes:
MacroCompiler
, a class that can decorate anIonReader
to readTemplateMacro
s from it.signature
to be a property of theMacro
interface.MacroSignature.Parameter
toMacro
interface. (And the parameter encoding enum.)MacroSignature
in favor of usingList<Macro.Parameter>
hashCode
andequals
inTemplateMacro
to use a cached hashcode value.TemplateExpression
so that it's completely flat instead of having nestedIonElement
trees, as well as renaming it toTemplateBodyExpression
.toString
,hashCode
, andequals
toFakeSymbolToken
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.