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