Fixed #20: I can parse simple concepts
This commit is contained in:
@@ -75,7 +75,7 @@ class ParserInput:
|
||||
return self.all_tokens[-1]
|
||||
|
||||
return self.all_tokens[my_pos]
|
||||
|
||||
|
||||
def seek(self, pos):
|
||||
"""
|
||||
Move the token offset to position pos
|
||||
@@ -90,5 +90,15 @@ class ParserInput:
|
||||
self.token = self.all_tokens[self.pos]
|
||||
return True
|
||||
|
||||
def clone(self):
|
||||
res = ParserInput(self.original_text)
|
||||
res.all_tokens = self.all_tokens
|
||||
res.exception = self.exception
|
||||
res.pos = self.pos
|
||||
res.end = self.end
|
||||
res.token = self.token
|
||||
|
||||
return res
|
||||
|
||||
def __repr__(self):
|
||||
return f"ParserInput('{self.original_text}', len={len(self.all_tokens)})"
|
||||
|
||||
Reference in New Issue
Block a user