Commit graph

66 commits

Author SHA1 Message Date
Leonardo de Moura
60f8d17942 refactor(library/init/data/string/basic): simplify String.Iterator
The `offset` field is problematic because it prevents us from having an
efficient way of moving back and forth between `String.Pos` and `String.Iterator`.

@kha I temporarily added `String.OldIterator` for making sure the
parser doesn't break. This is a temporary fix that will be eliminated
after we replace `parsec`.
2019-03-25 07:57:12 -07:00
Leonardo de Moura
91204a52d6 chore(library/init/data/dlist): Dlist => DList 2019-03-21 17:03:22 -07:00
Leonardo de Moura
2be87ecd92 chore(library/init): Bool.tt => Bool.true and Bool.ff => Bool.false 2019-03-21 15:06:44 -07:00
Leonardo de Moura
f8113a01eb chore(library): unit => Unit 2019-03-21 15:06:44 -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
Sebastian Ullrich
c22fbb5cde feat(library/init/lean,frontends/lean/vm_elaborator): set_option 2019-01-20 18:21:41 +01:00
Sebastian Ullrich
13781ed114 feat(library/init/lean/parser/token): numeric literals of more exotic bases 2019-01-16 19:39:30 +01:00
Sebastian Ullrich
9e8dfbad79 perf(library/init/lean/parser): reintroduce separate syntax.ident constructor with much simpler and more efficient encoding 2018-11-18 16:55:04 +01:00
Sebastian Ullrich
68dad5e77c chore(library/init/lean/parser/token): raw: unnecessary try 2018-11-18 16:11:41 +01:00
Leonardo de Moura
182812a278 chore(library/init/lean/parser/token): make sure generate code does contain partially applied reader_t.or_else and reader_t.bind
@kha This one was crazy, the compiler created a join point for the
continuation of the match-expression. Each case of the match was
invoking the join point with a different parser. Two of the branches
were the partially applied `reader_t.bind` and `reader_t.orelse`.
This change did not improve the performance much, but it makes sure we
don't waste time trying to figure out why we have these two partial
applications in the call graph.
2018-11-08 17:39:46 -08:00
Leonardo de Moura
ad9aa3bc19 perf(library/init/lean/parser/token): optimize symbol
Same trick used at `str`.

@kha: I also replaced `"token " ++ sym'` with `sym'`. We were creating
thousands of strings of the form "token ...".
2018-11-08 14:05:09 -08:00
Leonardo de Moura
0dfeb8a79c perf(library/init/lean/parser/parsec): optimize str and raw_str
Both `str` amd `raw_str` are used with string literals. This commit
makes sure we don't need to recompute the nested term
`dlist.singleton (repr s)`. This modification saves .2 secs when
parsing `core.lean` on my MacBook.

