Implement namespaces

This includes a massive refactoring of the type checker, getting
rid of most of the ets tables and keeping a proper environment.
This commit is contained in:
Ulf Norell
2019-01-21 14:20:57 +01:00
parent 026ff52528
commit 367f87b612
14 changed files with 863 additions and 457 deletions
+2 -1
View File
@@ -36,7 +36,8 @@ decl() ->
?LAZY_P(
choice(
%% Contract declaration
[ ?RULE(keyword(contract), con(), tok('='), maybe_block(decl()), {contract, _1, _2, _4})
[ ?RULE(keyword(contract), con(), tok('='), maybe_block(decl()), {contract, _1, _2, _4})
, ?RULE(keyword(namespace), con(), tok('='), maybe_block(decl()), {namespace, _1, _2, _4})
%% Type declarations TODO: format annotation for "type bla" vs "type bla()"
, ?RULE(keyword(type), id(), {type_decl, _1, _2, []})