Commit graph

587 commits

Author SHA1 Message Date
Sebastian Ullrich
dfe1874365 refactor(frontends/lean/{parser,util}): extract quote functions
Also fixes ``f when f is private
2017-02-23 01:52:13 +01:00
Sebastian Ullrich
1c7ca3f20a feat(frontends/lean/parser): ignore implicit arguments in expr patterns 2017-02-23 01:52:13 +01:00
Sebastian Ullrich
908a7bd9f3 feat(frontends/lean/parser): expr patterns 2017-02-23 01:52:13 +01:00
Sebastian Ullrich
b9424975b3 refactor(init/meta): replace dynamically-checked quotes where possible 2017-02-17 19:59:57 -08:00
Sebastian Ullrich
9d8c84713c refactor(*): reduce exception context info from expr to pos_info 2017-02-17 13:45:57 +01:00
Sebastian Ullrich
d15591a2d8 feat(library,frontends/lean): expose parser to Lean and use for parsing tactic parameters 2017-02-17 13:45:56 +01:00
Leonardo de Moura
6334ff24eb fix(frontends/lean/tactic_notation): erase position information quoted terms occurring inside `[...]
See new test for understanding the problem.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2017-02-09 19:06:56 -08:00
Leonardo de Moura
898894ffaa feat(frontends/lean/parser): syntax sugar for auto_param gadget 2017-02-09 16:06:55 -08:00
Leonardo de Moura
3d603ec28e feat(kernel,library,frontends/lean,api): remove global universe levels from kernel and APIs 2017-02-08 17:41:44 -08:00
Leonardo de Moura
32e6442d0a feat(frontends/lean): no global universes in the frontend 2017-02-08 17:23:04 -08:00
Leonardo de Moura
aa5eea6416 feat(frontends/lean): add scope management to parser_state, remove unnecessary undef_ids 2017-02-08 11:58:14 -08:00
Leonardo de Moura
54f7bf9391 fix(frontends/lean, library/tactic): remove redundant error messages, and fix position of error messages
Summary:

We minimize the number of "'sorry' used warning messages".  We also
re-target the error to the main declaration. Example: foo._main ==> foo
We do not report for auxiliary declarations such as "_example" and
"foo.equations._eqn_1"

Get rid of the redundant error message "error : failed" for tactics.
We added "silent failures" in the tactic framework.

We do not store line/col information for tactics nested in notation
declarations.  Before this commit, we would have tactics such
as (tactic.save_info line col) nested inside of notation declarations.
2017-02-07 20:25:28 -08:00
Gabriel Ebner
cbc0bb1f7c feat(library/module): store whether we used sorry in olean 2017-02-05 16:35:32 +01:00
Gabriel Ebner
95068e4e79 feat(library/sorry): make sorry a macro 2017-02-05 14:01:03 +01:00
Leonardo de Moura
91b68b6b90 chore(frontends/lean/parser): remove dead variable 2017-02-03 19:55:19 -08:00
Leonardo de Moura
01414cf21c feat(frontends/lean): add token class, and procedure for consuming the tokens 2017-02-03 18:11:06 -08:00
Leonardo de Moura
3a4ef00f66 feat(frontends/lean): allow constructor parameters to be declared before ':' 2017-01-31 15:11:39 -08:00
Gabriel Ebner
0f96809f7a fix(frontends/lean/parser): save noncomputable theory flag in snapshots 2017-01-31 11:05:11 -08:00
Leonardo de Moura
4d3ff955d3 feat(frontends/lean): nicer syntax for default parameter values
See #1340
2017-01-30 15:54:26 -08:00
Leonardo de Moura
4fe73d3f87 fix(frontends/lean/elaborator, kernel/error_msgs): (re-)activate distinguishing_pp_options 2017-01-30 11:54:00 -08:00
Leonardo de Moura
bf9f7560f7 feat(frontends/lean): (Type u) can't be a proposition
(Type u)  is the old (Type (u+1))
(PType u) is the old (Type u)
Type*     is the old (Type (_+1))
PType*    is the old Type*

The stdlib can be compiled, but we still have > 70 broken tests

See discussion at #1341
2017-01-30 11:54:00 -08:00
Gabriel Ebner
5fdc737dfc feat(library/tactic): store name of current declaration in tactic_state 2017-01-28 08:27:19 +01:00
Leonardo de Moura
0048d0490b fix(frontends/lean/parser): structure followed by doc string 2017-01-23 10:35:07 -08:00
Leonardo de Moura
c62014df7a chore(frontends/lean/parser): style 2017-01-20 18:38:58 -08:00
Leonardo de Moura
9ed9de18bf feat(frontends/lean/parser): relax pattern validation rules 2017-01-20 18:38:14 -08:00
Gabriel Ebner
1a6629ce3b feat(frontends/lean/parser): keep list of tasks that have to succeed 2017-01-17 15:31:17 -08:00
Leonardo de Moura
bfa48ff0c7 fix(frontends/lean/parser): position info when error is inside notation 2017-01-16 10:29:00 -08:00
Gabriel Ebner
db81e4b5b8 feat(frontends/lean/parser): gracefully handle scanner exceptions in imports 2017-01-11 23:49:44 -08:00
Sebastian Ullrich
8eb39bb982 fix(frontends/lean/parser): catch exceptions thrown by sync_command 2017-01-10 14:42:48 -08:00
Sebastian Ullrich
cc3126e944 feat(frontends/lean,library/scoped_ext,shell): complete namespaces 2017-01-10 12:25:33 +01:00
Sebastian Ullrich
b04df04120 feat(frontends/lean): rework and simplify completion parsing, enabling completion of empty prefixes 2017-01-10 12:25:33 +01:00
Leonardo de Moura
7d540b6d02 fix(frontends/lean/parser): fixes #1290 2017-01-09 15:35:25 -08:00
Leonardo de Moura
93c8e69313 chore(frontends/lean, library): cleanup anonymous instance management 2017-01-06 14:37:44 -08:00
Sebastian Ullrich
7040844f9a feat(frontends/lean/parser,shell): complete imports 2017-01-06 14:02:31 -08:00
Sebastian Ullrich
3136f36ed6 fix(frontends/lean/parser): complete after periods trailing identifiers 2017-01-06 14:02:31 -08:00
Gabriel Ebner
063130ee18 feat(kernel/environment): add function that checks whether all proofs are correct 2017-01-05 18:09:28 -08:00
Leonardo de Moura
85b98f08e9 fix(frontends/lean): bad position at spurious 'end' token 2016-12-29 19:51:36 -08:00
Sebastian Ullrich
98398b16f3 feat(frontends/lean,shell): implement completing options 2016-12-27 21:41:02 -08:00
Sebastian Ullrich
daf839e0d5 feat(frontends/lean,shell/server): report current goal anywhere within begin-end/by 2016-12-27 10:07:34 -08:00
Sebastian Ullrich
5cb06ea912 perf(frontends/lean/parser): break at break_at_pos even if not on an interesting token 2016-12-27 10:07:34 -08:00
Sebastian Ullrich
8ccf28abf3 chore(*): remove old code 2016-12-27 10:07:34 -08:00
Sebastian Ullrich
c9a8c02fdc feat(emacs,frontends/lean/parser,shell/server): more accurate info command using server-side parsing 2016-12-27 10:07:34 -08:00
Gabriel Ebner
15157bdf0b feat(frontends/lean/parser): keep going after failed imports 2016-12-23 10:53:47 +01:00
Gabriel Ebner
0550d2a6ac refactor(library/module): import all modules in a single call 2016-12-20 10:15:19 -08:00
Gabriel Ebner
99fc13af98 refactor(library/module_mgr): cache olean imports as well 2016-12-20 10:15:19 -08:00
Leonardo de Moura
ffc9c75824 fix(frontends/lean/parser): do not clear local universes when switching to tactic mode and/or quoting 2016-12-19 09:21:54 -08:00
Leonardo de Moura
1cfef1c6d9 fix(frontends/lean/parser): save next_inst_idx in the parser snapshot
This fixes issues with anonymous instances in sections.
In Emacs, we would get spurious error messages such as:

   invalid parameter/variable declaration, '_inst_1' has already been declared

This commit also adds a regression test for the problem.
2016-12-18 23:39:28 -08:00
Leonardo de Moura
8b43314e23 feat(library/aliases,frontends/lean/parser): take local_ref's into account when defining new aliases; use get_local_ref at id_to_expr; use get_local_ref at resolve_local_name
see #1251
2016-12-15 14:10:44 -08:00
Leonardo de Moura
384cf04efd refactor(library/aliases,frontends/lean/local_ref_info): merge aliases and local_ref_info modules 2016-12-15 13:24:30 -08:00
Gabriel Ebner
8e0a5904d2 refactor(library/message_buffer): move info_manager out of scope_message_context 2016-12-12 08:23:15 -05:00