diff options
author | Adrian Thurston <thurston@colm.net> | 2019-09-11 18:53:11 -0600 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2019-09-11 18:53:11 -0600 |
commit | 26315e09ed7c87589a4304b98e5814d373596097 (patch) | |
tree | fb8280c77f882f29cffc6951ed612609af5b3feb /doc/colm/code/nested_scope.lm | |
parent | 3ea27e431335497820ae0181d720f66820e636a7 (diff) | |
download | colm-26315e09ed7c87589a4304b98e5814d373596097.tar.gz |
lifed colm doc up to doc/colm
Diffstat (limited to 'doc/colm/code/nested_scope.lm')
-rw-r--r-- | doc/colm/code/nested_scope.lm | 23 |
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" ) + |