#lang racket/base
(require racket/contract
"myenv.ss"
"errors-and-warnings.rkt")
(provide parser-error)
(provide/contract
[ssax:warn
(->* (port?) () #:rest list? any)])
(define (parser-error arg0 . args)
(if (port? arg0)
(error 'parser-error
"error at position ~s: ~a"
(file-position arg0)
(args->display-string args))
(error 'parser-error
"error in error handler: its first parameter is not a port: ~a"
(args->display-string (cons arg0 args)))))
(define (args->display-string args)
(apply string-append (map (lambda (x) (format "~a" x)) args)))
(define (ssax:warn p . args)
(sxml:warn 'ssax:warn
"warning at position ~a: ~a"
(file-position p)
(args->display-string args)))