Commit graph

18 commits

Author SHA1 Message Date
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
762259a96f chore(library/init/lean/parser/reader): cleanup 2018-08-22 14:32:03 -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
e34f2e8cd7 chore(library/init/lean/parser): improve error messages 2018-07-30 10:38:00 -07:00
Sebastian Ullrich
389e9b7b49 feat(library/init/lean/parser/parsec): use [inhabited μ] instead of unit for custom message type of basic parsers
In hindsight, this seems to simplify usage without compromising static typing much
2018-07-27 15:10:20 -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
669de39df8 refactor(library/init/lean/parser/reader/module): make symbol a local coercion 2018-07-26 17:28:11 -07:00
Sebastian Ullrich
134d27dbec feat(library/init/lean/parser/parsec): longest_match should return all longest parses
In the case of overlapping notations, we will return a choice node of all
possible parses.
2018-07-25 18:07:56 -07: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
9db0724bf1 refactor(library/init/lean/parser/parsec): monad_parsec: move from monad_lift/monad_map to direct primitives
This breaks the code for variable-length tokens that depended on lifting
`parsec` into `read_m`. Either `read_m` could be parameterized by its state,
or we just hard-code all variable-length tokens.
2018-07-12 17:53:43 +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
b2f9b2c180 feat(library/init/lean/parser/{syntax,reader}): store whitespace around tokens 2018-07-11 14:34:50 +02:00
Sebastian Ullrich
67d93ff051 fix(library/init/lean/parser/reader/token): fix loops running out of fuel 2018-07-06 15:56:01 +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
8ef87818ce feat(library/init/lean/parser/reader): implement basic tokenizer 2018-07-05 10:42:37 +02:00