This SDF3-coq-semantics syntax:

Start.Start     = <<{Line "\n\n\n\n"}*>>
Line.Var        = <var <ID>;>

pretty-prints this:

var x; var y; var z;

as this:

var x;⏎
var y;⏎
var z;

Three out of the four newlines in the separator are ignored. So, I can’t separate each element with one or more blank lines if I want to.


Also, I noticed strange behavior when I put a space between each \n:

Start.Start     = <<{Line "\n \n \n \n"}*>>
Line.Var        = <var <ID>;>

then the above example is pretty-printed like this:

var x;␣␣␣⏎
⏎
⏎
⏎
var y;␣␣␣⏎
⏎
⏎
⏎
var z;

The three spaces from the separator are all clumped together at the end of the line, after which four newlines suddenly do follow.

Submitted by D. Pelsmaeker on 14 August 2014 at 14:01

Log in to post comments