Commit Graph

24 Commits

Author SHA1 Message Date
Niko Matsakis 1fdbfcdbd0 only emit ^ at the start of a multi-line error
as a result, simplify elision code
2016-05-02 11:49:25 -04:00
Niko Matsakis 94841bea7b Nit: in emitter.rs 2016-05-02 11:49:25 -04:00
Niko Matsakis f6496cd370 Nit: address various style nits 2016-05-02 11:49:24 -04:00
Niko Matsakis 1067850e6a refactor the Emitter trait
There is now a CoreEmitter that everything desugars to, but without
losing any information. Also remove RenderSpan::FileLine. This lets the
rustc_driver tests build.
2016-05-02 11:49:24 -04:00
Niko Matsakis 41a652e094 WIP factor out RudimentaryEmitter 2016-05-02 11:49:24 -04:00
Niko Matsakis 11dc974a38 refactor to use new snippet code and model
Major changes:
- Remove old snippet rendering code and use the new stuff.
- Introduce `span_label` method to add a label
- Remove EndSpan mode and replace with a fn to get the last
  character of a span.
- Stop using `Option<MultiSpan>` and just use an empty `MultiSpan`
- and probably a bunch of other stuff :)
2016-05-02 11:47:10 -04:00
Niko Matsakis 01d2b4ab6b port compiletest to use JSON output
This uncovered a lot of bugs in compiletest and also some shortcomings
of our existing JSON output. We had to add information to the JSON
output, such as suggested text and macro backtraces. We also had to fix
various bugs in the existing tests.

Joint work with jntrnr.
2016-04-21 04:42:24 -04:00
Jorge Aparicio 2628f3cc8f fix alignment 2016-03-22 22:03:54 -05:00
Jorge Aparicio 0f02309e4b try! -> ?
Automated conversion using the untry tool [1] and the following command:

```
$ find -name '*.rs' -type f | xargs untry
```

at the root of the Rust repo.

[1]: https://github.com/japaric/untry
2016-03-22 22:01:37 -05:00
mitaa 1fcdedb8fb Fix rendering of single-char-span
A span spanning only a single character would render like `^~`
instead of just `^`.
2016-02-03 16:54:37 +01:00
Steve Klabnik a9fbb05535 Rollup merge of #31281 - oli-obk:patch-2, r=nikomatsakis 2016-02-02 00:32:18 -05:00
Daniel Campbell e1be504068 Spans now derive equality 2016-02-01 10:18:50 +13:00
Oliver Schneider 54927ac57f off by one 2016-01-30 13:40:40 +01:00
mitaa fe10914adc Update emitter.rs 2016-01-29 13:45:15 +01:00
Oliver Schneider b5845c6427 fix overflow due to multiline error span 2016-01-29 11:25:20 +01:00
mitaa 727f959095 Implement MultiSpan error reporting
This allows to render multiple spans on one line,
or to splice multiple replacements into a code suggestion.
2016-01-28 20:51:06 +01:00
Manish Goregaokar d829019ff4 Make emitter handle DUMMY_SP correctly 2016-01-26 13:49:21 +05:30
Nick Cameron fd46c78f8f Add an --output option for specifying an error emitter 2016-01-15 10:24:12 +13:00
Nick Cameron 04d972906d Rebasing and review comments 2015-12-30 14:54:36 +13:00
Nick Cameron 95dc7efad0 use structured errors 2015-12-30 14:27:59 +13:00
Nick Cameron 253a1cefd8 Structured diagnostics 2015-12-30 14:27:59 +13:00
Nick Cameron ff0c74f7d4 test errors 2015-12-17 10:00:16 +13:00
Nick Cameron e2371518c4 A little more refactoring inside emitter.rs 2015-12-17 09:35:51 +13:00
Nick Cameron 7a0334944b Add the files I fogot about earlier
d'oh
2015-12-17 09:35:51 +13:00