Skip to content

Commit

Permalink
FsLex/FxYacc error messages redirected to stderr stream
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-tihon committed Jul 16, 2014
1 parent 3415c36 commit a81f0e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/FsLex/fslex.fs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ let main() =
try
Parser.spec Lexer.token lexbuf
with e ->
printf "%s(%d,%d): error: %s" filename lexbuf.StartPos.Line lexbuf.StartPos.Column
eprintf "%s(%d,%d): error: %s" filename lexbuf.StartPos.Line lexbuf.StartPos.Column
(match e with
| Failure s -> s
| _ -> e.Message);
Expand Down Expand Up @@ -218,7 +218,7 @@ let main() =
cfprintfn os "# 3000000 \"%s\"" output;

with e ->
printf "FSLEX: error FSL000: %s" (match e with Failure s -> s | e -> e.ToString());
eprintf "FSLEX: error FSL000: %s" (match e with Failure s -> s | e -> e.ToString());
exit 1


Expand Down
4 changes: 2 additions & 2 deletions src/FsYacc/fsyacc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ let main() =

Parser.spec Lexer.token lexbuf
with e ->
printf "%s(%d,%d): error: %s" filename lexbuf.StartPos.Line lexbuf.StartPos.Column e.Message;
eprintf "%s(%d,%d): error: %s" filename lexbuf.StartPos.Line lexbuf.StartPos.Column e.Message;
exit 1 in

let has_extension (s:string) =
Expand Down Expand Up @@ -526,6 +526,6 @@ let main() =
let _ =
try main()
with e ->
printf "FSYACC: error FSY000: %s" (match e with Failure s -> s | e -> e.Message);
eprintf "FSYACC: error FSY000: %s" (match e with Failure s -> s | e -> e.Message);
exit 1

0 comments on commit a81f0e9

Please sign in to comment.