From c24fe38d918ab81b0e48b390e1bc5ffc8847ac49 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 6 May 2012 12:06:00 -0400 Subject: [PATCH] A bunch of `fprintf' -> `eprintf' conversions (and a few related things). original commit: 17090fca4f19298f01d03fea419edb20f315d040 --- collects/parser-tools/private-yacc/table.rkt | 12 ++++-------- collects/parser-tools/yacc.rkt | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/collects/parser-tools/private-yacc/table.rkt b/collects/parser-tools/private-yacc/table.rkt index f3df041..7eef2e2 100644 --- a/collects/parser-tools/private-yacc/table.rkt +++ b/collects/parser-tools/private-yacc/table.rkt @@ -158,8 +158,7 @@ (prod-index (reduce-prod current-guess)))) (loop (car rest) (cdr rest))) ((accept? (car rest)) - (fprintf (current-error-port) - "accept/reduce or accept/shift conflicts. Check the grammar for useless cycles of productions\n") + (eprintf "accept/reduce or accept/shift conflicts. Check the grammar for useless cycles of productions\n") (loop current-guess (cdr rest))) (else (loop current-guess (cdr rest))))))))) @@ -179,13 +178,11 @@ grouped-table))) (unless suppress (when (> SR-conflicts 0) - (fprintf (current-error-port) - "~a shift/reduce conflict~a\n" + (eprintf "~a shift/reduce conflict~a\n" SR-conflicts (if (= SR-conflicts 1) "" "s"))) (when (> RR-conflicts 0) - (fprintf (current-error-port) - "~a reduce/reduce conflict~a\n" + (eprintf "~a reduce/reduce conflict~a\n" RR-conflicts (if (= RR-conflicts 1) "" "s")))) table)) @@ -281,8 +278,7 @@ (unless (string=? file "") (with-handlers [(exn:fail:filesystem? (lambda (e) - (fprintf - (current-error-port) + (eprintf "Cannot write debug output to file \"~a\": ~a\n" file (exn-message e))))] diff --git a/collects/parser-tools/yacc.rkt b/collects/parser-tools/yacc.rkt index 9a3cc3c..5e2af6a 100644 --- a/collects/parser-tools/yacc.rkt +++ b/collects/parser-tools/yacc.rkt @@ -172,8 +172,7 @@ (when (and yacc-output (not (string=? yacc-output ""))) (with-handlers [(exn:fail:filesystem? (lambda (e) - (fprintf - (current-error-port) + (eprintf "Cannot write yacc-output to file \"~a\"\n" yacc-output)))] (call-with-output-file yacc-output