Commit graph

53 commits

Author SHA1 Message Date
Leonardo de Moura
611635281b chore(library/init/lean/parser/command): simple open command syntax 2019-07-17 19:09:15 -07:00
Leonardo de Moura
69ab85de14 feat(library/init/lean/parser/command): add #exit command 2019-07-16 14:15:27 -07:00
Leonardo de Moura
8a11c8509e fix(library/init/lean/parser/command): open <id>+ 2019-07-16 13:09:45 -07:00
Leonardo de Moura
ee5ffb8ee2 fix(library/init/lean/parser/command): add partial modifier 2019-07-15 16:35:14 -07:00
Leonardo de Moura
262e83bbc8 fix(library/init/lean/parser/command): add class inductive 2019-07-15 15:24:26 -07:00
Leonardo de Moura
65edaa12a3 fix(library/init/lean/parser/command): missing trys 2019-07-15 14:18:21 -07:00
Leonardo de Moura
d588d39786 fix(library/init/lean/parser): use symbolOrIdent when parsing max and imax 2019-07-14 08:22:07 -07:00
Leonardo de Moura
1dce4a8f70 feat(library/init/lean/parser/parser): add symbolOrIdent 2019-07-14 08:09:04 -07:00
Leonardo de Moura
52157cebf7 feat(library/init/lean/parser): add ParserAttribute skeleton 2019-07-14 07:16:14 -07:00
Leonardo de Moura
d59d8e0d56 feat(library/init/lean/parser/command): add notation command 2019-07-12 14:18:08 -07:00
Leonardo de Moura
36da73b6cb feat(library/init/lean/parser/command): add (some) notation commands 2019-07-12 14:01:23 -07:00
Leonardo de Moura
166a6fa75a feat(library/init/lean/parser/command): missing commands 2019-07-12 11:00:14 -07:00
Leonardo de Moura
7046a38e93 feat(library/init/lean/parser/command): add inductive, structure and class parsers 2019-07-12 10:21:59 -07:00
Leonardo de Moura
8751f68041 feat(library/init/lean/parser/command): more decl commands 2019-07-11 17:42:11 -07:00
Leonardo de Moura
49d5c83a18 feat(library/init/lean/parser/command): add abbrev 2019-07-11 17:30:29 -07:00
Leonardo de Moura
eed4c72fc5 fix(library/init/lean/parser/command): docComment 2019-07-11 17:28:51 -07:00
Leonardo de Moura
72477f3cc6 feat(library/init/lean/parser/command): improve how optional affects firstTokens field 2019-07-11 17:22:26 -07:00
Leonardo de Moura
d354dc437c feat(library/init/lean/parser/command): add declaration draft 2019-07-11 17:13:22 -07:00
Leonardo de Moura
05a3bab321 feat(library/init/lean/parser): add command.lean 2019-07-11 16:43:44 -07:00
Leonardo de Moura
55626ba60d chore(library/init/lean): disable new frontend for now
We are going to start making drastic changes in the parser,
elaborator, attributes, etc. Examples:
- No View objects. I am going to implement match_syntax.
- No RecT in the parser. I am going to implement parser extensions
using an approach similar to the one I used to implement environment
extensions.
- No Parsec. I will use an approach similar to the one used in the
experiment https://github.com/leanprover/lean4/tree/master/tests/playground/parser

It is easier to perform these changes with the new frontend disabled.
I will slowly re-active it as I apply the changes.

