Commit graph

4087 commits

Author SHA1 Message Date
Sebastian Ullrich
93d13ffea3 chore(library/init/lean): lean.parser.reader ~> lean.parser 2018-08-30 16:34:47 -07:00
Sebastian Ullrich
de9d894c14 feat(library/init/lean/parser/reader): use coroutine on the module level 2018-08-29 16:42:24 -07:00
Sebastian Ullrich
2528aee72b refactor(library/init/lean/parser/reader): use different monad stacks for different parts of the reader 2018-08-29 16:42:24 -07:00
Sebastian Ullrich
cec1ee2564 feat(library/init/lean/parser/parsec): reintroduce parsec_t 2018-08-29 16:42:24 -07:00
Sebastian Ullrich
a178f181a8 chore(library/init/lean/parser/macro): remove old name resolution prototype 2018-08-28 13:13:14 -07:00
Sebastian Ullrich
46f734b1b1 refactor(library/init/lean/parser/reader): replace macro with syntax_node_kind
Also make sure that the name inside a node kind is the full name of the
declaration. This way, we cannot have accidentally conflicting node kind names.
2018-08-28 13:13:14 -07:00
Leonardo de Moura
7a47406c4c chore(library/tactic): remove simp_lemmas 2018-08-23 14:10:36 -07:00
Leonardo de Moura
69734dfb3a chore(tests/lean): fix tests 2018-08-23 13:49:07 -07:00
Leonardo de Moura
d0f6bbdf02 chore(tests/lean): replace run_cmd with #eval 2018-08-23 13:32:25 -07:00
Leonardo de Moura
a1fffb2c9d chore(tests/lean/fail/run_command): obsolete test 2018-08-23 13:30:07 -07:00
Sebastian Ullrich
fd1aa589cf chore(tests/lean/reader1): fix test 2018-08-23 11:03:40 -07:00
Sebastian Ullrich
61f8ebf4ef refactor(library/init/lean/parser/reader): destructure reader into monad and has_tokens typeclass 2018-08-23 10:38:59 -07:00
Sebastian Ullrich
adfc8c9e62 chore(tests/lean/run/deriv): fix test 2018-08-23 10:38:59 -07:00
Sebastian Ullrich
6009279ab3 fix(library/compiler/cse): deactivate CSE for constructor applications
Fixes 1968
2018-08-22 14:32:03 -07:00
Sebastian Ullrich
c69cc61292 feat(frontends/lean,library/init/lean/parser/reader/module): add node_choice! macro
Creates an inductive type from an ordered choice reader
2018-08-22 14:32:03 -07:00
Leonardo de Moura
a968b68942 chore(tests/lean/trace1): fix test
@kha: `trace_root` and `trace_ctx` will probably have to be macros that add
`thunk.mk` for us. The coercion is not applied because the types contain metavariables.
The alternative is to implement a more robust coercion resolution procedure.
2018-08-21 16:21:31 -07:00
Sebastian Ullrich
6dbe54a01b chore(library/init/io): rename io.print_ln to io.println 2018-08-21 08:43:10 -07:00
Sebastian Ullrich
3516c37ec9 feat(library/init/control/coroutine_io): coroutine_io 2018-08-21 08:43:10 -07:00
Sebastian Ullrich
6b55e24ab7 feat(library/init/{io,control/except}): use lift_t to automatically upcast io and other errors 2018-08-21 08:43:09 -07:00
Sebastian Ullrich
9db688f4c2 fix(library/{vm/vm_io,init/io}): fix bugs and tests 2018-08-21 08:43:09 -07:00
Sebastian Ullrich
37e5f03351 refactor(library/system/io): move into init 2018-08-21 08:43:09 -07:00
Leonardo de Moura
8a96fde229 feat(library/init/control/coroutine): add coroutine
Remark: the termination proofs are commented because Lean 4 is
currently ignoring them and accepting non-terminating functions.

These files are based on an experiment implemented using Lean 3.
We can find it here:
https://gist.github.com/leodemoura/f5d82426c105b5fae0880e77024f6e9c

