Commit 73416401 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

enhance assignment test correct bracketing in compound assignments

2007-02-25  Jürg Billeter  <j@bitron.ch>

	* tests/test-010.vala, tests/test-010.out: enhance assignment test
	* vala/valasemanticanalyzer.vala: correct bracketing in compound
	  assignments

svn path=/trunk/; revision=196
parent ad23dce5
2007-02-25 Jürg Billeter <j@bitron.ch>
* tests/test-010.vala, tests/test-010.out: enhance assignment test
* vala/valasemanticanalyzer.vala: correct bracketing in compound
assignments
2007-02-25 Jürg Billeter <j@bitron.ch>
* vala/valacodenode.vala: add to_string method
......
Assignment Test: 1 2 3 4 5 6 7 8 9 10 11 12 13
Assignment Test: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
......@@ -45,8 +45,12 @@ class Maman.Bar {
i >>= 1;
stdout.printf (" %d", i);
stdout.printf (" 13\n");
i = 12;
i -= 1 - 2;
stdout.printf (" %d", i);
stdout.printf (" 14\n");
return 0;
}
}
......@@ -1578,7 +1578,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
if (!(ma.symbol_reference.node is Signal)) {
var old_value = new MemberAccess (ma.inner, ma.member_name);
var bin = new BinaryExpression (BinaryOperator.PLUS, old_value, a.right);
var bin = new BinaryExpression (BinaryOperator.PLUS, old_value, new ParenthesizedExpression (a.right, a.right.source_reference));
if (a.operator == AssignmentOperator.BITWISE_OR) {
bin.operator = BinaryOperator.BITWISE_OR;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment