diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-08-09 14:53:16 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-08-09 14:53:16 +0200 |
commit | 4b6b5dfbce6afd80a8e961a878154a0a16d106bf (patch) | |
tree | 7381ca835beaa68dbfacc5c16c39bda7496c9214 /mintages/errors.go | |
parent | f0cc729de7c77457dd8411d19dd38da6ca8f6b00 (diff) |
Refactor the parser and add tests
Diffstat (limited to 'mintages/errors.go')
-rw-r--r-- | mintages/errors.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/mintages/errors.go b/mintages/errors.go index a456c1a..7319404 100644 --- a/mintages/errors.go +++ b/mintages/errors.go @@ -11,30 +11,6 @@ func (loc location) String() string { return fmt.Sprintf("%s: %d", loc.file, loc.linenr) } -type BadTokenError struct { - location - token string -} - -func (e BadTokenError) Error() string { - return fmt.Sprintf("%s: unknown token ā%sā", e.location, e.linenr, e.token) -} - -type ArgCountMismatchError struct { - location - token string - expected, got int -} - -func (e ArgCountMismatchError) Error() string { - var suffix string - if e.expected != 1 { - suffix = "s" - } - return fmt.Sprintf("%s: ā%sā token expects %d argument%s but got %d", - e.location, e.token, e.expected, suffix, e.got) -} - type SyntaxError struct { location expected, got string |