PG icon indicating copy to clipboard operation
PG copied to clipboard

PG goes bananas (accepts any string after `{|`)

Open samuelgruetter opened this issue 4 years ago • 2 comments

The following file is accepted by PG:

Goal False.
Proof.
  {| Hello this is cool.
  {| Is this a new kind of comment? .
  {| Multi-line
     works
     as well!.
Abort.

{| Also works outside a Proof .

But results in a syntax error when compiled with coqc.

It seems that whenever a command starts with {|, PG accepts any string following it, until the dot, but doesn't cause coqtop to do anything.

samuelgruetter avatar Oct 18 '21 21:10 samuelgruetter

Hi. Thanks for reporting. Indeed there is a problem with error detection since a few weeks. I will try to fix that shortly. FTR this does not seem to be fixed by #615.

Matafou avatar Nov 04 '21 15:11 Matafou

No it has actually nothing to do with error detection. It is yet another case where PG splitting the coq file into single commands wrongly. Here the { at start is not detected as a subproof starter, because the token {| is recognized as something else. So the string " {| Hello this is cool." is sent to coq as if it were a single command. But coq take the first {` as one command, and the remainin of the string as another (buggy) one. Two prompts are displayed at once, PG does not support this.

I will try to find time to fix this, but this has low priority since there will always be such corner cases where a buggy file is not correctly split by PG (until PG relies on coq splitting one day).

Matafou avatar Nov 09 '21 14:11 Matafou

Duplicate of #357.

Matafou avatar Apr 03 '24 19:04 Matafou