(For a detailed context of this issue, see STR-26)

If an sdf contains:
“(” {Foo “,”}2+ “)” -> Bar {cons(“TwoOrMore”)}

The pp entry by pp-gen is:
TwoOrMore – KW[“(”] _1 KW[“)”],
TwoOrMore.1:iter-sep-n – _1 KW[“,”] _2,
TwoOrMore.1:iter-sep-n.2:“2” – ,

and, when feeding this to parse-pp-table, the following error occurs:

[adam@freshwater adam]$ parse-pp-table -i niter-test.pp -o niter-test.pp.af
sglr: error in niter-test.pp, line 4, col 29: character `"’ (x22) unexpected
parse-pp-table: rewriting failed

(line 4, col 29) is the first " in “2”

Submitted on 21 March 2004 at 12:03

On 21 March 2004 at 12:17 Jira commented:

STR-27, adam:
Hmmz, just dove into the pp-table.sdf, which contains:

 ConsName "." {Selector "."}+ -> Path {cons("Path")}
 NatCon ":" UQLiteral -> Selector {cons("selector")}

It’s probably in the UQLiteral. I don’t whether it’s safe to make the a Literal (i.e. either QLiteral or UQLiteral)?

Or maybe it’s the pp-gen that should not have output a quoted literal “2” in the first place.


On 21 March 2004 at 13:20 Jira commented:

STR-27, mdejonge:
Hi,

Yes, you are right ‘iter-n’ and ‘iter-n-sep’ are not supported at the moment. To be honest, there are more fancy SDF2 constructs that are not supported. Since these cosntructs are likely to be removed from SDF2 anyway, you better not use them. However, I think it would not be difficult to change ppgen to either ignore these constructs, or generate generate pretty-print rules form them that are syntactically correct.
Ppgen should produce ‘TwoOrMore.1:iter-sep-n’, not ‘TwoOrMore.1:iter-sep-n.2:“2”’.

Best regards,
Merijn


On 21 March 2004 at 13:58 Jira commented:

STR-27, mdejonge:
pretty-printer generator now generates syntactically correct rules for all SDF2 constructs

Log in to post comments