Commit graph

11426 commits

Author SHA1 Message Date
Leonardo de Moura
da09ef4f66 feat(frontends/lean/builtin_exprs): minor improvement 2019-06-24 15:48:11 -07:00
Leonardo de Moura
24e3bff429 feat(frontends/lean): add simple parser! macro 2019-06-24 15:48:11 -07:00
Leonardo de Moura
6a740723a4 chore(frontends/lean): remove node! and nodeChoice! macros
They were used in the parsing framework based on `Parsec`
2019-06-24 15:48:11 -07:00
Leonardo de Moura
e4344b0c94 chore(library/init/lean/parser/default): update default 2019-06-21 14:20:40 -07:00
Leonardo de Moura
bc9e460f62 fix(library/init/lean/compiler/ir): collectUsedDecls must take initialization functions into account
Move builtin parser level to its own directory
2019-06-21 13:34:42 -07:00
Leonardo de Moura
4ab31275a4 chore(library/init, frontends/lean): remove foldl and foldr notation, and implement list notation in the old parser 2019-06-20 14:32:08 -07:00
Leonardo de Moura
807ec2169a chore(frontends/lean/notation_cmd): remove scoped notation support 2019-06-20 14:13:56 -07:00
Leonardo de Moura
00aa2a3ffe chore(library/user_recursors): remove [recursor] attribute and environment extension 2019-06-20 11:25:53 -07:00
Leonardo de Moura
1e30f76511 chore(frontends/lean/pp): remove ppAsAnonymousCtor attribute 2019-06-20 11:03:20 -07:00
Leonardo de Moura
64a592899f chore(frontends/lean/notation_cmd): remove parsingOnly attribute 2019-06-20 11:00:40 -07:00
Leonardo de Moura
6b5408b69c chore(library/derive_attribute): remove derive_attribute
We will reimplement it in Lean after we have the new frontend working.
2019-06-20 10:55:53 -07:00
Leonardo de Moura
8ad653ae2d chore(stage0): update 2019-06-20 09:55:55 -07:00
Leonardo de Moura
db325cb924 fix(stag0): missing file 2019-06-20 09:23:41 -07:00
Leonardo de Moura
e0ddacfd3e feat(library/init/lean/attributes,frontends/lean): allow attributes to specify when they should be applied 2019-06-20 09:17:03 -07:00
Leonardo de Moura
e86e6af049 feat(library/init/lean/attributes): add applicationTime field and remove unnecessary parameters 2019-06-20 08:48:26 -07:00
Leonardo de Moura
b502f178c2 chore(library/compiler/reduce_arity): fix typo 2019-06-19 09:53:00 -07:00
Leonardo de Moura
697f69020f fix(library/init/lean/parser/parser): new registerBuiltinParserAttribute
It is still broken since we apply attributes before we compile code.

Recall that attributes such as `@[export]` and `@[extern]` must be applied before we
compile code.

On the other hand, any attribute `attrName`
```
@[attrName] def foo := ...
```
which creates auxiliary definitions that depend on `foo` must be applied
AFTER we generate code for `foo`. Otherwise, we will fail to compile the
auxiliary definition since we don't have code for `foo` yet.

I will fix the issue above by allowing attributes to specify when they
should be applied. I will start with only two options: before and after
code compilation. In the future, we may need more options (e.g., before
elaboration), but I don't see the need yet.

cc @kha
2019-06-19 09:52:56 -07:00
Leonardo de Moura
766467d095 fix(stage0): missing files 2019-06-18 18:35:18 -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
66e3f68dbc chore(library/compiler/procedure): remove dead code 2019-06-18 17:29:19 -07:00
Leonardo de Moura
0dfca42f6d chore(library/init/lean/compiler/initattr): remove unnecessary @[export] 2019-06-18 16:15:48 -07:00
Leonardo de Moura
9da080d398 feat(library/compiler/init_attribute): switch to @[init] attribute in Lean 2019-06-18 16:03:52 -07:00
Leonardo de Moura
2b453de299 fix(frontends/lean/decl_attributes): remove mdata 2019-06-18 15:25:34 -07:00
Leonardo de Moura
50f8d232c3 feat(frontends/lean/decl_attributes): add expr_to_syntax 2019-06-18 15:17:46 -07:00
Leonardo de Moura
36aa33091b chore(stage0): update 2019-06-07 17:16:36 -07:00
Leonardo de Moura
f176a7963c feat(library/init/lean/compiler/ir/emitcpp): register arity 0 declarations 2019-06-07 17:15:16 -07:00
Leonardo de Moura
3651dc7618 feat(library/init/lean): add evalConst
The implementation is good enough for implementing extensible parsers,
elaborators and tactics, but there are a few TODOs

