New, more flexible, parser context datatype that includes and extends
the previous flags allowForest and allowVarRef. Added binary operator (work in progress). Better implementation of +=,-=,*=, and /= (new) operators.
This commit is contained in:
+3
-1
@@ -149,6 +149,8 @@ func (scanner *scanner) fetchNextToken() (tk *Token) {
|
||||
if next, _ := scanner.peek(); next == '*' {
|
||||
scanner.readChar()
|
||||
tk = scanner.fetchBlockComment()
|
||||
} else if next, _ = scanner.peek(); next == '=' {
|
||||
tk = scanner.moveOn(SymSlashEqual, ch, next)
|
||||
} else if next == '/' {
|
||||
scanner.readChar()
|
||||
tk = scanner.fetchOnLineComment()
|
||||
@@ -590,7 +592,7 @@ func (scanner *scanner) fetchString(termCh byte) (tk *Token) {
|
||||
}
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
tk = scanner.makeErrorToken(errors.New("missing string termination \""))
|
||||
tk = scanner.makeErrorToken(errors.New(string(termCh)))
|
||||
} else {
|
||||
tk = scanner.makeErrorToken(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user