esempio interpreter in pyhton

This commit is contained in:
2026-05-13 10:47:18 +02:00
parent fe4bb40a3a
commit e44561b2c0
3 changed files with 526 additions and 6 deletions
@@ -0,0 +1,40 @@
# example.snip — demonstrates the Snippet language
snippet init
set x = 5
set y = 10
print x
print y
snippet adjust_x
# If x is small, bump it up; otherwise pull it back down
if x < 8
increase x
increase x
increase x
if x > 6
increase x
else
decrease x
else
decrease x
print x
snippet adjust_y
if y > 8
decrease y
if y > 5
decrease y
decrease y
else
increase y
else
increase y
print y
snippet final
# Both snippets share variables — x and y from above are visible here
if x > 7
print x
else
print y