Closed GoogleCodeExporter closed 9 years ago
Ok the problem seems to be the opening parenthesis. I guess prepending all
expressions with 0+ in that case would work.
Original comment by ilja.j.h...@nasa.gov
on 2 Dec 2014 at 4:12
Here is the result of my investigation:
1.) abs(y) < 0.25 ? (-1) : (1) + 1
I wouldn't expect 0 or two in the first expression. The behavior is consistent
with the behavior of C/C++ source code in the same situation. You need a way to
terminate the ?: Operator this is either the end of an expression or a closing
bracket.
2.) (abs(y) < 0.25 ? -1 : 1)
This would be a bug but I can't reproduce the issue. I checked gcc, llvm and
Visual Studio.
I added both cases to the unit test and it is running fine. If i remember
correctly there are some issues in the LLVM version shipped with OSX. My best
guess so far is that this may be the cause of the issue.
Original comment by ib...@gmx.info
on 10 Dec 2014 at 8:38
[deleted comment]
Does your test also work with vector expressions? Starting an expression with (
seems to work for me with scalar variables but not with vector ones.
Original comment by ilja.j.h...@nasa.gov
on 10 Dec 2014 at 9:39
Seems to work for vectors. I'd be suprised if it didn't because this error is
thrown in the parsing stage. At that stage the type is still unknown.
My test sample was "((size(va)[0]==3 ? 1:2)" can you try to give me a simple
expression showing the behavior?
Original comment by ib...@gmx.info
on 10 Dec 2014 at 10:29
I meant an expression that produces a vector, e.g. this works: {1, 0, 0} but
this fails: {(1), 0, 0}. Only the first component seems to be affected.
Original comment by ilja.j.h...@nasa.gov
on 10 Dec 2014 at 10:43
Thanks for the clarification. I fixed this issue in the SVN repository (V3.0.5).
Original comment by ib...@gmx.info
on 14 Dec 2014 at 5:57
Thanks!
Original comment by ilja.j.h...@nasa.gov
on 14 Dec 2014 at 6:33
Original issue reported on code.google.com by
ilja.j.h...@nasa.gov
on 2 Dec 2014 at 4:02