Commit graph

68 commits

Author SHA1 Message Date
Sebastian Ullrich
c77970a00f refactor(library): remove now-redundant parentheses 2019-05-03 13:57:21 +02:00
Leonardo de Moura
dc6c1e329f refactor(library/init/data/rbmap): use Bool instead of Prop 2019-04-03 02:54:34 -07:00
Leonardo de Moura
5e14a5f561 refactor(library/init/lean/parser/trie): use String.Pos instead of OldIterator
Renamed the old `matchPrefix` to `oldMatchPrefix`.
2019-03-29 18:17:27 -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
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
3befc219c9 chore(library/init): Empty => empty when it is a function 2019-03-21 17:03:15 -07:00
Leonardo de Moura
dfe15cf743 refactor(library/init): use get and set for State EState and Ref
TODO: use the same naming convention for array reads and writes.
2019-03-21 16:34:32 -07:00
Sebastian Ullrich
97e5aa2411 chore(library): s/Punit/PUnit/g etc 2019-03-21 15:06:45 -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
Leonardo de Moura
ecdb9d6df0 feat(library/init, frontends/lean): add abbreviation for abbreviation 2019-03-15 16:01:25 -07:00
Sebastian Ullrich
d0929c93cd perf(library/init/lean/frontend): make file_map construction explicit, do it only once 2019-03-08 17:17:27 +01:00
Sebastian Ullrich
e0bbc094ad chore(library/init): remove coroutines from stdlib 2019-03-08 15:34:17 +01:00
Sebastian Ullrich
69e363446d fix(library/init/lean/{parser/term,elaborator}): local notations override previous notations 2019-01-20 16:25:15 +01:00
Sebastian Ullrich
fce5c5bd36 perf(library/init/lean/position): add file_map cache for position conversion 2018-12-20 15:32:46 +01:00
Sebastian Ullrich
0911d16bc3 feat(library/init/lean): compute and show error positions 2018-12-20 14:28:18 +01:00
Sebastian Ullrich
e7a6746b6a refactor(library/init/lean): share error function between expander and elaborator 2018-12-06 17:03:01 +01:00
Sebastian Ullrich
eaeb0a40a5 chore(library/init/lean/parser): do not expose the parser cache as monad_state 2018-11-08 16:01:19 +01: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
090c4c0ce7 feat(library/init/lean/syntax): add lazily propagated macro scopes to syntax_node 2018-11-06 16:46:50 +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
2e0d6649be perf(library/init/lean/parser/basic): make basic_parser_m semireducible 2018-10-30 17:43:05 +01:00
Sebastian Ullrich
163f996d00 perf(library/init/lean/parser): inline some trivial functions 2018-10-22 22:23:54 +02:00
Leonardo de Moura
89afabae29 refactor(library/init/lean/parser/parsec): make sure custom error message doesn't need to be inhabited 2018-10-21 10:57:23 -07:00
Leonardo de Moura
880137f0ed feat(library/init/lean/parser/basic): mark tokens with @[nospecialize] 2018-10-18 15:20:54 -07:00
Leonardo de Moura
88de81077c feat(library/compiler/specialize): do not specialize instances unless they are marked with [specialize]
@kha: I changed the specialization candidate selection procedure.
Now, instances are not considered for specializations unless we mark
them with `[specialize]`. The idea is that an instance application is
morally just creating the "dictionary" for invoking a polymorphic
function.
2018-10-15 18:29:29 -07:00
Leonardo de Moura
4cfe44bed0 feat(library/compiler/specialize): add nospecialize attribute
@kha I had to add this attribute because the specializer was generated
many specialization candidates for functions that take `[has_tokens ...]`
as an argument. Moreover, these candidates had a lot of
dependencies. I am trying to workaround this issue by marking the
instances with the new attribute `[nospecialize]`.
I did not mark instances created by `[derive]`. It is quite tedious to
do it.

BTW, when I was investigating the problem I stumbled at `node.view`.
Its type is:
```
node.view :
  Π {α : Type} {m : Type → Type} [_inst_1 : monad m] [_inst_2 : monad_except (parsec.message syntax) m]
  [_inst_3 : monad_parsec syntax m] [_inst_4 : alternative m] (k : syntax_node_kind) (rs : list (m syntax))
  [i : @has_view syntax_node_kind k α], @has_view (m syntax) (@node m _inst_1 _inst_2 _inst_3 _inst_4 k rs) α
```
This looks wrong: the view depends on `[monad_parsec syntax m]`

We should also make sure definitions do not have unnecessary type
class instances. Otherwise, we will put additional stress on the code
specializer. One option is to change the frontend and filter unused
instances.
2018-10-15 17:44:26 -07: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
Leonardo de Moura
15a25d5aa9 chore(library/init/lean/parser): add a few comments 2018-10-11 15:54:57 -07:00
Sebastian Ullrich
ebeec844af perf(library/init/lean/parser): minor performance tweaks 2018-10-05 08:52:04 -07:00
Sebastian Ullrich
ca8e75be9e fix(library/init/lean/elaborator): check for and consume end of input 2018-10-03 16:00:08 -07:00
Sebastian Ullrich
203545ce99 chore(library/init/lean/parser/trie): add debug print
Also make sure it's in the prelude, whoops
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
26c0f36848 doc(library/init/lean/parser/basic): expand comment 2018-09-27 10:16:40 -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
1d01e81de8 refactor(library/init/lean/parser): do not construct final syntax tree independent from intermediate outputs
This makes sure we have a single consistent view of the file
2018-09-25 18:28:53 -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
d7d968cead feat(library/init/lean/parser/basic): merge explicit and default (0) token precedences 2018-09-20 09:40:21 -07:00
Sebastian Ullrich
6f68a0d1eb feat(library/init/lean/parser/basic): check for conflicting tokens 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