cc @kha
2018-11-08 11:18:21 -08:00
Sebastian Ullrich
bd70dc1fc9 perf(library/init/lean/parser): move backtrackable state from parser_core_t to module_parser_m 2018-11-08 15:58:41 +01:00
Sebastian Ullrich
41f4a34d4b feat(library/init/lean/parser/token): cache hit statistics 2018-11-08 14:52:54 +01:00
Sebastian Ullrich
7fdfdb1784 chore(library/init/lean/parser): remove unnecessary class constraints 2018-11-06 21:45:08 +01:00
Sebastian Ullrich
090c4c0ce7 feat(library/init/lean/syntax): add lazily propagated macro scopes to syntax_node 2018-11-06 16:46:50 +01:00
Sebastian Ullrich
fc4dcd19cf refactor(library/init/lean/parser): use ident.view in syntax.to_format 2018-11-05 17:57:00 +01:00
Sebastian Ullrich
8c27f0aac6 refactor(frontends/lean/elaborator,library/init/lean): finish no_kind refactoring 2018-11-04 20:24:40 +01:00
Sebastian Ullrich
0d7ea62f9a perf(frontends/lean/elaborator,library/init/lean): put out_params first to benefit from instance pre-filtering 2018-10-30 17:43:05 +01:00
Sebastian Ullrich
08d8856112 perf(library/init/lean/parser/token): replace longest_match in token with custom implementation 2018-10-22 22:33:58 +02:00
Sebastian Ullrich
a820b9955f perf(library/init/lean/parser/term): index term parsers by leading token
66% speedup on core.lean
2018-10-15 10:21:08 +02:00
Sebastian Ullrich
2df885d9a3 fix(library/init/lean/parser/token): broken end of comment 2018-10-13 12:01:48 -07:00
Sebastian Ullrich
8a88d4d5e2 feat(library/init/lean/parser/token): string literals
hard-coded for now because we do not have general support for variable-length
tokens yet
2018-10-13 08:11:36 -07:00
Leonardo de Moura
15a25d5aa9 chore(library/init/lean/parser): add a few comments 2018-10-11 15:54:57 -07:00
Sebastian Ullrich
8e0778e54a fix(library/init/lean/parser/token): parse whitespace after raw_ident 2018-10-08 09:30:48 -07:00
Sebastian Ullrich
4e3f9b46c2 refactor(library/init/lean/parser/token): remove weird with_source higher-order function 2018-10-05 08:52:04 -07:00
Sebastian Ullrich
ebeec844af perf(library/init/lean/parser): minor performance tweaks 2018-10-05 08:52:04 -07:00
Sebastian Ullrich
959948b901 feat(library/init/lean): even more core.lean progress 2018-10-03 16:00:08 -07:00
Sebastian Ullrich
0563c60b1a feat(library/init/lean/elaborator): add coroutine, use it to implement section/namespace elaborators (they don't do anything yet except for checking the end name) 2018-10-02 14:55:28 -07:00
Sebastian Ullrich
097b7be14f refactor(library/init/lean/parser/token): change raw view type to option syntax_atom and create raw_str to give some raw parsers view defaults 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
5123148aa6 feat(library/init/data/string/basic): trim whitespace around symbols 2018-09-28 13:08:24 -07:00
Sebastian Ullrich
2e5ea16e2f perf(library/init/lean/parser): cache consecutive calls to token at the same position
Parser performance improved by about 33%
2018-09-27 16:08:19 -07:00
Sebastian Ullrich
e535cd92f7 perf(library/init/lean/parser/token): inline hot polymorphic functions
Decreases parser runtime by ~15%
2018-09-27 16:02:19 -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
2c07922327 refactor(library/init/lean/parser): minimize parser_state, have the module coroutine take and return parser_config 2018-09-26 13:20:07 -07:00
Sebastian Ullrich
bba8beca63 feat(library/init/lean/parser/token): give number a view 2018-09-25 14:18:52 -07:00
Sebastian Ullrich
15927f21c9 refactor(library/init/lean/parser/token): unicode_symbol parser 2018-09-25 09:16:02 -07:00
Sebastian Ullrich
32f4d52e1c refactor(library/init/lean): revert introduction of tysyntax; push syntax.missing through views 2018-09-24 18:24:27 -07:00
Sebastian Ullrich
9a0b1c7a7f feat(library/init/lean/parser/basic): allow views to specify default value used with opt_param when nested in other views 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
0a8d0a6870 feat(library/init/lean/parser/term): projection notation 2018-09-20 09:40:21 -07:00
Sebastian Ullrich
64a5d0f240 refactor(library/init/lean/parser): has_tokens default 2018-09-20 09:38:10 -07:00
Sebastian Ullrich
c7c459d47b Revert "perf(library/init/lean/parser): collect tokens in trie instead of list, do not inline"
This reverts commit e4c50b2b09.

Lists are efficient enough and make it easier to customize the trie construction.

Keep the `donotinline` though.
2018-09-20 09:38:10 -07:00
Sebastian Ullrich
e4c50b2b09 perf(library/init/lean/parser): collect tokens in trie instead of list, do not inline 2018-09-19 12:36:34 -07:00
Sebastian Ullrich
80e37aa8c5 chore(library/init/lean/parser): improve error messages 2018-09-19 12:36:34 -07:00
Sebastian Ullrich
1f239c9f2a feat(library/init/lean/parser/syntax): pretty-print ident nodes
Painfully, because `ident.view` is not defined yet
2018-09-17 18:47:50 -07:00