Add include directive

Add an include directive to include namespaces into a contract. Only allowed at the top level.

To allow includes, either call through aeso_compiler:file or set the option `allow_include` (and add `include_path`(s)).
This commit is contained in:
Hans Svensson
2019-02-05 08:52:40 +01:00
committed by Ulf Norell
parent 0a5b80668f
commit 2b7490776e
9 changed files with 139 additions and 40 deletions
+10
View File
@@ -0,0 +1,10 @@
include "included.aes"
include "../contracts/included2.aes"
contract Include =
// include "maps.aes"
function foo() =
Included.foo() < Included2a.bar()
function bar() =
Included2b.foo() > Included.foo()
+2
View File
@@ -0,0 +1,2 @@
namespace Included =
function foo() = 42
+5
View File
@@ -0,0 +1,5 @@
namespace Included2a =
function bar() = 43
namespace Included2b =
function foo() = 44