-
Notifications
You must be signed in to change notification settings - Fork 52
Add getIonDeserializer% and getIonSerializer% elaborators for generic Ion serialization
#1413
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
Open
keyboardDrummer-bot
wants to merge
18
commits into
reviewed-kbd-will-merge-to-main
Choose a base branch
from
bot/ion-deserializer
base: reviewed-kbd-will-merge-to-main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2b4a9e0
Add getIonDeserializer% elaborator for generic Ion deserialization
keyboardDrummer-bot 29bfcc7
Add Float support and nested/recursive type deserialization
keyboardDrummer-bot 1aad1e3
Replace DDM-based Java generator with getIonSerializer% elaborator
keyboardDrummer-bot 331f302
Merge remote-tracking branch 'origin/main' into bot/ion-deserializer
keyboardDrummer-bot c066e4a
Add List, Option, and Decimal support to Ion deserializer and Java se…
keyboardDrummer-bot c809c35
Fix #testCompile: move javac outside for loop and add dir to classpath
keyboardDrummer-bot 07f8155
Add Strata.Util.IonDeserializer to Strata.lean imports
keyboardDrummer-bot 71bc8ee
Remove GenDDM and its dependencies
keyboardDrummer-bot ae70b03
Merge branch 'reviewed-kbd-will-merge-to-main' into bot/ion-deserializer
keyboardDrummer-bot a840e2e
Fix Strata.Decimal → StrataDDM.Decimal and correct ion-java jar path
keyboardDrummer-bot a42fe6f
Revert test exclusion: run all tests with 'lake test'
keyboardDrummer-bot 886b4c1
Add laurelJavaGen: generate Laurel Java AST from Lean types
keyboardDrummer bcb1884
Fix getIonSerializer%: handle parametric types and mutual inductives
keyboardDrummer 86eb31b
Fix getIonSerializer%: handle type parameters and optParam defaults
keyboardDrummer 64d1327
Fix Java TestGen: accommodate ToIon.java in file counts, skip jar-dep…
keyboardDrummer-bot c03466b
Generate Java generics for parametric Lean types
keyboardDrummer c7292ff
Fix Java Gen build: resolve FieldInfo name clash, String.Slice, and t…
keyboardDrummer-bot 6d5afed
Fix getIonDeserializer% for parametric types; add Laurel Ion deserial…
keyboardDrummer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /- | ||
| Copyright Strata Contributors | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 OR MIT | ||
| -/ | ||
| import StrataDDM.Integration.Java.Gen | ||
| import Strata.Languages.Laurel.LaurelAST | ||
|
|
||
| /-! | ||
| # Laurel Java AST Generator | ||
|
|
||
| Generates Java source files for the Laurel AST types using `getIonSerializer%`. | ||
| The generated Java matches the Ion encoding format used by `getIonDeserializer%`. | ||
|
|
||
| Usage: | ||
| lake exe laurelJavaGen <package> <output-dir> | ||
|
|
||
| Example: | ||
| lake exe laurelJavaGen org.strata.jverify.laurel ../jverify/verifier/src/main/java | ||
| -/ | ||
|
|
||
| open Strata.Java | ||
|
|
||
| /-- Pre-computed Java files for the Laurel `Program` type. -/ | ||
| private def laurelFiles : GeneratedFiles := getIonSerializer% Strata.Laurel.Program "___placeholder___" | ||
|
|
||
| def main (args : List String) : IO Unit := do | ||
| match args with | ||
| | [package, outputDir] => | ||
| let files := laurelFiles.files.map fun (name, content) => | ||
| (name, content.replace "package ___placeholder___;" s!"package {package};") | ||
| writeJavaFiles outputDir package { files } | ||
| IO.println s!"Generated {files.size} Java files in {outputDir}" | ||
| | _ => | ||
| IO.eprintln "Usage: lake exe laurelJavaGen <package> <output-dir>" | ||
| IO.Process.exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
Explanation from LLM:
Removed the "Verify Java testdata is up to date" step: This step previously ran StrataTestExtra/Languages/Java/regenerate-testdata.sh and checked for git diffs in the testdata directory. It's no longer needed because the old approach (generating Java from DDM dialect files, running a Java program to produce .ion test fixtures, then checking them into the repo) has been replaced. The new getIonSerializer% / getIonDeserializer% approach generates and compiles Java at test time and does roundtrip verification inline — there are no longer any checked-in .ion testdata files or a regenerate-testdata.sh script to keep in sync.