Fixed weakness in parser causing modifier characters not to work in front of 'if' statements. Fixes #197
37
src/parser.y
|
@ -233,6 +233,22 @@ ifelse_statement:
|
|||
} ;
|
||||
|
||||
module_instantiation:
|
||||
'!' module_instantiation {
|
||||
$$ = $2;
|
||||
if ($$) $$->tag_root = true;
|
||||
} |
|
||||
'#' module_instantiation {
|
||||
$$ = $2;
|
||||
if ($$) $$->tag_highlight = true;
|
||||
} |
|
||||
'%' module_instantiation {
|
||||
$$ = $2;
|
||||
if ($$) $$->tag_background = true;
|
||||
} |
|
||||
'*' module_instantiation {
|
||||
delete $2;
|
||||
$$ = NULL;
|
||||
} |
|
||||
single_module_instantiation ';' {
|
||||
$$ = $1;
|
||||
} |
|
||||
|
@ -271,26 +287,7 @@ single_module_instantiation:
|
|||
$$->argexpr = $3->argexpr;
|
||||
free($1);
|
||||
delete $3;
|
||||
} |
|
||||
'!' single_module_instantiation {
|
||||
$$ = $2;
|
||||
if ($$)
|
||||
$$->tag_root = true;
|
||||
} |
|
||||
'#' single_module_instantiation {
|
||||
$$ = $2;
|
||||
if ($$)
|
||||
$$->tag_highlight = true;
|
||||
} |
|
||||
'%' single_module_instantiation {
|
||||
$$ = $2;
|
||||
if ($$)
|
||||
$$->tag_background = true;
|
||||
} |
|
||||
'*' single_module_instantiation {
|
||||
delete $2;
|
||||
$$ = NULL;
|
||||
};
|
||||
}
|
||||
|
||||
expr:
|
||||
TOK_TRUE {
|
||||
|
|
|
@ -2,3 +2,4 @@ difference() {
|
|||
sphere(r=10);
|
||||
%cylinder(h=30, r=6, center=true);
|
||||
}
|
||||
%if (true) cube([25,6,3], center=true);
|
||||
|
|
|
@ -2,3 +2,4 @@ difference() {
|
|||
*sphere(r=10);
|
||||
cylinder(h=30, r=6, center=true);
|
||||
}
|
||||
*if (true) cube([25,6,3], center=true);
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
difference() {
|
||||
sphere(r=10);
|
||||
%#cylinder(h=30, r=6, center=true);
|
||||
%#if (true) cube([6,25,3], center=true);
|
||||
}
|
||||
translate([13,0,0]) difference() {
|
||||
sphere(r=10);
|
||||
#%cylinder(h=30, r=6, center=true);
|
||||
#%if (true) cube([6,25,3], center=true);
|
||||
}
|
||||
|
|
|
@ -2,3 +2,4 @@ difference() {
|
|||
sphere(r=10);
|
||||
#cylinder(h=30, r=6, center=true);
|
||||
}
|
||||
#if (true) cube([25,6,3], center=true);
|
||||
|
|
|
@ -19,10 +19,10 @@ translate([25,0,0]) hull() {
|
|||
// Don't Crash (issue 188)
|
||||
|
||||
translate([-5,-5,-5]) {
|
||||
hull() {
|
||||
intersection(){
|
||||
cube([1,1,1]);
|
||||
translate([-1,-1,-1]) cube([1,1,1]);
|
||||
}
|
||||
hull() {
|
||||
intersection() {
|
||||
cube([1,1,1]);
|
||||
translate([-1,-1,-1]) cube([1,1,1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 6.9 KiB |
|
@ -2,4 +2,7 @@
|
|||
sphere($fn = 0, $fa = 12, $fs = 2, r = 10);
|
||||
%cylinder($fn = 0, $fa = 12, $fs = 2, h = 30, r1 = 6, r2 = 6, center = true);
|
||||
}
|
||||
%group() {
|
||||
cube(size = [25, 6, 3], center = true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
difference() {
|
||||
sphere($fn = 0, $fa = 12, $fs = 2, r = 10);
|
||||
%cylinder($fn = 0, $fa = 12, $fs = 2, h = 30, r1 = 6, r2 = 6, center = true);
|
||||
%group() {
|
||||
cube(size = [6, 25, 3], center = true);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 13], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
sphere($fn = 0, $fa = 12, $fs = 2, r = 10);
|
||||
%cylinder($fn = 0, $fa = 12, $fs = 2, h = 30, r1 = 6, r2 = 6, center = true);
|
||||
%group() {
|
||||
cube(size = [6, 25, 3], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,4 +2,7 @@
|
|||
sphere($fn = 0, $fa = 12, $fs = 2, r = 10);
|
||||
cylinder($fn = 0, $fa = 12, $fs = 2, h = 30, r1 = 6, r2 = 6, center = true);
|
||||
}
|
||||
group() {
|
||||
cube(size = [25, 6, 3], center = true);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,4 +17,14 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, -5], [0, 1, 0, -5], [0, 0, 1, -5], [0, 0, 0, 1]]) {
|
||||
hull() {
|
||||
intersection() {
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
multmatrix([[1, 0, 0, -1], [0, 1, 0, -1], [0, 0, 1, -1], [0, 0, 0, 1]]) {
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
group() {
|
||||
sphere($fn = 0, $fa = 12, $fs = 2, r = 5);
|
||||
}
|
||||
group() {
|
||||
cube(size = [5, 5, 5], center = false);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 7.2 KiB |