Remove obsolete mjb_error - #57
Merged
Merged
Conversation
Signed-off-by: Francesco Bigiarini <francesco.bigiarini@gmail.com>
Signed-off-by: Francesco Bigiarini <francesco.bigiarini@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the now-obsolete mjb_error type from Mojibake’s public surface area and simplifies mjb_locale_parse to report failures solely via mjb_status, updating all affected generators, bindings, docs, and tests accordingly.
Changes:
- Remove the public
mjb_errorenum and drop themjb_error *errorout-parameter frommjb_locale_parse. - Update the C implementation to propagate
mjb_statusfrom the internal ASCII parser (includingMJB_STATUS_NO_MEMORY). - Update CLI, fuzz harness, C++ wrapper, WASM/TypeScript bindings, tests, and API docs to match the new signature.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| utils/generate/html-function.ts | Removes obsolete generator handling for mjb_error * parameters. |
| utils/generate/functions.ts | Updates generated function metadata/docs/examples for the new mjb_locale_parse signature. |
| tests/mojibake.c | Adds a regression test for mjb_locale_parse allocation failure reporting (MJB_STATUS_NO_MEMORY). |
| tests/locales.c | Updates locale parsing tests to use the new signature and remove mjb_error assertions. |
| tests/ext/cpp/locales.cpp | Updates C++ wrapper tests to assert status-only behavior. |
| tests/example.c | Updates generated API coverage example to use the new signature. |
| src/shell/commands/locale.c | Updates CLI locale command to call the new mjb_locale_parse signature. |
| src/mojibake.h | Removes mjb_error from the public header and updates the mjb_locale_parse declaration. |
| src/locales.c | Changes the internal locale ASCII parser to return mjb_status and propagates it from mjb_locale_parse. |
| src/cpp/mojibake.hpp | Removes LocaleError’s stored parse-error detail and updates wrapper call sites. |
| src/api/mojibake.d.ts | Updates the WASM module typing for _mjb_locale_parse to drop the error pointer. |
| src/api/index.ts | Removes the TS ErrorType enum and updates localeParse to drop error allocations/params. |
| fuzz/fuzz.c | Updates fuzz locale parsing invocation to the new signature. |
| API.md | Updates public API documentation and examples for the new mjb_locale_parse signature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.