Changeset 13243 in project


Ignore:
Timestamp:
02/11/09 04:41:49 (10 years ago)
Author:
ashinn
Message:

Reporting file and line number of where errors occur, without
which mistie is comletely useless for large documents.
Also changing some standard error messages to actually say
what the problem is instead of just reporting an obscure symbol.
No, I'm not pissed off at mistie and regretting using it for
the IrRegex? documentation :/

Location:
release/3/mistie
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • release/3/mistie/footnote.mistie

    r294 r13243  
    3434      (display "</a> </small></sup>")
    3535      (h-ignore-spaces)
    36       (unless (eqv? (read-char) #\{) (error 'footnote))
     36      (let ((ch (read-char)))
     37        (unless (eqv? ch #\{)
     38         (error "footnote: expected #\\{ but got" ch)))
    3739      (mistie-def-char #\}
    3840        (lambda ()
  • release/3/mistie/mistie.scm

    r296 r13243  
    107107;
    108108
    109 (define mistie-translate
     109(define mistie-translate/internal
    110110  (lambda ()
    111111    (let loop ()
     
    127127        (unless mistie-exit?
    128128          (loop))))))
     129
     130(define (mistie-translate)
     131  (condition-case
     132      (mistie-translate/internal)
     133    (exn ()
     134      (print-error-message
     135       exn
     136       (current-error-port)
     137       (sprintf "mistie: error in ~A:~A" (port-name) (port-position)))
     138      (print-call-chain (current-error-port))
     139      (exit 1))))
    129140
    130141(define mistie-jobname "mistieput")
  • release/3/mistie/mistie.setup

    r296 r13243  
    1010   "timestamp.mistie"
    1111   "xref.mistie"
    12    "mistie.html") )
     12   "mistie.html")
     13 '((version 1.1)))
  • release/3/mistie/plain.mistie

    r296 r13243  
    22
    33(set! mistie-escape-char #\\)
     4
     5(define h-read-and-check-char
     6  (lambda (name expect-ch)
     7    (let ((ch (read-char)))
     8      (if (not (eqv? ch expect-ch))
     9          (error (sprintf "~A: expected ~S but got ~S" name expect-ch ch))))))
    410
    511(define h-ignore-spaces
     
    2430    ;simple group only, no nested braces
    2531    (h-ignore-spaces)
    26     (unless (eqv? (read-char) #\{) (error 'h-read-group))
     32    (h-read-and-check-char "h-read-group" #\{)
    2733    (let ((s (h-read-until (lambda (c) (eqv? c #\})))))
    28       (unless (eqv? (read-char) #\}) (error 'h-read-group))
     34      (h-read-and-check-char "h-read-group" #\})
    2935      s)))
    3036
     
    137143  (lambda (fontpre fontpost)
    138144    (h-ignore-spaces)
    139     (unless (eqv? (read-char) #\{) (error 'h-wrap-font))
     145    (h-read-and-check-char "h-wrap-font" #\{)
    140146    (mistie-push-frame)
    141147    (display fontpre)
     
    241247    (read-char)
    242248    (h-ignore-spaces)
    243     (if (not (eqv? (read-char) #\{)) (error 'h-make-unnumbered-section))
     249    (h-read-and-check-char "h-make-unnumbered-section" #\{)
    244250    (mistie-push-frame)
    245251    (display "<h") (display lvl) (display ">")
     
    254260  (lambda (lvl)
    255261    (h-ignore-spaces)
    256     (if (not (eqv? (read-char) #\{)) (error 'h-make-numbered-section))
     262    (h-read-and-check-char "h-make-numbered-section" #\{)
    257263    (let ((secnum (h-new-sec-num lvl)))
    258264      (set! h-recent-label (string-append "SECTION_" secnum))
     
    291297      (set! mistie-escape-char #f)
    292298      (h-ignore-spaces)
    293       (if (not (eqv? (read-char) #\{)) (error 'urlh))
     299      (h-read-and-check-char "urlh" #\{)
    294300      (display "<a href=\"")
    295301      (mistie-push-frame)
     
    300306          (display "\">")
    301307          (h-ignore-spaces)
    302           (if (not (eqv? (read-char) #\{)) (error 'urlh))
     308          (h-read-and-check-char "urlh" #\{)
    303309          (mistie-push-frame)
    304310          (mistie-def-char #\}
     
    311317  (lambda ()
    312318    (h-ignore-spaces)
    313     (if (not (eqv? (read-char) #\{)) (error 'obeylines))
     319    (h-read-and-check-char "obeylines" #\{)
    314320    (h-ignore-spaces)
    315321    (mistie-push-frame)
  • release/3/mistie/xref.mistie

    r294 r13243  
    6868  (lambda ()
    6969    (h-ignore-spaces)
    70     (unless (eqv? (read-char) #\{) (error 'cite))
     70    (let ((ch (read-char)))
     71      (unless (eqv? ch #\{)
     72        (error "cite: expected #\\{ but got" ch)))
    7173    (write-char #\[)
    7274    (let loop ()
Note: See TracChangeset for help on using the changeset viewer.