Skip to content

The nonempty macro should result in the Haskell backend using the NonEmpty type? #371

@MatthewDaggitt

Description

@MatthewDaggitt

You can write separator nonempty Stmt "," in the grammar but the generated Abs file still uses the type [Stmt] rather than NonEmpty Stmt. This means that you have to duplicate the empty-case check again wherever you use the generated data type.

e.g.

ELitSeq.    Expr ::= "[" [Expr] "]";

separator nonempty Expr "";

results in

data Expr = ELitSeq [Expr]

rather than

data Expr = ELitSeq (NonEmpty Expr)

How hard would this be to fix and where would one start?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTConcerning the generated abstract syntaxHaskelllistsConcerning list categories and separator/terminator/delimiter pragmas

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions