Closed stefjoosten closed 2 years ago
This bug has an easy workaround: just don't use duplicate pattern names. As a consequence, the priority of this bug cannot be 'high'. So I qualified it as 'normal'.
After fixing this bug, I suggest we add the script Issue1275.adl
to the test set .../Ampersand/testing/Travis/testcases/FuncSpec/
. (I have verified that this reproduces the bug in v4.6.2). For now, I'm have added the script to .../Ampersand/testing/StillUnsupported
in branch issue-1275
.
Two patterns that have the same name must be the same pattern.
However, in the parse tree (the P-structure) different patterns in the same context can have the same name.
So ADL2FSpec.hs
is the place where patterns with the same name should be merged.
We need a new function to merge two Patterns and we need to use that in the construction of the Fspec. That should do the trick.
@hanjoosten has solved this issue in commit 53522bfea68dbcaba541190852301f5f5682d5ca
What happened
Ampersand allows duplicate patterns, such as:
However, the above script produces a duplicate label error and causes Pandoc to crash in the most unelegant manner:
What I expected
Since the inception of Ampersand, the formal semantics of this is the union of the contents of this pattern. So the script should behave exactly the same as:
Version of ampersand that was used
Ampersand-v4.6.2 [51c3de2e65c540ef026925fe8547c991765a5588:refs/tags/v4.6.2]
Steps to reproduce
I ran the bug using the ampersandtarski/ampersand:v4.6.2 image.