Closed Bug 418171 Opened 17 years ago Closed 17 years ago

ESC should not print full stack trace on syntax error.

Categories

(Tamarin Graveyard :: Self-hosting compiler (ESC), enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED WONTFIX

People

(Reporter: markh, Assigned: markh)

Details

Attachments

(1 file)

The esc command-line tool should not print a full stack-trace when it sees a SyntaxError, as this stacktrace just points inside the compiler and may be many lines long. I'm attaching a fairly trivial patch that fixes this. Note however that is is not perfect - a 1-line stack-trace is still printed as I can't see a way to terminate the compiler with a non-zero exit code other than via an Exception. 1 line is still much better than the many lines that may be printed now.
Attachment #303959 - Flags: review?(lhansen)
Point 1, I think System.exit(1) is what you're looking for to exit properly. Point 2, I actually find these backtraces useful when debugging the compiler, since half the time it's a compiler bug and not a bug in the program being compiled... I'm sure you're not ecstatic about seeing the other diagnostic output either (specifically the compile times). So how about we refine this fix: add the provision for a flag --verbose, which must precede all filenames on the command line. If it is set, then the exception is not caught and the compile time and other diagnostics are printed. If it is not set, then the compiler is quiet, like you would like it to be. The makefile in esc/build will pass --verbose.
Fair enough - its not a real problem.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
Attachment #303959 - Flags: review?(lhansen)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: