Commit graph

60 commits

Author SHA1 Message Date
Leonardo de Moura
bf5afbc289 feat(library/init/lean/environment): use findOLean implemented in Lean
TODO: cleanup `path.lean`
2019-07-26 17:57:43 -07:00
Leonardo de Moura
e722ea9ed9 feat(library/init/lean): implement findOLean and findLean in Lean 2019-07-26 16:04:10 -07:00
Leonardo de Moura
ff88c35fc1 refactor(library/init): move io and platform to system subdir 2019-07-25 17:29:33 -07:00
Leonardo de Moura
3145994e36 feat(library/init/lean/elaborator/basic): register declaration name prefixes as namespaces at Environment.add 2019-07-24 13:24:02 -07:00
Leonardo de Moura
b1d5a4284d feat(library/init/lean): address issue raised in the previous commit
We also changed the type of `addImportedFn` to `Array (Array α) → IO σ`.
This modification avoids the `unsafeIO` hack at `parser.lean`.
2019-07-18 13:20:46 -07:00
Leonardo de Moura
267225eca6 feat(library/init/io): unsafeIO returns Except IO.Error a instead of Option a 2019-07-17 19:09:16 -07:00
Leonardo de Moura
0b590dbd4d chore(library/init/lean/environment): add note stating that addImportedFn must have support for failure
We need this feature when importing "conflicting" parser extensions.
Example: parsers in different modules that assign different binding
powers to different tokens.
2019-07-14 08:50:47 -07:00
Leonardo de Moura
18ab2be51c feat(library/init/lean/environment): use Thunk to store environment extension initial state 2019-07-13 13:58:20 -07:00
Leonardo de Moura
17cc34def5 feat(library/compiler/compiler): add option compiler.extract_closed
It is useful when using `unsafeIO`
2019-07-10 11:08:34 -07:00
Leonardo de Moura
ea6eee516b chore(frontends/lean): use => instead of := in match-expressions
Motivation: use same separator used in lambda expressions as in
other programming languages.
2019-07-04 11:38:38 -07:00
Leonardo de Moura
a02443d23d chore(frontends/lean): fun x, e ==> fun x => e 2019-07-02 13:22:11 -07:00
Leonardo de Moura
91e1d30cf8 feat(frontends/lean/builtin_exprs): use ; in do-notation 2019-06-27 18:00:43 -07:00
Leonardo de Moura
ab487ea4ac feat(frontends/lean): allow ; instead of in in let-decls 2019-06-27 17:12:03 -07:00
Leonardo de Moura
be6ca5ba30 feat(library/init/lean/compiler/externattr): @[extern] attribute in Lean 2019-06-26 08:42:57 -07:00
Leonardo de Moura
ac43b82668 chore(library/init): remove [derive] uses
Trying to minimize the number of features we need to support in the new
frontend, and attributes we need to port to the new attribute manager.
2019-06-20 10:53:15 -07:00
Leonardo de Moura
08cdb757b4 feat(library/init/lean/environment): add Environment.addAndCompile
To fix `BuiltinParserAttribute`, we need to be able to add auxiliary declarations programmatically.
2019-06-18 18:20:17 -07:00
Leonardo de Moura
44cba2fb3d chore(library/init/lean/attributes): add Inhabited instance and improve stats 2019-06-06 10:39:40 -07:00
Leonardo de Moura
fd9c8a4c82 feat(library/init/lean/attributes): add pushScope/popScope, missing APIs, and @[export] 2019-06-05 13:17:25 -07:00
Leonardo de Moura
2cb50f31bd chore(library/init/lean/environment): error message consistency 2019-06-05 09:16:10 -07:00
Leonardo de Moura
c480f1f95c refactor(library/init/lean/environment): move scope management to attributes.lean 2019-06-04 16:50:29 -07:00
Leonardo de Moura
89ab07a4b0 refactor(library/init/lean/environment): more flexible PersistentEnvExtensionState
The previous API was not flexible enough to implement the new
`AttributeManager` with all "bells and whistles" we want.
For example, the new `addImportedFn` field allows us to initialize
the state for the imported entries using a `Thunk`.
2019-06-04 16:35:21 -07:00
Leonardo de Moura
3bb8826bb4 feat(library/init/lean/environment): scope management skeleton 2019-06-04 15:20:07 -07:00
Leonardo de Moura
ca12439e25 feat(library/init/lean/environment): add persistent := true parameter to addEntry 2019-06-03 17:03:46 -07:00
Leonardo de Moura
0a08569b46 feat(library/init/lean/environment): remove lazy, add addImported field to PersistentEnvExtension
It seems `lazy := false` is only going to be used in the attribute
manager. So, I remove it. I added a new field `addImported : Bool`
instead. An extension can specify whether `addEntryFn` is going to be
invoked or not for imported entries. `addImported := false` is useful for extensions such
as `protected`, and I will use it in the attribute manager too.
2019-06-03 16:45:27 -07:00
Leonardo de Moura
90dc3356dc chore(library/init/lean/environment): remove unnecessary local instance 2019-06-03 16:24:36 -07:00
Leonardo de Moura
4a26f0028c chore(library/init/lean/environment): remove unnecessary function 2019-06-03 15:17:40 -07:00
Leonardo de Moura
cd73105dff refactor(kernel/environment,library/private,library/init/lean/environment): move main module name to header 2019-06-03 09:14:23 -07:00
Leonardo de Moura
483f1efc4d refactor(library/init/lean/environment): move fields that are rarely used to a separate structure, add setMainModuleName 2019-06-03 08:23:00 -07:00
Leonardo de Moura
6d39b8478f chore(library/init/lean/environment): remove dead field 2019-06-03 08:08:04 -07:00
Leonardo de Moura
7212fbab6e perf(library/init/lean/environment): search hashmap first
Hypothesis: the vast majority of Environment queries try to access
imported constants instead of local ones.
2019-05-15 11:01:25 -07:00
Leonardo de Moura
70dce4b775 feat(library/init/lean/environment): show rbmap depth and hashmap bucket size 2019-05-15 11:01:25 -07:00
Leonardo de Moura
89e01368cd fix(library/init/lean/environment): throw error if environment already contains constant 2019-05-15 11:01:25 -07:00
Leonardo de Moura
3193e91aff feat(library/init/lean/environment): add Environment.displayStats and --stats command line argument 2019-05-15 11:01:25 -07:00
Leonardo de Moura
45eda6d81b perf(library/init/lean/modifiers): add only local entries to state
We can use `getModuleEntries` and `getModuleIdxFor` to test whether a
constant is protected or not.
2019-05-14 20:30:46 -07:00
Leonardo de Moura
5fa924ff4a feat(library/init/lean/environment): improve registerPersistentEnvExtension signature 2019-05-14 16:25:43 -07:00
Leonardo de Moura
da5b900cbd feat(library/init/lean): add protected extension 2019-05-14 16:04:24 -07:00
Leonardo de Moura
b888b6f3b6 feat(library/init/lean/environment): process imported entries 2019-05-14 15:32:07 -07:00
Leonardo de Moura
59235c1899 chore(library/init/lean/environment): ModuleId ==> ModuleIdx 2019-05-14 13:02:43 -07:00
Leonardo de Moura
5e2111f4a4 fix(library/init/lean/environment): process entries using the order they were inserted 2019-05-14 12:53:50 -07:00
Leonardo de Moura
a24a1562ea fix(library/init/lean/environment): import order 2019-05-14 12:41:19 -07:00
Leonardo de Moura
5df0b05cc7 chore(library/init/lean/environment): remove get_modifications_core 2019-05-14 11:26:04 -07:00
Leonardo de Moura
d5fd5d86ee fix(library/init/lean/environment): quotInit initialization 2019-05-14 10:31:06 -07:00
Leonardo de Moura
02e558d781 feat(library/init/lean/environment): export module I/O in Lean 2019-05-14 10:15:33 -07:00
Leonardo de Moura
642c4c59bd feat(library/init/lean/environment): support for serializing/performing legacy modification objects 2019-05-14 10:08:31 -07:00
Leonardo de Moura
dbb519d826 feat(library/init/lean/environment): importModules draft 2019-05-14 08:58:29 -07:00
Leonardo de Moura
427852d759 feat(library/init/lean/environment): add findOLean 2019-05-14 08:02:26 -07:00
Leonardo de Moura
5844913102 feat(library/module, library/init/lean/environment): add primitives for reading/writing files as compacted regions 2019-05-13 17:26:28 -07:00
Leonardo de Moura
40f9704540 chore(library/init/lean/environment): add placeholders for writing/reading .olean files 2019-05-13 15:48:23 -07:00
Leonardo de Moura
5480d22be6 feat(library/init/lean/environment): add getModifications 2019-05-13 15:18:03 -07:00
Leonardo de Moura
ec846f1552 chore(library/init/lean/environment): rename primitive 2019-05-13 15:15:29 -07:00