1- We should have a better story for standalone applications.
   Most of them don't need `evalConst`, and the global table is
   just initialization overhead.

2- The global table introduces a dependency on the `Lean.Name`
   implementation. So, all standalone applications will depend on it.

3- We are not storing arity 0 constants in the table.
   This one should be easy to fix in the future.
2019-06-07 16:31:28 -07:00
Leonardo de Moura
c3a7cc4617 feat(library/init/lean/compiler/ir/emitcpp): register functions 2019-06-07 15:34:55 -07:00
Leonardo de Moura
b2ae4c51af chore(shell/lean): cleanup 2019-06-07 14:52:16 -07:00
Leonardo de Moura
9ac18251f8 chore(src/sexpr): remove sexpr 2019-06-07 11:00:00 -07:00
Leonardo de Moura
d664486eca chore(util): move format to src/util 2019-06-07 10:58:23 -07:00
Leonardo de Moura
12809945ba chore(util/sexpr/format): use Lean implementation 2019-06-07 10:45:42 -07:00
Leonardo de Moura
373011bc20 chore(library/init/lean/format): export group 2019-06-07 10:35:04 -07:00
Leonardo de Moura
5eaca0d89e chore(util/sexpr/format): preparing to switch to Lean implementation 2019-06-07 10:18:23 -07:00
Leonardo de Moura
452485a706 chore(library/init/lean/format): export functions 2019-06-07 10:10:13 -07:00
Leonardo de Moura
3afa4f7ab0 chore(util/safe_arith): remove dead code 2019-06-07 09:52:31 -07:00
Leonardo de Moura
f6b9a0fe9c chore(util/sexpr/format): preparing to switch to Lean implementation 2019-06-07 09:46:34 -07:00
Leonardo de Moura
7beb74fb0f chore(util/sexpr/format): remove dead code 2019-06-07 09:28:30 -07:00
Leonardo de Moura
0553d60dbf feat(library/compiler/util): switch to new attributes implemented in Lean 2019-06-06 15:40:39 -07:00
Leonardo de Moura
b292fc13cc chore(library/init/lean/compiler/inline): export typo 2019-06-06 15:28:20 -07:00
Leonardo de Moura
e4063f5eec chore(stage0): update 2019-06-06 15:20:13 -07:00
Leonardo de Moura
8f9b73399b feat(library/compiler/eager_lambda_lifting): implement using Lean version 2019-06-06 15:09:57 -07:00
Leonardo de Moura
57e250a768 chore(stage0): remove leftover 2019-06-06 15:09:41 -07:00
Leonardo de Moura
9b457cc77c feat(library/init/lean/compiler/inline): implement tester functions and export them 2019-06-06 15:07:08 -07:00
Leonardo de Moura
72290483e4 chore(library/init/lean/compiler): attributes.lean ==> inline.lean 2019-06-06 14:08:13 -07:00
Leonardo de Moura
e05cdc2b08 feat(library/init/lean/compiler): declare function inlining attributes in Lean
Remark: they are not active yet since we haven't removed the ones
defined in C++ yet.
2019-06-06 11:05:54 -07:00
Leonardo de Moura
2a557b1bbd feat(frontends/lean/decl_attributes): connect old frontend to new attribute manager 2019-06-06 10:43:09 -07:00
Leonardo de Moura
fc4abbd6c3 chore(shell/lean): compilation warning 2019-06-06 10:42:39 -07:00
Leonardo de Moura
c8a972c57b fix(library/init/lean/attributes): typos at @[export] 2019-06-06 10:41:17 -07:00
Leonardo de Moura
fb77d71d23 feat(library/init/lean/attributes): export attribute API 2019-06-05 16:55:47 -07:00