first working implementation of iterators and some fixes to the parser around lists analysis

This commit is contained in:
2024-04-26 04:45:42 +02:00
parent 7a88449cd1
commit 750c660331
5 changed files with 318 additions and 13 deletions
+10 -1
View File
@@ -239,9 +239,18 @@ func (self *scanner) fetchNextToken() (tk *Token) {
tk = self.makeToken(SymGreater, ch)
}
case '$':
tk = self.makeToken(SymDollar, ch)
if next, _ := self.peek(); next == '(' {
tk = self.moveOn(SymDollarRound, ch, next)
tk.source += ")"
} else {
tk = self.makeToken(SymDollar, ch)
}
case '(':
if next, _ := self.peek(); next == ')' {
tk = self.moveOn(SymOpenClosedRound, ch, next)
} else {
tk = self.makeToken(SymOpenRound, ch)
}
case ')':
tk = self.makeToken(SymClosedRound, ch)
case '[':