Sebastian Ullrich
cec1ee2564
feat(library/init/lean/parser/parsec): reintroduce parsec_t
2018-08-29 16:42:24 -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
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
287fdce45b
refactor(library/init/lean/parser/reader): remove reader.has_view default instance
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
Sebastian Ullrich
1b8e74123c
feat(frontends/lean/{builtin_exprs,elaborator}): special-case try inside of node!
2018-08-22 14:32:03 -07:00
Sebastian Ullrich
26d696a937
feat(frontends/lean,library/init/lean/parser/reader/module): basic node! macro
2018-08-22 14:32:03 -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
f52395140a
feat(library/init/lean/parser/parsec): add dbg helper combinator
2018-08-02 13:32:42 -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
eda9e4bb3f
feat(library/derive_attribute): temporary, hacky C++ implementation of @[derive]
2018-08-01 18:44:23 -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
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
3728b2ba3f
feat(library/init/lean/parser/reader/basic): add error list handling
2018-07-30 10:38:00 -07:00
Sebastian Ullrich
e34f2e8cd7
chore(library/init/lean/parser): improve error messages
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
0b240cbfe9
feat(library/init/lean/parser/reader/basic): read_m: change custom message type to syntax
2018-07-27 15:27:37 -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
d526262266
refactor(library/init/lean/parser/reader/basic): rec_t.recurse: clearer implementation
2018-07-26 17:28:11 -07:00
Sebastian Ullrich
18b4456a84
Revert "refactor(library/init/lean/parser/parsec): monad_parsec: move from monad_lift/monad_map to direct primitives"
...
This reverts commit 9db0724bf1 .
2018-07-25 13:53:29 -07: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
5b55600e71
feat(library/init/lean/parser/reader/module): open command
2018-07-16 12:38:27 +02:00
Sebastian Ullrich
5955e3fce8
chore(library/init/lean/parser/parsec): proper namespacing
2018-07-12 10:35:22 +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
ab19966d65
feat(library/init/lean/parser/reader): automatically promote tokens through readers
2018-07-05 18:01:17 +02:00
Sebastian Ullrich
8ef87818ce
feat(library/init/lean/parser/reader): implement basic tokenizer
2018-07-05 10:42:37 +02:00