Open andreasabel opened 3 years ago
Suggested fix:
If the AST is not aware of positions, just put an invalid position there (Dot (0,0) "."
).
cSg :: Char -> Chars
cSg c = CSnoc CNil (Dot ((0,0), ".")) c
newtype Dot = Dot ((C.Int, C.Int), String)
In Haskell/Functor, make position tokens polymorphic.
cSg :: a -> Char -> Chars' a
cSg a c = CSnoc a (CNil a) (Dot (a, ".")) c
type Dot = Dot' BNFC'Position
newtype Dot' a = Dot (a, String)
deriving (C.Eq, C.Ord, C.Show, C.Read, C.Functor, C.Foldable, C.Traversable)
This fails in some backends: