feat: error for when there is more source code than parsed

This commit is contained in:
2025-12-27 02:08:18 -05:00
parent df53409887
commit 884180de92
6 changed files with 54 additions and 13 deletions

View File

@@ -45,3 +45,24 @@ func NewSlash(index int) *Token {
func NewAtom(name string, index int) *Token {
return &Token{Type: Atom, Index: index, Value: name}
}
func Name(typ Type) string {
switch typ {
case OpenParen:
return "("
case CloseParen:
return ")"
case Slash:
return "\\"
case Dot:
return "."
case Atom:
return "ATOM"
default:
return "?"
}
}
func (t Token) Name() string {
return Name(t.Type)
}