package parser import ( "fmt" "jinx/pkg/lang/scanner/token" "jinx/pkg/libs/source" ) type ErrFunctionNoThisAllowed struct { At source.Loc } func (e ErrFunctionNoThisAllowed) Error() string { return fmt.Sprintf("non-method function cannot have 'this' as parameter at %v", e.At) } type ErrFunctionLiteralNoThisAllowed struct { At source.Loc } func (e ErrFunctionLiteralNoThisAllowed) Error() string { return fmt.Sprintf("function literal cannot have 'this' as parameter at %v", e.At) } type ErrExpectedToken struct { At source.Loc Wanted token.TokenKind Got token.Token } func (e ErrExpectedToken) Error() string { return fmt.Sprintf("unexpected token %v, wanted %v at %v", e.Got, e.Wanted, e.At) } type ErrExpectedStatementEnd struct { At source.Loc Got token.Token } func (e ErrExpectedStatementEnd) Error() string { return fmt.Sprintf("expected statement end, got %v at %v", e.Got, e.At) } type ErrExpectedUnitExpressionStart struct { At source.Loc Got token.Token } func (e ErrExpectedUnitExpressionStart) Error() string { return fmt.Sprintf("unexpected token %v, wanted unit expression start at %v", e.Got, e.At) } type ErrExpectedValueLiteral struct { At source.Loc Got token.Token } func (e ErrExpectedValueLiteral) Error() string { return fmt.Sprintf("unexpected token %v, wanted value literal %v", e.Got, e.At) }