Commit Graph

26 Commits

Author SHA1 Message Date
Marijn Haverbeke
9ff5ba085d Fix bad line printing for parse errors
The code that extracted lines from partially-parsed files
was broken.

Closes #1848
2012-02-15 11:53:32 +01:00
Kevin Atkinson
0e44133e7c Do a better job of reporting source location for files (i.e. filemap)
that are really a substr of another file.
2012-02-14 19:37:33 -08:00
Kevin Cantu
2b4f5136a5 (core::str) rename byte_len -> len_bytes and rename char_len -> len 2012-02-12 15:30:20 -08:00
Ted Horst
36d5074f8f log to stderr instead of stdout
includes rustc diagnostics
runtest updated to check stderr for errors
2012-02-10 19:42:32 -08:00
Brian Anderson
3bd0338c19 Revert "log to stderr instead of stdout"
This is causing mysterious hangs on windows. Issue #1769.

This reverts commit d65eabd5de.
2012-02-06 18:29:58 -08:00
Kevin Atkinson
b7ec2488ff Fix macro backtraces.
In addition add information about the macro doing the expansion, and
move the printing of the expansion backtrace from codemap::span_to_str
to the diagnostic code.  The backtrace is now more verbose and
includes information on the macro doing the expansion, in addition to
the expansion site.
2012-02-05 15:38:27 -08:00
Ted Horst
d65eabd5de log to stderr instead of stdout
includes rustc diagnostics
runtest updated to check stderr for errors
2012-02-03 20:55:53 -08:00
Kevin Atkinson
1c91fb4d91 Don't rely on filename to get a file from the filemap
as there may be more than one filemap with the same filename (in the
case of stdin for instance).  This involved storing a pointer to the
filemap rather than the filename in location info such as
codemap::pos.
2012-02-03 20:41:49 -07:00
Kevin Atkinson
c5e03e0e59 Keep source file around after parsing.
Specifically box the string (to avoid unnecessary copies) and store it
in codemap::filemap.

Remove the hack in driver::diagnostic that rereads the source from the
file and instead just get the source from the filemap.

(This commit is also a prerequisite for issue #1612)
2012-01-25 16:00:47 -07:00
Brian Anderson
0886b69b76 rustc: Bump the error count on non-span errors 2012-01-24 23:07:16 -08:00
Patrick Walton
9ecd5ee81d rustc: Split diagnostics into "span diagnostics" and "diagnostics".
The former contain a codemap (which is per-crate), and the latter don't. This
will be useful in order to allow more than one crate to be compiled in one run
of the compiler.
2012-01-24 21:42:54 -08:00
Patrick Walton
c267821742 rustc: ";" to "," in enums 2012-01-19 18:04:25 -08:00
Patrick Walton
bdb8f6cf52 rustc: "tag" -> "enum" 2012-01-19 14:24:03 -08:00
Tim Chevalier
04a2887f87 Remove '.' after nullary tags in patterns
Does what it says on the tin.

The next commit will remove support for this syntax.
2012-01-18 23:17:34 -08:00
Brian Anderson
d9d3be7acc rustc: Extract the logic for generating an ICE message 2012-01-14 15:14:43 -08:00
Brian Anderson
8f57be5bff rustc: Rename mk_codemap_handler to mk_handler 2012-01-14 15:14:43 -08:00
Brian Anderson
77e95dcf9f rustc: Rename emit_diagnostic to emit 2012-01-14 15:14:43 -08:00
Brian Anderson
876e9fdc06 rustc: Rename diagnostic::diagnostictype to 'level' 2012-01-14 15:14:43 -08:00
Brian Anderson
824beb4c3b rustc: Make it not an error when the source can't be loaded for highlighting
I plan to have a callback mechanism for reporting errors and it gets wierd
when reporting errors while reporting an error.
2012-01-14 15:14:43 -08:00
Brian Anderson
e4849d5e5d rustc: Allow a custom diagnostic emitter when building the handler 2012-01-14 15:14:43 -08:00
Brian Anderson
dbf6ed9221 rustc: Remove emit_fatal/error/warning/note functions 2012-01-13 22:07:55 -08:00
Brian Anderson
1a6383a0eb rustc: Add a distinct fatal diagnostic level 2012-01-13 22:07:55 -08:00
Brian Anderson
2e69c29660 rustc: Replace session's error handling with diagnostic impl 2012-01-13 22:07:55 -08:00
Brian Anderson
d4e089e94b rustc: Add diagnostic::handler iface and default impl
This is for moving error handling logic out of the session
2012-01-13 22:07:55 -08:00
Brian Anderson
da6674baed rustc: Stop exporting various things from driver::diagnostic 2012-01-13 16:08:59 -08:00
Brian Anderson
ced0aa13d3 rustc: Extract driver::diagnostic from syntax::codemap 2012-01-13 16:06:56 -08:00