summaryrefslogtreecommitdiff
path: root/tests/micropython/viper.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-08-15 23:47:59 +0100
committerDamien George <damien.p.george@gmail.com>2014-08-15 23:47:59 +0100
commite6c0dff9671c493e9a13a22a1b8902dee88da064 (patch)
tree5f703c1264160f9c752f8ecb0e0683ddf7e0e622 /tests/micropython/viper.py
parenta5190a7dac7a73e676d6d649035f846ea92d2d2d (diff)
py: Viper can now store to global.
Diffstat (limited to 'tests/micropython/viper.py')
-rw-r--r--tests/micropython/viper.py8
1 files changed, 8 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)