improving pooldic handling - auto-import a nested pooldic in a class

This commit is contained in:
hyunghwan.chung
2019-10-01 09:19:25 +00:00
parent e145c4742e
commit 6931d14432
4 changed files with 83 additions and 43 deletions

View File

@ -94,6 +94,42 @@ class Shader(Object) from 'shader'
}
```
### Pool dictionary
pooldic MyData
{
A := 20,
B := 30,
C := 40
}
class MyClass
{
import MyData.
method x ()
{
MyData.A dump.
C dump. // if imported, it doesn't require prefixing with MyData.
}
}
class MyClass2
{
pooldic Const
{
A := 20.
B := 30.
}
method x()
{
A dump. // the nested pooldic is auto-imported.
Const.A dump.
self.Const dump.
}
}
### Flow Control
```
k := if (i < 20) { 30 } else { 40 }.