Remove unneeded lookBack function
This commit is contained in:
@@ -18,20 +18,6 @@ type parserFnT = proc(t0: Parser): ParserResult
|
|||||||
|
|
||||||
# -- Utilities
|
# -- Utilities
|
||||||
|
|
||||||
proc lookBack*(count: int): (parserFnT) =
|
|
||||||
return proc(parser: Parser): ParserResult =
|
|
||||||
let state = parser.state
|
|
||||||
let newIndex = state.position - 1
|
|
||||||
|
|
||||||
Parser(
|
|
||||||
state: ParserState(
|
|
||||||
stream: state.stream,
|
|
||||||
position: newIndex,
|
|
||||||
lastPosition: parser.state.position,
|
|
||||||
),
|
|
||||||
tokens: parser.tokens,
|
|
||||||
).ok()
|
|
||||||
|
|
||||||
proc isStreamCompleted*(parser: Parser): bool =
|
proc isStreamCompleted*(parser: Parser): bool =
|
||||||
parser.state.position >= parser.state.stream.len - 1
|
parser.state.position >= parser.state.stream.len - 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user