[Gambas-bugtracker] Bug #1541: Unary Negative should format tight to its symbol

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Thu Mar 14 02:23:09 CET 2019


http://gambaswiki.org/bugtracker/edit?object=BUG.1541&from=L21haW4-

Comment #3 by Cedron DAWG:

I know from experience it is a bugaboo.  I've never used a standard parser, always write my own.  I keep a "token type" which for the "-", I have to decide whether it is a "minus" or a "negative" based on the neighboring terms.  The current state is a bit strange:

        Dim i, j As Float
        
        i *= (- j)
        i *= - j
        i *= - 4.0
        i *= -4.0

The formatter allows either of the numeric cases, but changes the variable one.  It would seem that determining the role of the "-" would be the same in either case.  So, from your first comment, the only change in your fix will be the first case?




More information about the Bugtracker mailing list