cc @kha
2019-06-05 15:26:43 -07:00
Leonardo de Moura
02f90485e6 feat(library/init/lean): use Environment in the new frontend 2019-05-13 13:04:57 -07:00
Leonardo de Moura
e58949e938 chore(library/init/control/id): rename id monad to Id 2019-03-29 16:45:52 -07:00
Leonardo de Moura
04e20623e6 chore(*): use lowercase dir names 2019-03-21 15:06:44 -07:00
Leonardo de Moura
67fb78bb47 chore(*): renaming files 2019-03-21 15:06:44 -07:00
Sebastian Ullrich
beda5f5f43 chore(library): capitalize types and namespaces 2019-03-21 15:06:43 -07:00
Sebastian Ullrich
b939162168 chore(library): switch from snake_case to camelCase 2019-03-21 15:06:43 -07:00
Leonardo de Moura
ecdb9d6df0 feat(library/init, frontends/lean): add abbreviation for abbreviation 2019-03-15 16:01:25 -07:00
Leonardo de Moura
a78c773f37 feat(library/init/lean): unsafe support in the new frontend 2019-03-15 15:49:03 -07:00
Sebastian Ullrich
6f83faaee0 perf(library/init/lean/parser/command): index command parsers by first token 2019-03-07 11:28:42 +01:00
Sebastian Ullrich
c22fbb5cde feat(library/init/lean,frontends/lean/vm_elaborator): set_option 2019-01-20 18:21:41 +01:00
Sebastian Ullrich
8cc35b854b feat(library/init/lean/{expander,elaborator}): variable(s) 2019-01-17 17:06:52 +01:00
Sebastian Ullrich
d0062691de feat(library/init/lean): implement init_quot 2019-01-15 15:06:51 +01:00
Sebastian Ullrich
4f7be93e87 feat(library/init/lean): remove support for section aliases 2018-12-18 17:04:04 +01:00
Sebastian Ullrich
306da89551 feat(library/init/lean/expander): expand universe( variable)s to multiple universe( variable) commands 2018-12-07 10:31:14 +01:00
Leonardo de Moura
1cb22b6801 perf(library/init/lean/parser/command): move common command parsers to the beginning of the list
@kha This modification saved 150k object allocations on my machine.

BTW, the function
```
def command_parser.run (commands : list command_parser) (p : command_parser)
  : parser_t command_parser_config id syntax :=
λ cfg, (p.run cfg).run_parsec $ λ _, any_of $ commands.map (λ p, p.run cfg)
```
is also affected by the problem I described at Zulip. It is another
example where eager eta-expansion is bad. Every time we call it, we
will create approx. 20 closures and 20 cons memory cells. We have at
least 600 commands in core.lean. So, just the `map` nested there will
generate 24k memory allocations. Moreover, the problem will get worse as we add
more commands.
2018-11-08 14:45:34 -08:00
Sebastian Ullrich
959948b901 feat(library/init/lean): even more core.lean progress 2018-10-03 16:00:08 -07:00
Sebastian Ullrich
5274be8c3e feat(library/init/lean/elaborator): local notation
Implemented by treating the parser cfg as a cache that can be recreated from the
elaborator state after e.g. a scope has ended
2018-10-03 16:00:08 -07:00
Sebastian Ullrich
b8b39585ec fix(library/init/lean/parser/command): variable may take unbracketed binder 2018-10-02 14:55:28 -07:00
Sebastian Ullrich
945bf39e05 feat(library/init/lean): progress 2018-09-28 20:50:18 -07:00
Sebastian Ullrich
e661aaeacf refactor(library/init/lean/parser): store registered parsers in configs, use config hierarchy to avoid mutually recursive types
And other refactorings along the way
2018-09-27 10:05:10 -07:00
Sebastian Ullrich
76ea8169bc feat(library/init/lean/expander): prefix ~> notation macro: construct RHS, move to new module 2018-09-24 09:53:28 -07:00
Sebastian Ullrich
41c0bc87fd refactor(library/init/lean/parser): make views shallow via tysyntax 2018-09-22 21:24:38 -07:00
Sebastian Ullrich
fa0148e5b8 feat(library/init/lean/parser): declarations and binders 2018-09-17 18:47:50 -07:00
Sebastian Ullrich
a6f25e2ae7 refactor(library/init/lean/parser/token): id ~> ident, ident ~> ident.parser 2018-09-17 18:47:50 -07:00
Sebastian Ullrich
ea4d7af66d refactor(library/init/lean/parser/command): move out notations 2018-09-17 18:47:50 -07:00
Sebastian Ullrich
ae7df32428 refactor(library/init/lean/parser/syntax): setting source_info.leading is much easier after parsing 2018-09-14 16:33:04 -07:00
Sebastian Ullrich
8aa621efb2 refactor(library/init/lean/{syntax,macro}): remove syntax.ident, simply syntax.atom, remove expander prototype 2018-09-14 16:33:04 -07:00
Sebastian Ullrich
5e180cd170 feat(library/init/lean/parser/token): create structure-preserving syntax trees for identifiers
Also generalize `raw_symbol` to `raw`
2018-09-14 16:33:04 -07:00
Sebastian Ullrich
6c11f99aae fix(library/init/lean/parser): do not use raw_symbol on keywords
Otherwise `Type (maxx u v)` would be parsed as `Type (max x u v)`
2018-09-14 16:33:04 -07:00
Sebastian Ullrich
98e09c274f feat(library/init/lean/parser/{pratt,level}): factor out pratt combinator, implement level parsers 2018-09-13 16:38:40 -07:00