fix(frontends/lean/parser): add workaround for #461
This commit is contained in:
parent
b9e3c474c9
commit
f2b1752807
3 changed files with 23 additions and 2 deletions
|
@ -1432,7 +1432,7 @@ expr parser::parse_tactic_led(expr left) {
|
|||
expr right = parse_tactic();
|
||||
return mk_app({save_pos(mk_constant(get_tactic_and_then_name()), p), left, right}, p);
|
||||
} else {
|
||||
throw parser_error("invalid tactic expression", p);
|
||||
return parse_led(left);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
errors.lean:4:0: error: unknown identifier 'a'
|
||||
tst1 : nat → nat → nat
|
||||
errors.lean:12:12: error: invalid tactic expression
|
||||
errors.lean:12:2: error: function expected at
|
||||
tactic.cases [tactic.expr add] tactic.expr_list.nil
|
||||
errors.lean:22:12: error: unknown identifier 'b'
|
||||
tst3 A : A → A → A
|
||||
foo.tst1 : ℕ → ℕ → ℕ
|
||||
|
|
20
tests/lean/run/all_goals2.lean
Normal file
20
tests/lean/run/all_goals2.lean
Normal file
|
@ -0,0 +1,20 @@
|
|||
import data.nat
|
||||
open nat
|
||||
|
||||
attribute nat.add [unfold-c 2]
|
||||
attribute nat.rec_on [unfold-c 2]
|
||||
|
||||
namespace tactic
|
||||
definition then_all (t1 t2 : tactic) : tactic :=
|
||||
focus (t1 ; all_goals t2)
|
||||
infixl `;;`:15 := tactic.then_all
|
||||
end tactic
|
||||
|
||||
open tactic
|
||||
example (a b c : nat) : (a + 0 = 0 + a ∧ b + 0 = 0 + b) ∧ c = c :=
|
||||
|
||||
begin
|
||||
apply and.intro,
|
||||
apply and.intro ;; (esimp{of_num}; state; rewrite zero_add),
|
||||
apply rfl
|
||||
end
|
Loading…
Reference in a new issue