Add options to pass arguments to initialiser
This commit is contained in:
@@ -52,14 +52,19 @@ type
|
||||
func initParserToken*(x: char): ParserToken = ParserToken(kind: parserTokenChar, charValue: x)
|
||||
func initParserToken*(x: string): ParserToken = ParserToken(kind: parserTokenString, stringValue: x)
|
||||
|
||||
func initParser*(str: string): Parser =
|
||||
func initParser*(
|
||||
stream: string,
|
||||
tokens = newSeq[ParserToken](),
|
||||
position = -1,
|
||||
lastPosition = 0,
|
||||
): Parser =
|
||||
Parser(
|
||||
state: ParserState(
|
||||
stream: str,
|
||||
position: -1,
|
||||
lastPosition: 0,
|
||||
stream: stream,
|
||||
position: position,
|
||||
lastPosition: lastPosition,
|
||||
),
|
||||
tokens: newSeq[ParserToken](),
|
||||
tokens: tokens,
|
||||
)
|
||||
|
||||
func initParserResult*(str: string): ParserResult =
|
||||
|
||||
Reference in New Issue
Block a user