[Issue 1351] Discrepancies in the language specification

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 9 05:13:54 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=1351


Ellery Newcomer <ellery-newcomer at utulsa.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


--- Comment #13 from Ellery Newcomer <ellery-newcomer at utulsa.edu> 2010-11-09 05:12:47 PST ---
I'm pretty sure PowExpression is still wrong.

with 

PowExpression:
                     UnaryExpression
                     UnaryExpression ^^ PowExpression

UnaryExpression:
                     etc

the code -2 ^^ 2 should have the precedence (-2) ^^ 2,
but this is not the case in dmd

assert( -2 ^^ 2 == -(2 ^^ 2)); //passes
assert( -2 ^^ 2 == (-2) ^^ 2); //fails

more evidence, parse.c, parseUnaryExp, line 5823 or thereabouts:

// ^^ is right associative and has higher precedence than the unary operators

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list