add error for unknown chars
This commit is contained in:
parent
e906b007de
commit
656bd7dc27
@ -1,6 +1,7 @@
|
||||
package read
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"mal-go/hash_map"
|
||||
"mal-go/symbol"
|
||||
"mal-go/vector"
|
||||
@ -47,6 +48,8 @@ func readForm(s string, pos int, ns string) (any, any, int) {
|
||||
res, err, pos = readVector(s, pos, ns)
|
||||
case '(':
|
||||
res, err, pos = readList(s, pos, ns)
|
||||
default:
|
||||
return nil, "unexpected char: '" + fmt.Sprint(c) + "'", pos
|
||||
}
|
||||
}
|
||||
return res, err, pos
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user