Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

escape sequences for message syntax are throwing an error #11

Open
dagoltz opened this issue Apr 30, 2019 · 2 comments
Open

escape sequences for message syntax are throwing an error #11

dagoltz opened this issue Apr 30, 2019 · 2 comments

Comments

@dagoltz
Copy link

dagoltz commented Apr 30, 2019

File "/../my_file.py", line 103, in _process_message
return format(actual_message, processed_params, _get_message_format_locale(locale_code))
File "/.../lib/python2.7/site-packages/pyseeyou/init.py", line 13, in format
ast = ICUMessageFormat.parse(msg)
File "/.../lib/python2.7/site-packages/parsimonious/grammar.py", line 115, in parse
return self.default_rule.parse(text, pos=pos)
File "/.../lib/python2.7/site-packages/parsimonious/expressions.py", line 122, in parse
raise IncompleteParseError(text, node.end, self)
IncompleteParseError: Rule 'message_format_pattern' matched in its entirety, but it didn't consume all the text. The non-matching portion of the text begins with '{n,}: in regular ex' (line 1, column 14).

String example: "Disallowed: \\{n,\\}: in regular expression"

This should be supported as described here:

Supports escape sequences for message syntax chars, e.g.: "\{foo\}" will output: "{foo}" in the formatted output instead of interpreting it as a foo argument.

@dagoltz
Copy link
Author

dagoltz commented Apr 30, 2019

My workaround:
handle the string and inject those as parameters:

regex used: \\{([^{}]+)\\}

@Artoria2e5
Copy link

As with the previous problem, the PEG syntaxes have diverged significantly since pyseeyou took the PEG definition:

It's going to take some time to re-sync it. I will take a try at it though.

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

No branches or pull requests

2 participants