Closed andreasabel closed 3 years ago
@andreasabel We just hit:
C: list constructors rendered wrongly as make(:) and make[]
Any pointers to fix?
I am now working to extend the expression type by typing information, so that the printers can pick the right list constructors.
Remaining problem (C): non-linear definitions, like: https://github.com/BNFC/bnfc/blob/228e2eff0f4f4269b8d375814fc544c506ea6e2c/examples/define/test.cf#L25 This creates syntax trees that not trees but DAGs.
make_Assign (x, make_EOp (make_EVar(x), make_Plus(), make_EInt(1)))
E.g. here, x
is shared. This causes problems for the C deallocator which assumes that it is dealing with a tree.
the C deallocator
A bit off topic, but is there a deallocation function provided with the generated files? I haven't seen one, I've just been manually freeing recursively down the generated structs.
@shlevy : The deallocation is a new, yet unreleased functionality added in a9d360d9cc0a33624e3d7f3e9c8cda01ab25cb9c (#348).
Remaining problem (C): non-linear definitions, like:
This has been fixed by introduction of clone_*
and the cloning of duplicate components to prevent pointer aliasing and to preserve the tree-property.
The original example for
define
by Ulf Norell is currently only accepted by the Haskell backends. https://github.com/BNFC/bnfc/blob/3da1b0e732bd67b264d1783f6804c6b101147401/examples/DefinedRules.cf#L22-L23make_(:)
andmake_[]
.if
andfor
(keyword clash, regression), wrong list constructors.(:) (a,b)
instead of(a :: b)
.if
clashes withIf
. Works in 2.9.1 with--force
.Missing sanitization is a regression wrt. 2.9.1, introduced by #287. The list constructors probably never worked.