Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the codebase to adopt the new Moonbit style, replacing module-scoped references with Cirru::… syntax, switching string concatenations to +=, and bumping the package version.
- Migrate all
@lib.Cirrureferences toCirru::…and simplify enum variants. - Refactor concatenation in writer and other modules to use
+=. - Bump
moon.mod.jsonto v0.1.0 and adjust CI workflow.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main/main.mbt | Update parser/formatter calls to Cirru::parse?/Cirru::format? and add a typealias. |
| src/lib/writer.mbt | Refactor string concat to +=, update WriterNode syntax and method signatures. |
| src/lib/tree.mbt | Replace Cirru::List/Leaf with short variants and preallocate arrays. |
| src/lib/s_expr.mbt | Shorten pattern matches, switch to char_at for string indexing. |
| src/lib/primes.mbt | Unify Match arms to short variants, implement Default, Compare, Hash more cleanly. |
| src/lib/parser_test.mbt | Update tests to use Cirru::parse! and Cirru::format!. |
| src/lib/parser.mbt | Refactor parser APIs to Cirru::parse, update lex-state handling. |
| moon.mod.json | Bump version from 0.0.13 to 0.1.0. |
| README.md | Change examples to moonbit syntax and new Cirru:: API. |
| .github/workflows/check.yml | Remove OS condition on install step. |
Comments suppressed due to low confidence (4)
src/lib/writer.mbt:251
- There's a typo in the error message—
Unpectedshould beUnexpected.
raise FormatCirruError("Unpected condition")
.github/workflows/check.yml:15
- The removal of this OS condition means the install script will now run on Windows runners, which will likely fail. Consider restoring or updating the condition to skip the install step on Windows.
if: ${{ matrix.os != 'windows-latest' }}
src/main/main.mbt:2
- [nitpick] The
typealias @lib.Cirrudeclaration appears incomplete or ambiguous—there’s no target type specified. Ensure the alias syntax correctly maps to the intended type.
typealias @lib.Cirru
src/lib/writer.mbt:76
- Consider adding unit tests for
generate_leafto cover strings with special characters (e.g., newlines, quotes, backslashes), since the concatenation logic was refactored.
fn generate_leaf(s : String) -> String {
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.