File: echo-expression-tests-expected.ast

package info (click to toggle)
openscad 2021.01-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 36,096 kB
  • sloc: cpp: 53,199; sh: 4,384; ansic: 4,382; python: 1,813; yacc: 853; javascript: 762; lex: 417; lisp: 163; xml: 127; makefile: 118
file content (32 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function f1(x) = [for(a = x) (echo(a = a) a)];
function f2(x, i = 0) = echo(i) ((len(x) > i) ? (x[i] + f2(x, (i + 1))) : 0);
function f3(x, i = 0) = ((len(x) > i) ? let(a = (x[i] + f3(x, (i + 1)))) echo(a) a : 0);
//Parameter("")
a = 3;
//Parameter("")
b = 6;
//Parameter("")
c = 8;
//Parameter("")
v = [2, 5, 7];
t0 = echo();
t1 = echo() undef;
t2 = echo("t2");
t3 = echo((a * b));
t4 = echo(c = (a * b));
t5 = echo() (a * b);
t6 = echo(c = 2) ((a * b) * c);
t7 = echo() [a, b];
t8 = echo() [for(i = [1 : a]) ([i, b])];
echo(t0 = t0);
echo(t1 = t1);
echo(t2 = t2);
echo(t3 = t3);
echo(t4 = t4);
echo(t5 = t5);
echo(t6 = t6);
echo(t7 = t7);
echo(t8 = t8);
echo("f1(v) = ", f1(v));
echo("f2(v) = ", f2(v));
echo("f3(v) = ", f3(v));