Skip to content

use of enums when parsing #7

@mor1

Description

@mor1

it would be nice if, given an enum of the form

cenum foo {
  bar1 = v1;
  bar2 = v2
} as enumtype

...rather than foo option the parser return something like foo orError where orError would be defined something like

type 'a orError = 
  | Ok of 'a
  | Err of enumtype

the use case is when parsing data -- it's nice to lift to a proper type as early as possible but retain the ability to output some sensible debug info when there's a parse error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions