From eb980259cb3ef935262f2bc74d93216b9b45f75b Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Fri, 26 Aug 2022 19:06:55 +0200 Subject: [PATCH] Add options to pass arguments to initialiser --- src_v2/parser/parser_types.nim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src_v2/parser/parser_types.nim b/src_v2/parser/parser_types.nim index a2f322d..dd6974a 100644 --- a/src_v2/parser/parser_types.nim +++ b/src_v2/parser/parser_types.nim @@ -67,8 +67,18 @@ func initParser*( tokens: tokens, ) -func initParserResult*(str: string): ParserResult = - ParserResult.ok(initParser(str)) +func initParserResult*( + stream: string, + tokens = newSeq[ParserToken](), + position = -1, + lastPosition = 0, +): ParserResult = + ParserResult.ok(initParser( + stream, + tokens, + position, + lastPosition, + )) # -- Getters