Skip to content
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

Enables MacroCompiler to operate over an IonReader. #943

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

tgregg
Copy link
Contributor

@tgregg tgregg commented Sep 24, 2024

Description of changes:

We will use MacroCompilerContinuable for binary and MacroCompilerIonReader for text. If there's a better way to achieve this in Kotlin, I'm open to it.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

}
private inline fun ReaderType.forEachInContainer(block: ReaderType.(IonType) -> Unit) = readContainer { forEachRemaining(block) }

abstract fun ReaderType.readerHasAnnotations(): Boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need for these to be extension functions, and I think it may be a little more readable as non-extension functions. (I realize that I made extension functions for readContainer, forEachRemaining, etc. They are also don't need to be extension functions.) If we get rid of the receiver type on all of these functions, then we no longer need the type parameter on the class. Finally, all of these abstract methods can be protected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@tgregg tgregg force-pushed the ion-11-encoding-macro-compiler-ionreader branch from e4b9f5f to b00703f Compare September 25, 2024 18:50
@tgregg tgregg merged commit 714dbcf into ion-11-encoding Sep 25, 2024
17 checks passed
@tgregg tgregg deleted the ion-11-encoding-macro-compiler-ionreader branch September 25, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants