sorear / smetamath-rs

sorear's Metamath system engine - version 3 Rust
Apache License 2.0
22 stars 6 forks source link

Trim statement spans in error messages #27

Closed digama0 closed 8 years ago

digama0 commented 8 years ago

Given the input file test.mm:

$c x $.
a $p x x $= ? $.

Output:

$ target/release/smetamath --verify test.mm
test.mm:1:8:Warning:Proof is incomplete

Note that there are seven printable characters on the first line, so 1:8 is likely the \r before the newline. This is due to the span calculation for the statement, which includes the leading whitespace before the theorem, up through the end of the $p statement (which is not being printed in the error message). This span should be shrunk to begin at the a label, so that it reads 2:1 instead.

sorear commented 8 years ago

It's actually the \n itself, but yes. Realized that last night, was going to fix it but you got there first :+1: