Add structured coroutines and explicit error handling

This commit is contained in:
pavel 2026-08-27 16:26:40 +02:00
commit fe62e81152
31 changed files with 1701 additions and 325 deletions

View file

@ -122,6 +122,9 @@ func (l *lexer) next() (token, error) {
case '%':
return token{kind: tokenPercent, lexeme: "%", pos: start}, nil
case '!':
if l.match('!') {
return token{kind: tokenDoubleBang, lexeme: "!!", pos: start}, nil
}
if l.match('=') {
return token{kind: tokenNeq, lexeme: "!=", pos: start}, nil
}
@ -149,6 +152,9 @@ func (l *lexer) next() (token, error) {
case '@':
return token{kind: tokenAt, lexeme: "@", pos: start}, nil
case '?':
if l.match('.') {
return token{kind: tokenSafeDot, lexeme: "?.", pos: start}, nil
}
return token{kind: tokenQuestion, lexeme: "?", pos: start}, nil
case '|':
if l.match('|') {