We will use coroutines to implement the interaction between reader,
elaborator and main driver.
2018-08-12 17:14:02 -07:00
Sebastian Ullrich
bf043ab8bd feat(library/init/lean/parser/reader/basic): first has_view prototype, plus prefix ~> notation expansion based on it 2018-08-02 20:35:15 -07:00
Sebastian Ullrich
1e1bf4b0f8 feat(library/init/lean/parser/reader/basic): add explicit syntax.missing objects on error 2018-08-02 13:32:28 -07:00
Sebastian Ullrich
3951db3b0b fix(library/init/lean/parser/reader/basic): error recovery reprint issue 2018-07-30 17:55:17 -07:00
Sebastian Ullrich
87dc8adbe6 fix(library/init/lean/parser/parsec): monad_except.catch should not reset position, consumed flag 2018-07-30 17:50:37 -07:00
Sebastian Ullrich
8666047703 feat(library/init/lean/parser/reader/module): reserve, mixfix, universe commands 2018-07-30 17:30:20 -07:00
Sebastian Ullrich
1c2ca922af test(tests/lean/reader1): test for perfect roundtripping 2018-07-30 17:30:20 -07:00
Sebastian Ullrich
242d63af25 fix(library/init/lean/parser/reader/basic): store token start position for perfect roundtripping 2018-07-30 17:30:20 -07:00
Sebastian Ullrich
312de57aec test(tests/lean/reader1): test error recovery and fix bug 2018-07-30 17:30:20 -07:00
Sebastian Ullrich
0fd9d29ba2 feat(library/init/lean/parser/reader/module): command-level error recovery 2018-07-30 10:38:00 -07:00
Sebastian Ullrich
3728b2ba3f feat(library/init/lean/parser/reader/basic): add error list handling 2018-07-30 10:38:00 -07:00
Sebastian Ullrich
2823bebd23 refactor(library/init/lean/parser/parsec): message.pos: replace with iterator
This allows efficient recovery from a parse error as well as implementing
`has_to_string` for `message`
2018-07-30 10:38:00 -07:00
Sebastian Ullrich
10b18e77a1 feat(library/init/lean/parser/reader/basic): combinators: create partial syntax trees 2018-07-27 16:19:02 -07:00
Sebastian Ullrich
046b1890ad feat(src/frontends/lean/decl_util): ignore out_params when deciding whether to include an anonymous inst implicit section variable 2018-07-27 14:49:09 -07:00
Sebastian Ullrich
65fd050b83 feat(library/init/lean/parser/parsec): add custom error message type 2018-07-27 14:29:50 -07:00
Sebastian Ullrich
f714a6703f refactor(library/init/lean/parser/reader/module): coercions and notations 2018-07-26 17:28:11 -07:00
Sebastian Ullrich
1c561726de feat(library/init/lean/parser/reader/module): basic notation command 2018-07-18 17:45:37 +02:00
Sebastian Ullrich
8444a7412e feat(library/init/lean/parser/reader/basic): add a small monad transformer for managing recursion and use it to implement recursive section parsing 2018-07-16 18:39:23 +02:00
Sebastian Ullrich
68936e3f80 fix(library/init/lean/format): ensure to_fmt (f : format) = f 2018-07-16 18:14:01 +02:00
Sebastian Ullrich
5b55600e71 feat(library/init/lean/parser/reader/module): open command 2018-07-16 12:38:27 +02:00
Sebastian Ullrich
9e5ae42625 chore(library/init/lean/parser/reader/token): improve error messages 2018-07-13 16:10:13 +02:00
Sebastian Ullrich
09a0397648 fix(library/init/lean/parser/reader/token): fix keyword parsing using longest_match 2018-07-13 15:51:48 +02:00
Sebastian Ullrich
72b255d4e1 chore(library/init/lean/parser/parser_t): rename module and type to parsec to avoid nested use of parser 2018-07-12 10:35:20 +02:00
Sebastian Ullrich
e57117a9b3 chore(library/init/lean/parser/parser_t): revert introduction of parser_t 2018-07-11 18:44:04 +02:00
Sebastian Ullrich
6fa4e56fbe feat(library/init/lean/parser/syntax): add and test reprinter 2018-07-11 14:34:50 +02:00
Sebastian Ullrich
b2f9b2c180 feat(library/init/lean/parser/{syntax,reader}): store whitespace around tokens 2018-07-11 14:34:50 +02:00
Sebastian Ullrich
ab19966d65 feat(library/init/lean/parser/reader): automatically promote tokens through readers 2018-07-05 18:01:17 +02:00
Sebastian Ullrich
fbdb73665f test(tests/lean/reader1): start testing the tokenizer on core.lean and fix a comment bug 2018-07-05 16:51:48 +02:00
Sebastian Ullrich
fea91abf88 chore(tests/lean): add leanpkg file to make sure the same cwd is used in test runs and the interactive server 2018-07-05 16:48:56 +02:00