// SPDX-FileCopyrightText: 2024 Himbeer // // SPDX-License-Identifier: GPL-3.0-or-later package main import "fmt" type expected struct { want tokenKind got token } func (e expected) Error() string { return fmt.Sprintf("%d: expected %s, got %s", e.got.line, e.want, e.got) } type expectedToplevel struct { got token } func (e expectedToplevel) Error() string { return fmt.Sprintf("%d: expected top-level declaration, got %s", e.got.line, e.got) } type expectedStatement struct { got token } func (e expectedStatement) Error() string { return fmt.Sprintf("%d: expected statement, got %s", e.got.line, e.got) } type expectedUnaryOperand struct { got token } func (e expectedUnaryOperand) Error() string { return fmt.Sprintf("%d: expected unary operand, got %s", e.got.line, e.got) } type expectedPrimary struct { got token } func (e expectedPrimary) Error() string { return fmt.Sprintf("%d: expected primary expression, got %s", e.got.line, e.got) }