Repository navigation
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the message parser to align with standard ICU message formatting rules regarding single-quote escaping. By replacing the previous regex-based approach with a more robust manual lexing logic, the parser now correctly handles literal quotes, escaped braces, and provides better error reporting for malformed message strings. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
PR HealthBreaking changes ✔️
This check can be disabled by tagging the PR with Coverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with Unused Dependencies ✔️
For details on how to fix these, see dependency_validator. This check can be disabled by tagging the PR with |
There was a problem hiding this comment.
Code Review
This pull request adds support for ICU single-quote escaping (specifically ApostropheMode.DOUBLE_OPTIONAL) in the Parser class of messages_builder. It updates the lexing logic in icu_message_parser.dart to handle doubled single quotes and quoted braces/placeholders, and adds validation to throw an exception on unexpected trailing tokens. Comprehensive unit tests covering various escaping scenarios and error cases have also been added. There are no review comments, so I have no feedback to provide.
Note
This PR was generated by an AI coding agent (Jetski) on behalf of @mosuem.
Implements standard ICU 4.8+ (
MessagePatternApostropheMode.DOUBLE_OPTIONAL) single-quote escaping inpkgs/messages_builder/lib/message_parser/icu_message_parser.dart:''always collapses to a single literal'.'immediately preceding{or}starts quoted literal text until the matching closing'(with''inside quoted text producing a literal'), throwingL10nParserExceptionif unclosed at end of input.'characters not preceding',{, or}(e.g."It's {name}","L'article") remain literal'.}) left over after parsing instead of silently truncating the rest of the message.