lean4-htt/src/frontends/lean
Leonardo de Moura cd21793b53 fix(frontends/lean/elaborator): assertion violation
Prevent assertion violation when processing examples such as:
```
@[pattern] def badPattern (x : Nat) : Nat := 0

def tst (y : Nat) : Nat :=
match y with
| (@badPattern _) := 1
| _               := 2
```

The `x` is not used in `badPattern`. Thus, the elaborator fails to
synthesize the metavariable corresponding to `_` at `@badPattern _`.

The fix detects this kind of instance, but I commented the code the
throws the error because we would prevent us from compiling `term.lean`.
The assertion violation was originally triggered by the pattern definition
```
@[pattern] def «explicitBinderContent» (requireType : optParam.{1} Bool Bool.false) :=
  {SyntaxNodeKind . name := `Lean.Parser.Term.explicitBinderContent}
at

...
  view := fun stx, let (stx, i) := match stx.asNode : _ -> Prod Syntax Nat with
  | some {kind := @«explicitBinderContent» requireType,   -- << HERE
          args := [stx], ..} := ...
```
These definitions were generated by the node choice macro.

cc @kha
2019-03-27 16:42:59 -07:00
..
brackets.cpp feat(library,frontends/lean): use mdata instead of hacky cache for position information in preterms 2018-09-02 18:08:41 -07:00
brackets.h feat(frontends/lean): add default field values 2017-01-22 21:25:49 -08:00
builtin_cmds.cpp chore(util/sexpr): preparing to port options to Lean 2019-03-22 13:58:16 -07:00
builtin_cmds.h
builtin_exprs.cpp chore(library/constants.txt): remove dead variables 2019-03-22 13:26:48 -07:00
builtin_exprs.h chore(frontends/lean): remove tactic notation 2018-08-23 13:44:52 -07:00
choice.cpp chore(frontends/lean/choice): cleanup 2018-06-18 15:29:21 -07:00
choice.h refactor(frontends/lean/choice): use mdata to implement choice 2018-06-18 14:21:11 -07:00
CMakeLists.txt refactor(frontends/lean/lean_environment): move environment parts out of lean_elaborator.cpp 2019-03-25 16:12:14 +01:00
cmd_table.h chore(frontends/lean): fix clang++ warnings at C++ 2019-01-30 15:19:34 -08:00
decl_attributes.cpp fix(frontends/lean/decl_attributes): fix attribute parsing in old frontend 2019-02-15 12:13:45 -08:00
decl_attributes.h fix(frontends/lean): must set m_gen_code = false for auxiliary declarations of extern declarations 2019-02-12 17:52:06 -08:00
decl_cmds.cpp feat(frontends/lean): add partial keyword 2019-03-26 16:09:55 -07:00
decl_cmds.h feat(frontends/lean, library/init/lean): opaque constants 2019-03-15 17:41:44 -07:00
decl_util.cpp feat(library/equations_compiler/equations): add m_is_partial to equation header 2019-03-26 16:18:43 -07:00
decl_util.h feat(frontends/lean): add partial keyword 2019-03-26 16:09:55 -07:00
definition_cmds.cpp feat(library/equations_compiler): add support for partial definitions 2019-03-27 11:09:32 -07:00
definition_cmds.h feat(library/init/lean/elaborator,frontends/lean/vm_elaborator): implement def/theorem/abbreviation 2019-01-12 15:10:00 +01:00
elaborator.cpp fix(frontends/lean/elaborator): assertion violation 2019-03-27 16:42:59 -07:00
elaborator.h fix(frontends/lean/elaborator): assertion violation 2019-03-27 16:42:59 -07:00
inductive_cmds.cpp chore(*): meta ==> unsafe 2019-03-15 15:04:40 -07:00
inductive_cmds.h fix(frontends/lean/inductive_cmds): set m_explicit_levels, and call collect_implicit_locals only after that 2019-01-15 16:47:28 +01:00
init_module.cpp refactor(frontends/lean/lean_environment): move environment parts out of lean_elaborator.cpp 2019-03-25 16:12:14 +01:00
init_module.h
json.cpp refactor(library/messages): make an object_ref 2018-09-11 13:55:25 -07:00
json.h refactor(*): task<T>, log_tree, cancellation_token 2017-03-23 08:57:52 +01:00
lean_elaborator.cpp refactor(frontends/lean/lean_environment): move environment parts out of lean_elaborator.cpp 2019-03-25 16:12:14 +01:00
lean_elaborator.h refactor(frontends/lean/lean_environment): move environment parts out of lean_elaborator.cpp 2019-03-25 16:12:14 +01:00
lean_environment.cpp refactor(frontends/lean/lean_environment): move environment parts out of lean_elaborator.cpp 2019-03-25 16:12:14 +01:00
lean_environment.h refactor(frontends/lean/lean_environment): move environment parts out of lean_elaborator.cpp 2019-03-25 16:12:14 +01:00
local_context_adapter.cpp feat(library,frontends/lean): use mdata instead of hacky cache for position information in preterms 2018-09-02 18:08:41 -07:00
local_context_adapter.h
local_decls.h
local_level_decls.h
match_expr.cpp fix(library/compiler): we need to unfold auxiliary nested _match applications eagerly 2018-09-18 14:17:37 -07:00
match_expr.h chore(frontends/lean): fix clang++ warnings at C++ 2019-01-30 15:19:34 -08:00
notation_cmd.cpp chore(library, frontends): use camelCase for attribute names 2019-03-21 15:06:43 -07:00
notation_cmd.h chore(frontends/lean): fix clang++ warnings at C++ 2019-01-30 15:19:34 -08:00
parse_table.cpp feat(library,frontends/lean): use mdata instead of hacky cache for position information in preterms 2018-09-02 18:08:41 -07:00
parse_table.h chore(frontends/lean): fix clang++ warnings at C++ 2019-01-30 15:19:34 -08:00
parser.cpp chore(library/init): Bool.tt => Bool.true and Bool.ff => Bool.false 2019-03-21 15:06:44 -07:00
parser.h feat(library/compiler): add [extern] attribute 2019-02-09 18:53:44 -08:00
parser_config.cpp chore(library): remove fingerprint 2018-09-07 12:54:19 -07:00
parser_config.h refactor(*): add runtime folder 2018-05-14 14:23:56 -07:00
parser_pos_provider.h refactor(kernel): remove tag from kernel expressions 2018-06-08 10:29:22 -07:00
parser_state.h chore(frontends/lean): remove break_at_pos support 2018-09-07 08:34:19 -07:00
pp.cpp chore(library/init): Unit.star => Unit.unit 2019-03-22 13:06:45 -07:00
pp.h feat(frontends/lean/pp): add pp.compact_let option 2018-09-20 12:05:48 -07:00
prenum.cpp feat(*): use new inductive datatype module 2018-09-06 18:09:22 -07:00
prenum.h feat(frontends/lean): remove prenum macro 2018-06-14 15:46:35 -07:00
print_cmd.cpp chore(*): meta ==> unsafe 2019-03-15 15:04:40 -07:00
print_cmd.h chore(frontends/lean): fix clang++ warnings at C++ 2019-01-30 15:19:34 -08:00
scanner.cpp feat(runtime, library/init/data/string/basic): add utf8_pos 2019-03-09 12:30:19 -08:00
scanner.h refactor(kernel): move formatting stuff out of the kernel 2018-06-07 16:28:54 -07:00
simple_pos_info_provider.h feat(frontends/lean/vm_elaborator): recover from unknown identifiers 2019-02-07 14:16:28 +01:00
structure_cmd.cpp chore(frontends/lean/structure_cmd): toParent instead of to_Parent 2019-03-21 15:06:44 -07:00
structure_cmd.h feat(frontends/lean/structure_cmd): implement structure 2019-01-15 15:01:52 +01:00
structure_instance.cpp feat(*): use new inductive datatype module 2018-09-06 18:09:22 -07:00
structure_instance.h feat(frontends/lean/{parser,elaborator}): structure instance patterns 2017-11-22 12:16:28 -08:00
token_table.cpp feat(frontends/lean): add partial keyword 2019-03-26 16:09:55 -07:00
token_table.h feat(library/tactic): add zeta option, refactor simplify config option, allow users to change simplify_config in interactive mode 2017-02-19 12:11:22 -08:00
tokens.cpp feat(frontends/lean): add partial keyword 2019-03-26 16:09:55 -07:00
tokens.h feat(frontends/lean): add partial keyword 2019-03-26 16:09:55 -07:00
tokens.txt feat(frontends/lean): add partial keyword 2019-03-26 16:09:55 -07:00
type_util.cpp
type_util.h chore(frontends/lean): fix clang++ warnings at C++ 2019-01-30 15:19:34 -08:00
typed_expr.cpp refactor(library/typed_expr): move typed_expr to frontends/lean 2018-04-09 15:25:40 -07:00
typed_expr.h refactor(library/typed_expr): move typed_expr to frontends/lean 2018-04-09 15:25:40 -07:00
util.cpp fix(frontends/lean/util): another mismatch to naming convention change 2019-03-21 15:06:46 -07:00
util.h chore(frontends/lean): fix clang++ warnings at C++ 2019-01-30 15:19:34 -08:00