From 1c899d86c393faf021298d08471f0dd48d5306d7 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 25 Nov 2009 20:14:01 -0500 Subject: Fix binary vector arithmetic expressions. --- dimension/grammar.y | 2 +- tests/dimension/arithexp.pov | 3 ++- tests/dimension/arithexp.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dimension/grammar.y b/dimension/grammar.y index 27685b7..5f82028 100644 --- a/dimension/grammar.y +++ b/dimension/grammar.y @@ -1309,7 +1309,7 @@ dmnsn_eval_vector_binary(dmnsn_astnode astnode) dmnsn_astnode lhs, rhs; dmnsn_array_get(astnode.children, 0, &lhs); - dmnsn_array_get(astnode.children, 0, &rhs); + dmnsn_array_get(astnode.children, 1, &rhs); lhs = dmnsn_eval_vector(lhs); rhs = dmnsn_eval_vector(rhs); diff --git a/tests/dimension/arithexp.pov b/tests/dimension/arithexp.pov index 5d0e8fb..dd055a4 100644 --- a/tests/dimension/arithexp.pov +++ b/tests/dimension/arithexp.pov @@ -20,5 +20,6 @@ // Render demo scene sphere { - <<2.0 - 1.0, 3.0, 4.0>.x, (1.0 + 2)*2 - 5, 1.0 + 2*2 - 4> - -<0, 0, 1>, 2.25 - 1*2 + <<2.0 - 1.0, 3.0, 4.0>.x, (1.0 + 2)*2 - 5, 1.0 + 2*2 - 4> - -<0, 0, 1>, + 2.25 - 1*2 } diff --git a/tests/dimension/arithexp.sh b/tests/dimension/arithexp.sh index 24aebd8..4b2fbba 100755 --- a/tests/dimension/arithexp.sh +++ b/tests/dimension/arithexp.sh @@ -32,7 +32,7 @@ arithexp_exp="$(echo -n \ | tr '\n' ' ' | sed -r 's/[[:space:]]+/ /g') $(echo -n \ '((sphere - (vector (float 0) (float 0) (float 0) (integer 0) (integer 0)) + (vector (float 1) (float 1) (float 2) (integer 0) (integer 0)) (float 0.25) object-modifiers))' \ | tr '\n' ' ' | sed -r 's/[[:space:]]+/ /g')" -- cgit v1.2.3