Skip to content

Copy-pasting messages inserts newlines and causes IncompleteParseError #14

@Wert5

Description

@Wert5

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions