new operator "?!" (alternate value)
This commit is contained in:
+3
-1
@@ -202,8 +202,10 @@ func (self *scanner) fetchNextToken() (tk *Token) {
|
||||
case '?':
|
||||
if next, _ := self.peek(); next == '?' {
|
||||
tk = self.moveOn(SymDoubleQuestion, ch, next)
|
||||
} else if next, _ := self.peek(); next == '=' {
|
||||
} else if next == '=' {
|
||||
tk = self.moveOn(SymQuestionEqual, ch, next)
|
||||
} else if next == '!' {
|
||||
tk = self.moveOn(SymQuestionExclam, ch, next)
|
||||
} else {
|
||||
tk = self.makeToken(SymQuestion, ch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user