Commit graph

8 commits

Author SHA1 Message Date
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
0dfca42f6d chore(library/init/lean/compiler/initattr): remove unnecessary @[export] 2019-06-18 16:15:48 -07:00
Leonardo de Moura
6219a2277a fix(library/init/lean/compiler/initattr): getInitFnNameFor 2019-06-18 16:03:52 -07:00
Leonardo de Moura
696088cf2e feat(library/init/lean/compiler/initattr): @[init] attribute in Lean 2019-06-18 16:03:52 -07:00
Leonardo de Moura
a03c236380 feat(library/init/lean/compiler/initattr): new @[init] attribute validation 2019-06-18 15:40:16 -07:00
Leonardo de Moura
91821529c0 feat(library/init/lean/compiler/initattr): register new @[init] attributre using new attribute manager
This is just the basic skeleton for testing
2019-06-18 15:20:17 -07:00
Leonardo de Moura
5b3aec088e feat(library/init/lean/compiler/ir/emitcpp): emit module initialization code 2019-05-21 16:06:10 -07:00
Leonardo de Moura
4ed803c564 feat(library/init/lean/compiler/ir/emitcpp): emit skeletons 2019-05-20 19:08:21 -07:00