diff options
| author | Damien George | 2014-08-15 23:47:59 +0100 |
|---|---|---|
| committer | Damien George | 2014-08-15 23:47:59 +0100 |
| commit | e6c0dff9671c493e9a13a22a1b8902dee88da064 (patch) | |
| tree | 5f703c1264160f9c752f8ecb0e0683ddf7e0e622 /tests/micropython | |
| parent | a5190a7dac7a73e676d6d649035f846ea92d2d2d (diff) | |
py: Viper can now store to global.
Diffstat (limited to 'tests/micropython')
| -rw-r--r-- | tests/micropython/viper.py | 8 | ||||
| -rw-r--r-- | tests/micropython/viper.py.exp | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/micropython/viper.py b/tests/micropython/viper.py index 2ed70ade6..36849abaf 100644 --- a/tests/micropython/viper.py +++ b/tests/micropython/viper.py @@ -29,6 +29,13 @@ def viper_sum(a:int, b:int) -> int: total += x return total +# accessing a global +@micropython.viper +def access_global(): + global gl + gl = 1 + return gl + # this doesn't work at the moment #@micropython.viper #def g() -> uint: @@ -39,3 +46,4 @@ print(g(1, 2)) print(h(3)) print(i(4, 5)) print(viper_sum(10, 10000)) +print(access_global(), gl) diff --git a/tests/micropython/viper.py.exp b/tests/micropython/viper.py.exp index 6ee698f66..4c308316b 100644 --- a/tests/micropython/viper.py.exp +++ b/tests/micropython/viper.py.exp @@ -3,3 +3,4 @@ 7 20 49994955 +1 1 |
