From 2721a242ce84f6f19045750e04a5f12b72dff9c3 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Fri, 26 Aug 2022 20:49:33 +0200 Subject: [PATCH] Add Builder --- src_v2/parser/builder_types.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src_v2/parser/builder_types.nim diff --git a/src_v2/parser/builder_types.nim b/src_v2/parser/builder_types.nim new file mode 100644 index 0000000..208e72b --- /dev/null +++ b/src_v2/parser/builder_types.nim @@ -0,0 +1,16 @@ +import fp/[ + resultM, +] +import ./parser_types + +type + Builder*[T] = tuple[ + parser: Parser, + tree: seq[T] + ] + builderErrorKind* = enum + parserError + BuilderError*[T] = ref object + kind*: builderErrorKind + builder*: Builder[T] + BuilderResult*[T] = Result[Builder[T], BuilderError[T]]