summaryrefslogtreecommitdiff
path: root/doc/colm/code/nested_scope.lm
diff options
context:
space:
mode:
Diffstat (limited to 'doc/colm/code/nested_scope.lm')
-rw-r--r--doc/colm/code/nested_scope.lm23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/colm/code/nested_scope.lm b/doc/colm/code/nested_scope.lm
new file mode 100644
index 00000000..e84c216a
--- /dev/null
+++ b/doc/colm/code/nested_scope.lm
@@ -0,0 +1,23 @@
+str a( where:str ) {
+ print( "before block1 ", where, "\n" )
+ while(true) {
+ where = "block1"
+ print( "in block1 ", where, "\n" )
+ i:int = 0
+ while( true ) {
+ where = where + "a"
+ print( "in loop ", where, "\n" )
+ break
+ }
+ print( "in block1 ", where, "\n" )
+ break
+ }
+ print( "in A ", where, "\n" )
+ return where
+}
+
+where: str = "global"
+print( "in global ", where, "\n" )
+a( where )
+print( "in global ", where, "\n" )
+