Skip to content

Conversation

@tiye
Copy link
Member

@tiye tiye commented Jun 5, 2025

No description provided.

@tiye tiye requested review from a team and Copilot June 5, 2025 17:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.Cirru references to Cirru::… and simplify enum variants.
  • Refactor concatenation in writer and other modules to use +=.
  • Bump moon.mod.json to 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—Unpected should be Unexpected.
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.Cirru declaration 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_leaf to cover strings with special characters (e.g., newlines, quotes, backslashes), since the concatenation logic was refactored.
fn generate_leaf(s : String) -> String {

@NoEgAm NoEgAm merged commit 565329e into main Jul 29, 2025
1 check passed
@NoEgAm NoEgAm deleted the simplify branch July 29, 2025 11:37
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.

3 participants