fix(frontends/lean): missing ':' in error messages
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
f7c7dd4ed4
commit
84e211b81b
31 changed files with 60 additions and 60 deletions
|
@ -12,9 +12,9 @@ Author: Leonardo de Moura
|
|||
|
||||
namespace lean {
|
||||
void parser_imp::display_error_pos(unsigned line, unsigned pos) {
|
||||
regular(m_io_state) << m_strm_name << ":" << line;
|
||||
regular(m_io_state) << m_strm_name << ":" << line << ":";
|
||||
if (pos != static_cast<unsigned>(-1))
|
||||
regular(m_io_state) << ":" << pos;
|
||||
regular(m_io_state) << pos << ":";
|
||||
regular(m_io_state) << " error:";
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ static void tst2() {
|
|||
try {
|
||||
throw parser_exception(std::string("foo"), "[string]", 10, 100);
|
||||
} catch (parser_exception & ex) {
|
||||
lean_assert(std::string("[string]:10:100 error: foo") == ex.what());
|
||||
lean_assert(std::string("[string]:10:100: error: foo") == ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ static void tst3() {
|
|||
try {
|
||||
throw parser_exception(sstream() << "msg " << 10 << " " << 20, "[stream]", 10, 100);
|
||||
} catch (parser_exception & ex) {
|
||||
lean_assert(std::string("[stream]:10:100 error: msg 10 20") == ex.what());
|
||||
lean_assert(std::string("[stream]:10:100: error: msg 10 20") == ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ char const * parser_exception::what() const noexcept {
|
|||
try {
|
||||
static LEAN_THREAD_LOCAL std::string buffer;
|
||||
std::ostringstream s;
|
||||
s << m_fname << ":" << m_line << ":" << m_pos << " error: " << m_msg;
|
||||
s << m_fname << ":" << m_line << ":" << m_pos << ": error: " << m_msg;
|
||||
buffer = s.str();
|
||||
return buffer.c_str();
|
||||
} catch (std::exception & ex) {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
alias3.lean:2:13 error: alias 'A' was already defined
|
||||
alias3.lean:2:13: error: alias 'A' was already defined
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
Assumed: f
|
||||
Assumed: m
|
||||
Assumed: v1
|
||||
cast1.lean:13:7 error: type mismatch at application
|
||||
cast1.lean:13:7: error: type mismatch at application
|
||||
f m v1
|
||||
Function type:
|
||||
∀ (n : ℕ), vector ℤ n → ℤ
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
variable f : T → R
|
||||
coercion f
|
||||
Assumed: g
|
||||
coercion1.lean:8:0 error: invalid coercion declaration, frontend already has a coercion for the given types
|
||||
coercion1.lean:8:0: error: invalid coercion declaration, frontend already has a coercion for the given types
|
||||
Assumed: h
|
||||
coercion1.lean:10:0 error: invalid coercion declaration, a coercion must have an arrow type (i.e., a non-dependent functional type)
|
||||
coercion1.lean:10:0: error: invalid coercion declaration, a coercion must have an arrow type (i.e., a non-dependent functional type)
|
||||
Defined: T2
|
||||
Defined: R2
|
||||
Assumed: f2
|
||||
coercion1.lean:14:0 error: invalid coercion declaration, frontend already has a coercion for the given types
|
||||
coercion1.lean:14:0: error: invalid coercion declaration, frontend already has a coercion for the given types
|
||||
Assumed: id
|
||||
coercion1.lean:16:0 error: invalid coercion declaration, 'from' and 'to' types are the same
|
||||
coercion1.lean:16:0: error: invalid coercion declaration, 'from' and 'to' types are the same
|
||||
|
|
|
@ -10,7 +10,7 @@ Failed to solve
|
|||
10
|
||||
⊤
|
||||
Assumed: g
|
||||
elab1.lean:5:8 error: invalid expression, it still contains metavariables after elaboration, metavariable: ?M::1, type:
|
||||
elab1.lean:5:8: error: invalid expression, it still contains metavariables after elaboration, metavariable: ?M::1, type:
|
||||
Type
|
||||
Assumed: h
|
||||
Failed to solve
|
||||
|
@ -54,4 +54,4 @@ Failed to solve
|
|||
?M::0
|
||||
Bool
|
||||
Bool
|
||||
elab1.lean:25:18 error: unknown identifier 'EM'
|
||||
elab1.lean:25:18: error: unknown identifier 'EM'
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
Assumed: x
|
||||
env_errors.lean:3:0 error: set_opaque failed, 'x' is not a definition
|
||||
env_errors.lean:3:0: error: set_opaque failed, 'x' is not a definition
|
||||
before import
|
||||
env_errors.lean:11:0 error: file 'tstblafoo.lean' not found in the LEAN_PATH
|
||||
env_errors.lean:11:0: error: file 'tstblafoo.lean' not found in the LEAN_PATH
|
||||
before load1
|
||||
env_errors.lean:17:0 error: failed to open file 'tstblafoo.lean'
|
||||
env_errors.lean:17:0: error: failed to open file 'tstblafoo.lean'
|
||||
before load2
|
||||
env_errors.lean:23:0 error: corrupted binary file
|
||||
env_errors.lean:23:0: error: corrupted binary file
|
||||
before load3
|
||||
env_errors.lean:28:0 error: file 'fake2.olean' does not seem to be a valid object Lean file
|
||||
env_errors.lean:28:0: error: file 'fake2.olean' does not seem to be a valid object Lean file
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
Set: pp::unicode
|
||||
λ x : ?M::0, x
|
||||
λ x : ?M::0, x
|
||||
errmsg1.lean:4:10 error: invalid expression, it still contains metavariables after elaboration, metavariable: ?M::0, type:
|
||||
errmsg1.lean:4:10: error: invalid expression, it still contains metavariables after elaboration, metavariable: ?M::0, type:
|
||||
(Type U)
|
||||
errmsg1.lean:6:3 error: failed to synthesize metavar, its type is not a proposition, metavariable: ?M::0, type:
|
||||
errmsg1.lean:6:3: error: failed to synthesize metavar, its type is not a proposition, metavariable: ?M::0, type:
|
||||
A : Type, x : A ⊢ A → A
|
||||
errmsg1.lean:8:34 error: invalid definition, type still contains metavariables after elaboration, metavariable: ?M::3, type:
|
||||
errmsg1.lean:8:34: error: invalid definition, type still contains metavariables after elaboration, metavariable: ?M::3, type:
|
||||
(Type U)
|
||||
|
|
|
@ -6,11 +6,11 @@ and ⊤ ⊥
|
|||
Set: pp::unicode
|
||||
and true false
|
||||
Assumed: a
|
||||
ex2.lean:8:0 error: invalid object declaration, environment already has an object named 'a'
|
||||
ex2.lean:8:0: error: invalid object declaration, environment already has an object named 'a'
|
||||
Assumed: b
|
||||
and a b
|
||||
Assumed: A
|
||||
ex2.lean:12:8 error: type mismatch at application
|
||||
ex2.lean:12:8: error: type mismatch at application
|
||||
and a A
|
||||
Function type:
|
||||
Bool -> Bool -> Bool
|
||||
|
@ -19,7 +19,7 @@ Arguments types:
|
|||
A : Type
|
||||
variable A : Type
|
||||
(lean::pp::notation := false, pp::unicode := false, pp::colors := false)
|
||||
ex2.lean:15:11 error: unknown option 'lean::p::notation', type 'Help Options.' for list of available options
|
||||
ex2.lean:16:30 error: invalid option value, given option is not an integer
|
||||
ex2.lean:15:11: error: unknown option 'lean::p::notation', type 'Help Options.' for list of available options
|
||||
ex2.lean:16:30: error: invalid option value, given option is not an integer
|
||||
Set: lean::pp::notation
|
||||
a /\ b
|
||||
|
|
|
@ -9,4 +9,4 @@ module::@g : ∀ (A : Type), A → A → A
|
|||
h::1::explicit : ∀ (A B : Type), A → B → A
|
||||
Assumed: @h
|
||||
Assumed: h
|
||||
explicit.lean:9:37 error: failed to mark implicit arguments for 'h', the frontend already has an object named '@h'
|
||||
explicit.lean:9:37: error: failed to mark implicit arguments for 'h', the frontend already has an object named '@h'
|
||||
|
|
|
@ -8,6 +8,6 @@ f 10 : ℕ → ℕ
|
|||
Assumed: g
|
||||
g 10 20 ⊤ : Bool → Bool
|
||||
let r : ℝ → ℝ → ℝ := g 10 20 in r : ℝ → ℝ → ℝ
|
||||
implicit2.lean:11:0 error: invalid expression, unexpected token
|
||||
implicit2.lean:11:0: error: invalid expression, unexpected token
|
||||
Set: lean::pp::implicit
|
||||
let r : ℝ → ℝ → ℝ := @g ℕ 10 20 ℝ in r : ℝ → ℝ → ℝ
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
Set: pp::unicode
|
||||
Proof state:
|
||||
a : Bool, b : Bool, H : a, H::1 : b ⊢ a ∧ b
|
||||
## stdin:5:0 error: invalid 'done' command, proof cannot be produced from this state
|
||||
## stdin:5:0: error: invalid 'done' command, proof cannot be produced from this state
|
||||
Proof state:
|
||||
a : Bool, b : Bool, H : a, H::1 : b ⊢ a ∧ b
|
||||
## stdin:6:0 error: invalid 'done' command, proof cannot be produced from this state
|
||||
## stdin:6:0: error: invalid 'done' command, proof cannot be produced from this state
|
||||
Proof state:
|
||||
a : Bool, b : Bool, H : a, H::1 : b ⊢ a ∧ b
|
||||
## stdin:7:0 error: unknown tactic 'imp_tac2'
|
||||
## stdin:8:0 error: unknown tactic 'foo'
|
||||
## stdin:7:0: error: unknown tactic 'imp_tac2'
|
||||
## stdin:8:0: error: unknown tactic 'foo'
|
||||
## Proof state:
|
||||
a : Bool, b : Bool, H : a, H::1 : b ⊢ a
|
||||
a : Bool, b : Bool, H : a, H::1 : b ⊢ b
|
||||
## stdin:10:0 error: failed to backtrack
|
||||
## stdin:10:0: error: failed to backtrack
|
||||
Proof state:
|
||||
a : Bool, b : Bool, H : a, H::1 : b ⊢ a
|
||||
a : Bool, b : Bool, H : a, H::1 : b ⊢ b
|
||||
|
|
|
@ -6,15 +6,15 @@ A : Bool, B : Bool, H : A ∧ B ⊢ A
|
|||
no goals
|
||||
## Proof state:
|
||||
A : Bool, B : Bool, H : A ∧ B, H1 : A ⊢ B
|
||||
## stdin:15:3 error: unknown tactic 'simple2_tac'
|
||||
## stdin:15:16 error: invalid 'done' command, proof cannot be produced from this state
|
||||
## stdin:15:3: error: unknown tactic 'simple2_tac'
|
||||
## stdin:15:16: error: invalid 'done' command, proof cannot be produced from this state
|
||||
Proof state:
|
||||
A : Bool, B : Bool, H : A ∧ B, H1 : A ⊢ B
|
||||
## Proof state:
|
||||
no goals
|
||||
## Proof state:
|
||||
A : Bool, B : Bool, H : A ∧ B, H1 : A, H2 : B ⊢ B ∧ A
|
||||
## stdin:18:0 error: failed to prove theorem, proof has been aborted
|
||||
## stdin:18:0: error: failed to prove theorem, proof has been aborted
|
||||
Proof state:
|
||||
A : Bool, B : Bool, H : A ∧ B, H1 : A, H2 : B ⊢ B ∧ A
|
||||
# echo command after failure
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
Set: pp::unicode
|
||||
Proof state:
|
||||
a : Bool, b : Bool, H : a, H::1 : b ⊢ a ∧ b
|
||||
## stdin:5:0 error: unknown tactic 'foo'
|
||||
## stdin:6:5 error: failed to prove theorem, proof has been aborted
|
||||
## stdin:5:0: error: unknown tactic 'foo'
|
||||
## stdin:6:5: error: failed to prove theorem, proof has been aborted
|
||||
Proof state:
|
||||
a : Bool, b : Bool, H : a, H::1 : b ⊢ a ∧ b
|
||||
# Assumed: a
|
||||
|
|
|
@ -6,7 +6,7 @@ a : Bool, b : Bool, H : b ⊢ a ∨ b
|
|||
a : Bool, b : Bool, H : b ⊢ a
|
||||
## Proof state:
|
||||
a : Bool, b : Bool, H : b ⊢ b
|
||||
## stdin:9:0 error: failed to backtrack
|
||||
## stdin:9:0: error: failed to backtrack
|
||||
Proof state:
|
||||
a : Bool, b : Bool, H : b ⊢ b
|
||||
## Proof state:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Set: pp::colors
|
||||
Set: pp::unicode
|
||||
stdin:4:8 error: invalid definition, identifier expected
|
||||
stdin:4:8: error: invalid definition, identifier expected
|
||||
# done
|
||||
#
|
|
@ -2,12 +2,12 @@
|
|||
Set: pp::unicode
|
||||
Assumed: N
|
||||
Assumed: a
|
||||
kernel_ex1.lean:3:14 error: type expected, got
|
||||
kernel_ex1.lean:3:14: error: type expected, got
|
||||
a
|
||||
kernel_ex1.lean:4:6 error: function expected at
|
||||
kernel_ex1.lean:4:6: error: function expected at
|
||||
a a
|
||||
Assumed: f
|
||||
kernel_ex1.lean:6:6 error: type mismatch at application
|
||||
kernel_ex1.lean:6:6: error: type mismatch at application
|
||||
f (λ x : N, x)
|
||||
Function type:
|
||||
N → N
|
||||
|
|
|
@ -7,18 +7,18 @@ let b := ⊤, a : ℤ := b in a
|
|||
let a := 10, v1 := const a ⊤, v2 := v1 in v2 : vector Bool 10
|
||||
let a := 10, v1 : vector Bool a := const a ⊤, v2 : vector Bool a := v1 in v2
|
||||
let a := 10, v1 : vector Bool a := const a ⊤, v2 : vector Bool a := v1 in v2 : vector Bool 10
|
||||
let4.lean:32:26 error: type mismatch at definition 'v2', expected type
|
||||
let4.lean:32:26: error: type mismatch at definition 'v2', expected type
|
||||
vector ℤ a
|
||||
Given type:
|
||||
vector Bool a
|
||||
Assumed: foo
|
||||
Coercion foo
|
||||
let4.lean:41:26 error: type mismatch at definition 'v2', expected type
|
||||
let4.lean:41:26: error: type mismatch at definition 'v2', expected type
|
||||
vector ℤ a
|
||||
Given type:
|
||||
vector Bool a
|
||||
Set: lean::pp::coercion
|
||||
let4.lean:49:26 error: type mismatch at definition 'v2', expected type
|
||||
let4.lean:49:26: error: type mismatch at definition 'v2', expected type
|
||||
vector ℤ a
|
||||
Given type:
|
||||
vector Bool a
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
Assumed: x
|
||||
hello world
|
||||
ok
|
||||
lua2.lean:11 error: executing script, attempt to call global 'rint' (a nil value)
|
||||
lua2.lean:11: error: executing script, attempt to call global 'rint' (a nil value)
|
||||
Assumed: y
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
nbug1.lean:1:1 error: invalid notation declaration, at least one placeholder expected
|
||||
nbug1.lean:1:1: error: invalid notation declaration, at least one placeholder expected
|
||||
|
|
|
@ -13,4 +13,4 @@ foo::T : foo::a = foo::b
|
|||
foo::H : foo::b ≥ foo::a
|
||||
foo::a : ℕ
|
||||
foo::bla::a : ℤ
|
||||
ns1.lean:19:0 error: invalid 'end', not inside of a scope or namespace
|
||||
ns1.lean:19:0: error: invalid 'end', not inside of a scope or namespace
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
Assumed: c
|
||||
Assumed: f
|
||||
f a
|
||||
push.lean:11:5 error: unknown identifier 'f'
|
||||
push.lean:11:5: error: unknown identifier 'f'
|
||||
variable first : Bool
|
||||
10 ++ 20 : ℤ
|
||||
push.lean:20:9 error: unknown identifier '++'
|
||||
push.lean:22:0 error: main scope cannot be removed
|
||||
push.lean:20:9: error: unknown identifier '++'
|
||||
push.lean:22:0: error: main scope cannot be removed
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
scan_error1.lean:1:3 error: invalid character sequence, '...' ellipsis expected
|
||||
scan_error1.lean:1:3: error: invalid character sequence, '...' ellipsis expected
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
scan_error2.lean:1:21 error: unexpected end of script
|
||||
scan_error2.lean:1:21: error: unexpected end of script
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
scan_error3.lean:1:23 error: unexpected end of script
|
||||
scan_error3.lean:1:23: error: unexpected end of script
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
a
|
||||
scan_test2.lean:7:0 error: Command expected
|
||||
scan_test2.lean:7:0: error: Command expected
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Assumed: N
|
||||
Assumed: g
|
||||
Assumed: a
|
||||
tst9.lean:5:6 error: type mismatch at application
|
||||
tst9.lean:5:6: error: type mismatch at application
|
||||
g ⊤ (f ?M::0 a a)
|
||||
Function type:
|
||||
N → N → Bool
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Assumed: i
|
||||
λ x : ℤ, x + i : ℤ → ℤ
|
||||
λ x : ℕ, x + 1 : ℕ → ℕ
|
||||
ty1.lean:5:10 error: invalid expression, it still contains metavariables after elaboration, metavariable: ?M::0, type:
|
||||
ty1.lean:5:10: error: invalid expression, it still contains metavariables after elaboration, metavariable: ?M::0, type:
|
||||
(Type U)
|
||||
λ x y : ℤ, y + i + 1 + x : ℤ → ℤ → ℤ
|
||||
(λ x : ℤ, x) i : ℤ
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
Defined: TypeM
|
||||
univ.lean:29:0 error: universe constraint produces an integer overflow: Z2 >= Z1 + 1073741824
|
||||
univ.lean:42:0 error: universe constraint inconsistency: U1 >= U4 + 0
|
||||
univ.lean:29:0: error: universe constraint produces an integer overflow: Z2 >= Z1 + 1073741824
|
||||
univ.lean:42:0: error: universe constraint inconsistency: U1 >= U4 + 0
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Assumed: a
|
||||
Assumed: b
|
||||
Assumed: c
|
||||
vars1.lean:3:0 error: invalid object declaration, environment already has an object named 'b'
|
||||
vars1.lean:3:0: error: invalid object declaration, environment already has an object named 'b'
|
||||
Assumed: d
|
||||
Assumed: e
|
||||
Assumed: f
|
||||
|
|
Loading…
Add table
Reference in a new issue