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

Copy-pasting messages inserts newlines and causes IncompleteParseError #14

Open
Wert5 opened this issue May 2, 2023 · 0 comments
Open

Comments

@Wert5
Copy link

Wert5 commented May 2, 2023

Running on development branch (commit cfc663b) with server http://shade.tacc.utexas.edu:3000/ in game StratIntact1 with password stratPass522

Reproduce by copying DAIDE message from message UI, wrapping with REJ ( ), and hitting send.

image

Error message in our bot (which catches ParseError so it continues running):
Rule 'message' matched in its entirety, but it didn't consume all the text. The non-matching portion of the text begins with '
' (line 4, column 59).
Traceback (most recent call last):
File "search_solve.py", line 2240, in handle_negotiations
python_msg = daide_to_python(v.message)
File "/diplomacy_cicero/daide_print.py", line 109, in daide_to_python
tree = grammar.parse(msg)
File "/opt/conda/lib/python3.8/site-packages/parsimonious/grammar.py", line 112, in parse
return self.default_rule.parse(text, pos=pos)
File "/opt/conda/lib/python3.8/site-packages/parsimonious/expressions.py", line 143, in parse
raise IncompleteParseError(text, node.end, self)
parsimonious.exceptions.IncompleteParseError: Rule 'message' matched in its entirety, but it didn't consume all the text. The non-matching portion of the text begins with '
' (line 4, column 59).

PARSE ERROR
REJ ( PRP ( AND ( XDO ( ( RUS AMY MOS ) MTO STP ) ) ( XDO ( ( RUS AMY WAR )
MTO SIL ) ) ( XDO ( ( RUS FLT SEV ) MTO BLA ) ) ( XDO ( ( RUS FLT (STP
SCS) ) MTO GOB ) ) ( XDO ( ( FRA AMY MAR ) MTO SPA ) ) ( XDO ( ( FRA AMY
PAR ) MTO BUR ) ) ( XDO ( ( FRA FLT BRE ) MTO ECH ) ) ) )<br>

I expected the message to be pasted exactly as it appeared so that wrapping it with REJ( ) would produce valid, parseable, DAIDE.

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

1 participant