diff options
| author | Marius Kintel <marius@kintel.net> | 2013-08-21 05:40:21 (GMT) | 
|---|---|---|
| committer | Marius Kintel <marius@kintel.net> | 2013-08-21 05:40:21 (GMT) | 
| commit | a7396cc36fbd2269bc75b0632e659dd05149259b (patch) | |
| tree | 2dcf579cf06794a75b9bf6b90e270a1e6848e007 /testdata/scad/misc | |
| parent | fe7fb45019affbf683930d6368fe38524bdd2649 (diff) | |
Fixes two problems related to : lookup was dynamic rather than lexical, assignment was done after all local variables causing it not to be copyable
Diffstat (limited to 'testdata/scad/misc')
| -rw-r--r-- | testdata/scad/misc/variable-scope-tests.scad | 29 | 
1 files changed, 29 insertions, 0 deletions
diff --git a/testdata/scad/misc/variable-scope-tests.scad b/testdata/scad/misc/variable-scope-tests.scad index 104d1a4..2a65d0d 100644 --- a/testdata/scad/misc/variable-scope-tests.scad +++ b/testdata/scad/misc/variable-scope-tests.scad @@ -11,6 +11,35 @@ module special_module2(b) {  special_module(23, $fn=5); +echo("$children scope"); +module child_module_2() { +  echo("$children should be 4: ", $children); +  for(i=[0:$children-1]) child(i); +} + +module child_module_1() { +  echo("$children should be 1: ", $children); +  child_module_2() { +    echo("$children should be 1: ", $children); +    child(0); +    echo("child_module_2 child 0"); +    echo("child_module_2 child 1"); +  } +} + +child_module_1() echo("child_module_1 child"); + +echo("copy $children"); +module copy_children_module() { +  kids = $children; +  echo("copy_children_module: ", kids, $children); +} + +copy_children_module() { +  cube(); +  sphere(); +} +  echo("inner variables shadows parameter");  module inner_variables(a, b) {    b = 24;  | 
