Add structured coroutines and explicit error handling
This commit is contained in:
parent
de1262b4cf
commit
fe62e81152
31 changed files with 1701 additions and 325 deletions
|
|
@ -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('|') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue