File: expression-precedence-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 (25 lines) | stat: -rw-r--r-- 1,061 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
function f(x) = echo("-") x;
echo(assoc_right_unary = (4 - --3));
echo(assoc_left_addsub = ((2 - 3) + 4));
echo(assoc_left_subadd = ((2 + 3) - 4));
echo(assoc_left_muldiv = ((2 * 3) / 4));
echo(assoc_left_ltgt = ((3 < 4) > 5));
echo(assoc_left_eqne = ((true == true) != false));
echo(assoc_left_and = ((true && true) && false));
echo(assoc_left_or = ((true || true) || false));
echo(prec_andor = ((true && true) || (true && false)));
echo(prec_orand = ((false || (false && false)) || true));
echo(prec_gtadd = ((3 + 2) > 4));
echo(prec_addgt = (5 > (2 + 4)));
echo(prec_addmul = (2 + (3 * 4)));
echo(prec_muladd = ((2 * 3) + 4));
echo(prec_submul = (2 - (3 * 4)));
echo(prec_mulsub = ((2 * 3) - 4));
echo(prec_addmod = (2 + (3 % 4)));
echo(prec_modadd = ((2 % 3) + 4));
echo(prec_unarysub = ((2 / -2) / 2));
echo(prec_unaryadd = ((2 / 2) / 2));
echo(sc_or = ((f(false) || f(true)) || f(true)));
echo(sc_and = ((f(true) && f(false)) && f(false)));
echo(sc_ternary_false = (f(false) ? f("yes") : f("no")));
echo(sc_ternary_true = (f(true) ? f("yes") : f("no")));