hierarchy-builder icon indicating copy to clipboard operation
hierarchy-builder copied to clipboard

HB breaks the parsing of commas (tuples, "in" clauses, etc)

Open silene opened this issue 1 year ago • 4 comments

From HB Require Import structures.

Lemma foo (v1: plus 1 2 = 0) : False.
Proof.
unfold plus in v1, v1.
(* Syntax error: [in_clause] expected after 'in' (in [clause]). *)
Check (v1, v1).
(* Syntax error: [term level 200] expected after '(' (in [term]). *)

A space is now needed before commas, e.g., unfold plus in v1 , v1.

silene avatar Oct 24 '24 21:10 silene

@CohenCyril I'm not very good with notations, and since this code is copy pasted from an old code of mine the problem could be here:

https://github.com/math-comp/hierarchy-builder/blob/9d256b8ec2d8de15975aa8de94cd1336cb41f070/HB/structures.v#L1212C1-L1220C14

@silene if you rename v1 into w1, does it work? Maybe the problem is that v1, is now a keyword.

gares avatar Oct 25 '24 07:10 gares

I don't see any other possible causes, but admit all my ignorance on the subject...

gares avatar Oct 25 '24 07:10 gares

Indeed, this is the likely culprit.

Print Grammar constr.
(*
| "0" LEFTA
  [ "[find"; "v1,"; "..,"; term LEVEL "200"; "|"; term LEVEL "200"; "∼"; term LEVEL "200"; "]"; NEXT
*)

I guess you can just remove this notation since it obviously has never been used.

silene avatar Oct 25 '24 07:10 silene

I wonder what the RHS of the notation looks like internally... Anyway I opened a PR

gares avatar Oct 25 '24 08:10 gares