Sebastian Ullrich
4a7c2fcafc
test(tests/lean/macro1): add examples from prototype
2018-05-17 17:45:02 +02:00
Leonardo de Moura
b7f194d389
feat(library/init/lean/ir): allow arbitrary C++ identifiers to be assigned to declarations
2018-05-13 11:04:42 -07:00
Leonardo de Moura
3be7540efe
chore(library/init): use mfor instead of mmap'
2018-05-09 15:41:53 -07:00
Leonardo de Moura
3f883bd949
chore(library/init/lean/parser/parser): add monad_fail instance
2018-05-09 09:19:14 -07:00
Leonardo de Moura
d5fe509c36
chore(*): remove end after each match-expression
...
`end` is not optional anymore
2018-05-04 11:30:06 -07:00
Leonardo de Moura
0d49ae3f69
feat(library/init/lean/parser): add not_followed_by and not_followed_by_sat
...
The new parsers are useful to implement the longest match rule.
2018-05-02 15:55:57 -07:00
Leonardo de Moura
f44bfb3e59
feat(library/init/lean/parser/parser): use dlist to implement expected messages
...
The idiom `p1 <|> p2 <|> ... <|> pn` generates many append operations.
`dlist` provides an O(1) append.
2018-05-02 12:43:21 -07:00
Leonardo de Moura
4d6cbf62a2
refactor(library/init/lean/parser/parser): we don't need to store the whole message in ok_eps
...
In the original parsec paper, they store messages in OK silent/epsilon
results too. This is not necessary, we only need the "expected" field
for the `ok_eps` constructor.
2018-05-02 11:37:57 -07:00
Leonardo de Moura
6672cc2a34
fix(library/init/lean/parser/parser): bug
2018-05-01 17:15:12 -07:00
Leonardo de Moura
619394f3da
feat(library/init/lean/parser/string): parser for string literals
2018-05-01 16:17:16 -07:00
Leonardo de Moura
ffdc6cca8a
refactor(library/init/lean/ir): move reserved set to different file
2018-05-01 15:27:25 -07:00
Leonardo de Moura
263391bdbb
refactor(library/init/lean): add init/lean/parser/identifier
2018-05-01 11:53:55 -07:00
Leonardo de Moura
7305a7a65e
feat(library/init/lean): identifier parser
2018-05-01 10:29:34 -07:00
Leonardo de Moura
ba8b85f4c0
chore(library/init/lean/parser/parser): adjust variable names
2018-04-30 16:36:09 -07:00
Leonardo de Moura
485b16a413
feat(library/init/lean/parser/syntax): use position
2018-04-30 16:13:01 -07:00
Leonardo de Moura
9879cb46be
feat(library/init/lean/parser/parser): store offset in error messages
2018-04-30 16:08:52 -07:00
Leonardo de Moura
1b5c3c117e
fix(library/init/lean/parser/syntax): leanchecker error: multiple definitions of lean.parser.position
2018-04-30 13:44:23 -07:00
Leonardo de Moura
3c317a30db
chore(library/init/lean/parser): remove sorry warnings and init/meta dependencies
2018-04-30 13:38:25 -07:00
Leonardo de Moura
4fa43f18dd
chore(library/init/data/rbtree,library/init/data/rbmap): remove auto_param dependency
...
The problem is that `auto_param` is defined in the old `init/meta/name` module,
and we don't want to have `init/meta` dependencies in the `init/lean` modules.
2018-04-30 13:24:13 -07:00
Leonardo de Moura
75a67ceb29
refactor(library/init): move option.lt
2018-04-30 11:19:38 -07:00
Leonardo de Moura
3a494348b6
chore(library/init/lean/parser/macro): remove well_founded_tactics dependency
2018-04-30 11:11:23 -07:00
Leonardo de Moura
12f2831f9f
test(tests/lean/parser1): add parser tests
2018-04-28 15:58:50 -07:00
Leonardo de Moura
c9e4c89d9c
chore(library/init/meta): remove mk_dec_eq_instance
...
The tactic mk_dec_eq_instance constructs a function using the brec_on
recursor. The compiler generates horrible code for this kind of
definition. It creates a closure for each recursive call.
Moreover, `brec_on` accumulates all intermediate results.
To generate efficient code, we need to generate a collection of
recursive equations, and then invoke the equation compiler.
cc @kha
2018-04-27 16:13:10 -07:00
Leonardo de Moura
65c7426174
chore(library/init/lean/parser/parser): parser_m ==> parser
...
Use the same name convention used at `init/control`
2018-04-27 13:44:37 -07:00
Leonardo de Moura
1f2f44dc9f
chore(library/init/lean/parser/macro): fix import
2018-04-27 13:42:18 -07:00
Leonardo de Moura
6f0296c757
feat(library/init/lean/parser/parser): add faster take* combinators
...
They are much faster than the more general `many*` combinators.
2018-04-27 13:39:19 -07:00
Leonardo de Moura
3f812698a9
feat(library/init/lean/parser/parser): fast str combinator
2018-04-27 13:39:19 -07:00
Leonardo de Moura
f950965614
fix(library/init/lean/parser/parser): bug
2018-04-27 13:39:19 -07:00
Sebastian Ullrich
1e53b03aa3
feat(init/parser): add prototype code for syntax trees, macro expansion, and name resolution
2018-04-27 17:57:03 +02:00
Leonardo de Moura
77d3a788e8
refactor(init): init/category ==> init.control
2018-04-27 08:33:08 -07:00
Leonardo de Moura
8b442101af
chore(library/init/lean/parser/parser): add prelude
2018-04-27 08:16:20 -07:00
Leonardo de Moura
c427fb4086
refactor(*): create library/init/lean folder
...
The new folder will contain the new parser, macro expander and compiler.
This commit also renames the namespace for the old parser `lean3.parser`
2018-04-27 08:02:40 -07:00