Parses ICU message format syntax into an abstract syntax tree. Can be used for transformation or validation.
$ composer require marketforce-info/message-format-parser
$message = "Welcome {name} to the club."
$ast = (new MarketforceInfo\MessageFormatParser\Parser())->parse($message)
This is my {main_message} to everyone.
\_________/\____________/\___________/
literal argument literal
{name[, format[, options]]}
Contributions gratefully accepted in the form issues or PRs.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.