fix(frontends/lean/parser): tactic notation that may take numerical parameters
This commit is contained in:
parent
70f71a18c8
commit
2502039a5c
3 changed files with 10 additions and 0 deletions
|
@ -2025,6 +2025,8 @@ expr parser::parse_tactic_nud() {
|
|||
}
|
||||
} else if (curr_is_keyword()) {
|
||||
return parse_tactic_notation(tactic_nud(), nullptr);
|
||||
} else if (curr_is_numeral() || curr_is_decimal()) {
|
||||
return parse_expr();
|
||||
} else {
|
||||
throw parser_error("invalid tactic expression", pos());
|
||||
}
|
||||
|
|
|
@ -357,6 +357,7 @@ public:
|
|||
bool curr_is_identifier() const { return curr() == scanner::token_kind::Identifier; }
|
||||
/** \brief Return true iff the current token is a numeral */
|
||||
bool curr_is_numeral() const { return curr() == scanner::token_kind::Numeral; }
|
||||
bool curr_is_decimal() const { return curr() == scanner::token_kind::Decimal; }
|
||||
/** \brief Return true iff the current token is a string */
|
||||
bool curr_is_string() const { return curr() == scanner::token_kind::String; }
|
||||
/** \brief Return true iff the current token is a keyword */
|
||||
|
|
7
tests/lean/run/tactic_notation_num_arg_bug.lean
Normal file
7
tests/lean/run/tactic_notation_num_arg_bug.lean
Normal file
|
@ -0,0 +1,7 @@
|
|||
tactic_notation `foo` A := tactic.id
|
||||
|
||||
example (a : nat) : a = a :=
|
||||
begin
|
||||
foo (10:nat),
|
||||
reflexivity
|
||||
end
|
Loading…
Reference in a new issue