Merge pull request #1722 from amarjeetkapoor1/parameterASTmaster
Added the test cases for customizer
This commit is contained in:
commit
81ba00f185
13 changed files with 704 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ void addparameter(const char *fulltext, class FileModule *root_module){
|
|||
}
|
||||
|
||||
//extracting the description
|
||||
name = getParameter(std::string(fulltext),loc-1);
|
||||
name = getDescription(std::string(fulltext),loc-1);
|
||||
if(name!= ""){
|
||||
|
||||
//creating node for description
|
||||
|
|
@ -76,6 +76,7 @@ string getParameter(string fulltext, int loc){
|
|||
string comment = fulltext.substr(start,end-start);
|
||||
|
||||
int startText=0;
|
||||
int noOfSemicolon=0;
|
||||
bool check=true;
|
||||
for(;startText<comment.length()-1;startText++){
|
||||
|
||||
|
|
@ -85,6 +86,14 @@ string getParameter(string fulltext, int loc){
|
|||
if( comment[startText]== '/' && comment[startText+1]=='/' && check){
|
||||
break;
|
||||
}
|
||||
if(comment[startText]== ';' && check && noOfSemicolon>0){
|
||||
|
||||
return "";
|
||||
}
|
||||
if(comment[startText]== ';' && check){
|
||||
|
||||
noOfSemicolon++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -96,3 +105,50 @@ string getParameter(string fulltext, int loc){
|
|||
|
||||
}
|
||||
|
||||
string getDescription(string fulltext, int loc){
|
||||
int start = 0;
|
||||
if( loc<1){
|
||||
return "";
|
||||
}
|
||||
for(; start<fulltext.length() ; start++){
|
||||
|
||||
if(fulltext[start]=='\n')
|
||||
loc--;
|
||||
|
||||
if(loc<=1)
|
||||
break;
|
||||
}
|
||||
start++;
|
||||
|
||||
//not a valid description
|
||||
if(fulltext[start] != '/' || fulltext[start+1] != '/'){
|
||||
return "";
|
||||
}
|
||||
|
||||
//jump over the two forward slashes
|
||||
start=start+2;
|
||||
|
||||
//jump over all the spaces
|
||||
while(fulltext[start]==' ' || fulltext[start]=='\t'){
|
||||
start++;
|
||||
}
|
||||
string retString = "";
|
||||
//go till the end of the world, I mean the end of the line
|
||||
while(fulltext[start]!='\n'){
|
||||
|
||||
//replace // with space
|
||||
if(fulltext[start] == '/' && fulltext[start+1] == '/'){
|
||||
|
||||
retString += " ";
|
||||
start++;
|
||||
}else{
|
||||
|
||||
retString += fulltext[start];
|
||||
}
|
||||
|
||||
start++;
|
||||
}
|
||||
return retString;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ using std::string;
|
|||
extern AssignmentList * parser(const char *text);
|
||||
|
||||
string getParameter(string fulltext, int loc);
|
||||
string getDescription(string fulltext, int loc);
|
||||
void addparameter(const char *fulltext, class FileModule *root_module);
|
||||
|
||||
#endif // COMMENT_H
|
||||
|
|
|
|||
73
testdata/scad/customizer/allexpressionscomment.scad
vendored
Normal file
73
testdata/scad/customizer/allexpressionscomment.scad
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
a = true;//parameter
|
||||
//description
|
||||
b = false;//parameter
|
||||
//description
|
||||
c = undef;//parameter
|
||||
//description
|
||||
d = a;//parameter
|
||||
//description
|
||||
e = $fn;//parameter
|
||||
//description
|
||||
f1 = [1,,];//parameter
|
||||
//description
|
||||
f2 = [1,2,3];//parameter
|
||||
//description
|
||||
g = f2.x + f2.y + f2.z;//parameter
|
||||
//description
|
||||
h1 = [2:5];//parameter
|
||||
//description
|
||||
h2 = [1:2:10];//parameter
|
||||
//description
|
||||
i = h2.begin - h2.step - h2.end;//parameter
|
||||
//description
|
||||
j = "test";//parameter
|
||||
//description
|
||||
k = 1.23e-2;//parameter
|
||||
//description
|
||||
l = a * b;//parameter
|
||||
//description
|
||||
m = a / b;//parameter
|
||||
//description
|
||||
n = a % b;//parameter
|
||||
//description
|
||||
o = c < d;//parameter
|
||||
//description
|
||||
p = c <= d;//parameter
|
||||
//description
|
||||
q = c == d;//parameter
|
||||
//description
|
||||
r = c != d;//parameter
|
||||
//description
|
||||
s = c >= d;//parameter
|
||||
//description
|
||||
t = c > d;//parameter
|
||||
//description
|
||||
u = e && g;//parameter
|
||||
//description
|
||||
v = e || g;//parameter
|
||||
//description
|
||||
w = +i;//parameter
|
||||
//description
|
||||
x = -i;//parameter
|
||||
//description
|
||||
y = !i;//parameter
|
||||
//description
|
||||
z = (j);//parameter
|
||||
//description
|
||||
aa = k ? l : m;//parameter
|
||||
//description
|
||||
bb = n[o];//parameter
|
||||
//description
|
||||
cc = let(a=1) a;//parameter
|
||||
//description
|
||||
dd = [for (a=[0,1]) let(b=a) if (true) b];//parameter
|
||||
//description
|
||||
ee = ["abc", for (a=[0,1]) let(b=a) if (true) b, true, for(c=[1:3]) c, 3];//parameter
|
||||
//description
|
||||
ff = [for (a=[0,1]) if (a == 0) "A" else ( "B" )];//parameter
|
||||
//description
|
||||
gg = [each [ "a", 0, false ]];//parameter
|
||||
//description
|
||||
hh = [for (a = [0 : 3]) if (a < 2) ( if (a < 1) ["+", a] ) else ["-", a] ];//parameter
|
||||
//description
|
||||
ii = [for (a=0,b=1;a < 5;a=a+1,b=b+2) [a,b*b] ];
|
||||
65
testdata/scad/customizer/allfunctionscomment.scad
vendored
Normal file
65
testdata/scad/customizer/allfunctionscomment.scad
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
a = abs();//parameter
|
||||
//description
|
||||
b = sign();//parameter
|
||||
//description
|
||||
c = rands();//parameter
|
||||
//description
|
||||
d = min();//parameter
|
||||
//description
|
||||
e = max();//parameter
|
||||
//description
|
||||
f = sin();//parameter
|
||||
//description
|
||||
g = cos();//parameter
|
||||
//description
|
||||
h = asin();//parameter
|
||||
//description
|
||||
i = acos();//parameter
|
||||
//description
|
||||
j = tan();//parameter
|
||||
//description
|
||||
k = atan();//parameter
|
||||
//description
|
||||
l = atan2();//parameter
|
||||
//description
|
||||
m = round();//parameter
|
||||
//description
|
||||
n = ceil();//parameter
|
||||
//description
|
||||
o = floor();//parameter
|
||||
//description
|
||||
p = pow();//parameter
|
||||
//description
|
||||
q = sqrt();//parameter
|
||||
//description
|
||||
r = exp();//parameter
|
||||
//description
|
||||
ra = len();//parameter
|
||||
//description
|
||||
s = log();//parameter
|
||||
//description
|
||||
t = ln();//parameter
|
||||
//description
|
||||
u = str();//parameter
|
||||
//description
|
||||
ua = chr();//parameter
|
||||
//description
|
||||
ub = concat();//parameter
|
||||
//description
|
||||
v = lookup();//parameter
|
||||
//description
|
||||
va = search();//parameter
|
||||
//description
|
||||
y = version();//parameter
|
||||
//description
|
||||
z = version_num();//parameter
|
||||
//description
|
||||
za = norm();//parameter
|
||||
//description
|
||||
zb = cross();//parameter
|
||||
//description
|
||||
zc = parent_module();//parameter
|
||||
//description
|
||||
w = dxf_dim();//parameter
|
||||
//description
|
||||
x = dxf_cross();
|
||||
81
testdata/scad/customizer/allmodulescomment.scad
vendored
Normal file
81
testdata/scad/customizer/allmodulescomment.scad
vendored
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
minkowski();//parameter
|
||||
//description
|
||||
glide();//parameter
|
||||
//description
|
||||
subdiv();//parameter
|
||||
//description
|
||||
hull();//parameter
|
||||
//description
|
||||
resize();//parameter
|
||||
//description
|
||||
child();//parameter
|
||||
//description
|
||||
echo();//parameter
|
||||
//description
|
||||
assign();//parameter
|
||||
//description
|
||||
for();//parameter
|
||||
//description
|
||||
intersection_for();//parameter
|
||||
//description
|
||||
if(false) { cube(); } else { sphere(); }//parameter
|
||||
//description
|
||||
union();//parameter
|
||||
//description
|
||||
difference();//parameter
|
||||
//description
|
||||
intersection();//parameter
|
||||
//description
|
||||
dxf_linear_extrude();//parameter
|
||||
//description
|
||||
linear_extrude();//parameter
|
||||
//description
|
||||
dxf_rotate_extrude();//parameter
|
||||
//description
|
||||
rotate_extrude();//parameter
|
||||
//description
|
||||
import();//parameter
|
||||
//description
|
||||
import_stl();//parameter
|
||||
//description
|
||||
import_off();//parameter
|
||||
//description
|
||||
import_dxf();//parameter
|
||||
//description
|
||||
group();//parameter
|
||||
//description
|
||||
cube();//parameter
|
||||
//description
|
||||
sphere();//parameter
|
||||
//description
|
||||
cylinder();//parameter
|
||||
//description
|
||||
polyhedron();//parameter
|
||||
//description
|
||||
square();//parameter
|
||||
//description
|
||||
circle();//parameter
|
||||
//description
|
||||
polygon();//parameter
|
||||
//description
|
||||
projection();//parameter
|
||||
//description
|
||||
render();//parameter
|
||||
//description
|
||||
surface();//parameter
|
||||
//description
|
||||
scale();//parameter
|
||||
//description
|
||||
rotate();//parameter
|
||||
//description
|
||||
mirror();//parameter
|
||||
//description
|
||||
translate();//parameter
|
||||
//description
|
||||
multmatrix();//parameter
|
||||
//description
|
||||
color();//parameter
|
||||
//description
|
||||
offset();//parameter
|
||||
//description
|
||||
text();
|
||||
48
testdata/scad/customizer/description.scad
vendored
Normal file
48
testdata/scad/customizer/description.scad
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
//alone Description at Top
|
||||
|
||||
//normal description
|
||||
x=50;
|
||||
|
||||
// normal starting width spaces description
|
||||
x2=45;
|
||||
|
||||
// normal starting tab spaces description
|
||||
x3=3;
|
||||
|
||||
|
||||
// normal comment starting with space before //
|
||||
x4=3;
|
||||
|
||||
// normal comment starting with tab before //
|
||||
x5=3;
|
||||
|
||||
// double description
|
||||
x5=3;
|
||||
|
||||
//
|
||||
x6=12;
|
||||
|
||||
x7=12;
|
||||
// comment
|
||||
|
||||
x8=12;
|
||||
// description sandwiched between two assignments
|
||||
x9=23;
|
||||
|
||||
x8=12;
|
||||
// comment sandwiched between two assignments
|
||||
x9=23;
|
||||
|
||||
x10=23;
|
||||
|
||||
x11=23;
|
||||
x12=23;
|
||||
|
||||
// normal comment starting with tab before //
|
||||
x13=3;
|
||||
|
||||
// double description
|
||||
x13=7;
|
||||
|
||||
// double description // normal comment starting with tab before //
|
||||
x14=3;
|
||||
51
testdata/scad/customizer/parameter.scad
vendored
Normal file
51
testdata/scad/customizer/parameter.scad
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
x=1;
|
||||
|
||||
x1=1; //12
|
||||
|
||||
x2=1; //12
|
||||
|
||||
x3=1; // 12
|
||||
|
||||
x4=1; // 12
|
||||
|
||||
x5=1; //[1:12]
|
||||
|
||||
x6=1; //[1:2:12]
|
||||
|
||||
x7=1; //[1:12
|
||||
|
||||
x8=1; //[1 12]
|
||||
|
||||
x9=1; //[1:12] //[12:34]
|
||||
|
||||
x10=1; //
|
||||
|
||||
x11=1; //
|
||||
|
||||
x12=1; //[12]
|
||||
|
||||
x13=10; // [10:Small, 20:Medium, 30:Large]
|
||||
|
||||
x14=10; //[10:100, 20:101, 30:102]
|
||||
|
||||
x15=10; //parameter
|
||||
|
||||
x16=10; //[0, 1, 2, 3]
|
||||
x17="text"; // parameter
|
||||
|
||||
x18="text"; //[foo, bar, baz]
|
||||
|
||||
x19="text"; //[0:text, 1:foo, 2:bar, 3:hello]
|
||||
|
||||
x20="text"; //[foo:10, bar:10, baz:30]
|
||||
|
||||
x21="text"; //[foo:yes, bar:no, baz:mgiht]
|
||||
|
||||
x22=[12,34]; //[23,4]
|
||||
|
||||
x23=[12,34]; //[23,4,23,4,45]
|
||||
|
||||
x24=[12,34,2,3,41,23]; //[23,4,2,3,4,6]
|
||||
|
||||
x25=12; x26="text"; //[1:34]
|
||||
x27=12; //end parameter
|
||||
|
|
@ -1525,7 +1525,14 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake ${TMP})
|
|||
add_cmdline_test(moduledumptest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX ast FILES
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allfunctions.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allexpressions.scad)
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allexpressions.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/customizer/description.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/customizer/parameter.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/customizer/allmodulescomment.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/customizer/allfunctionscomment.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/customizer/allexpressionscomment.scad
|
||||
|
||||
)
|
||||
add_cmdline_test(csgtexttest SUFFIX txt FILES
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allexpressions.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allfunctions.scad
|
||||
|
|
|
|||
|
|
@ -0,0 +1,110 @@
|
|||
@Parameter("parameter")
|
||||
a = true;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
b = false;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
c = undef;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
d = a;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
e = $fn;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
f1 = [1];
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
f2 = [1, 2, 3];
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
g = ((f2.x + f2.y) + f2.z);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
h1 = [2 : 5];
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
h2 = [1 : 2 : 10];
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
i = ((h2.begin - h2.step) - h2.end);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
j = "test";
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
k = 0.0123;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
l = (a * b);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
m = (a / b);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
n = (a % b);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
o = (c < d);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
p = (c <= d);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
q = (c == d);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
r = (c != d);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
s = (c >= d);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
t = (c > d);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
u = (e && g);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
v = (e || g);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
w = i;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
x = -i;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
y = !i;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
z = j;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
aa = (k ? l : m);
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
bb = n[o];
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
cc = let(a = 1) a;
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
dd = [for(a = [0, 1]) (let(b = a) (if(true) (b)))];
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
ee = ["abc", for(a = [0, 1]) (let(b = a) (if(true) (b))), true, for(c = [1 : 3]) (c), 3];
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
ff = [for(a = [0, 1]) (if((a == 0)) ("A") else ("B"))];
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
gg = [each (["a", 0, false])];
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
hh = [for(a = [0 : 3]) (if((a < 2)) (if((a < 1)) (["+", a])) else (["-", a]))];
|
||||
@Description("description")
|
||||
ii = [for(a = 0, b = 1;(a < 5);a = (a + 1), b = (b + 2)) [a, (b * b)]];
|
||||
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
@Parameter("parameter")
|
||||
a = abs();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
b = sign();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
c = rands();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
d = min();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
e = max();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
f = sin();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
g = cos();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
h = asin();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
i = acos();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
j = tan();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
k = atan();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
l = atan2();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
m = round();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
n = ceil();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
o = floor();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
p = pow();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
q = sqrt();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
r = exp();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
ra = len();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
s = log();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
t = ln();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
u = str();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
ua = chr();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
ub = concat();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
v = lookup();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
va = search();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
y = version();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
z = version_num();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
za = norm();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
zb = cross();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
zc = parent_module();
|
||||
@Description("description")
|
||||
@Parameter("parameter")
|
||||
w = dxf_dim();
|
||||
@Description("description")
|
||||
x = dxf_cross();
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
minkowski();
|
||||
glide();
|
||||
subdiv();
|
||||
hull();
|
||||
resize();
|
||||
child();
|
||||
echo();
|
||||
assign();
|
||||
for();
|
||||
intersection_for();
|
||||
if(false) cube();
|
||||
else sphere();
|
||||
union();
|
||||
difference();
|
||||
intersection();
|
||||
dxf_linear_extrude();
|
||||
linear_extrude();
|
||||
dxf_rotate_extrude();
|
||||
rotate_extrude();
|
||||
import();
|
||||
import_stl();
|
||||
import_off();
|
||||
import_dxf();
|
||||
group();
|
||||
cube();
|
||||
sphere();
|
||||
cylinder();
|
||||
polyhedron();
|
||||
square();
|
||||
circle();
|
||||
polygon();
|
||||
projection();
|
||||
render();
|
||||
surface();
|
||||
scale();
|
||||
rotate();
|
||||
mirror();
|
||||
translate();
|
||||
multmatrix();
|
||||
color();
|
||||
offset();
|
||||
text();
|
||||
|
||||
20
tests/regression/moduledumptest/description-expected.ast
Normal file
20
tests/regression/moduledumptest/description-expected.ast
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
@Description("normal description")
|
||||
x = 50;
|
||||
@Description("normal starting width spaces description")
|
||||
x2 = 45;
|
||||
@Description("normal starting tab spaces description")
|
||||
x3 = 3;
|
||||
x4 = 3;
|
||||
x5 = 3;
|
||||
x6 = 12;
|
||||
x7 = 12;
|
||||
x8 = 12;
|
||||
@Description("description sandwiched between two assignments")
|
||||
x9 = 23;
|
||||
x10 = 23;
|
||||
x11 = 23;
|
||||
x12 = 23;
|
||||
x13 = 7;
|
||||
@Description("double description normal comment starting with tab before ")
|
||||
x14 = 3;
|
||||
|
||||
49
tests/regression/moduledumptest/parameter-expected.ast
Normal file
49
tests/regression/moduledumptest/parameter-expected.ast
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
x = 1;
|
||||
@Parameter(12)
|
||||
x1 = 1;
|
||||
@Parameter(12)
|
||||
x2 = 1;
|
||||
@Parameter(12)
|
||||
x3 = 1;
|
||||
@Parameter(12)
|
||||
x4 = 1;
|
||||
@Parameter([1 : 12])
|
||||
x5 = 1;
|
||||
@Parameter([1 : 2 : 12])
|
||||
x6 = 1;
|
||||
x7 = 1;
|
||||
x8 = 1;
|
||||
x9 = 1;
|
||||
x10 = 1;
|
||||
x11 = 1;
|
||||
@Parameter([12])
|
||||
x12 = 1;
|
||||
@Parameter([[10, "Small"], [20, "Medium"], [30, "Large"]])
|
||||
x13 = 10;
|
||||
@Parameter([[10, 100], [20, 101], [30, 102]])
|
||||
x14 = 10;
|
||||
@Parameter("parameter")
|
||||
x15 = 10;
|
||||
@Parameter([0, 1, 2, 3])
|
||||
x16 = 10;
|
||||
@Parameter("parameter")
|
||||
x17 = "text";
|
||||
@Parameter(["foo", "bar", "baz"])
|
||||
x18 = "text";
|
||||
@Parameter([[0, "text"], [1, "foo"], [2, "bar"], [3, "hello"]])
|
||||
x19 = "text";
|
||||
@Parameter([["foo", 10], ["bar", 10], ["baz", 30]])
|
||||
x20 = "text";
|
||||
@Parameter([["foo", "yes"], ["bar", "no"], ["baz", "mgiht"]])
|
||||
x21 = "text";
|
||||
@Parameter([23, 4])
|
||||
x22 = [12, 34];
|
||||
@Parameter([23, 4, 23, 4, 45])
|
||||
x23 = [12, 34];
|
||||
@Parameter([23, 4, 2, 3, 4, 6])
|
||||
x24 = [12, 34, 2, 3, 41, 23];
|
||||
x25 = 12;
|
||||
x26 = "text";
|
||||
@Parameter("end parameter")
|
||||
x27 = 12;
|
||||
|
||||
Loading…
Reference in a new issue