Ticket #341 (new enhancement)

Opened 6 years ago

Last modified 6 years ago

Require (some) binary operators to have spaces around them

Reported by: hopscc Owned by:
Priority: medium Milestone:
Component: Cobra Compiler Version: 0.9.4
Keywords: Cc:


In the interests of having canonical formatting in expressions, force some (subset) of the binary operators to only be accepted when have spaces around them

# wrt ASSIGN(=) 
#rather than accepting
# or

# Only allow
name =
#must have at least one space fore and aft around the =

Discussion  Require spaces around Binary ops

Subset should probably include

  • math operators ( +,-,*, /, **, %)
  • Assignment(=) and (perhaps equals (==) )
  • nil and nonnil coalesce (? and !)
  • Others?...

This is a reasonably major change so should probably be compiler suppressible.


spaceWrap.patch Download (2.4 KB) - added by hopscc 6 years ago.

Change History

Changed 6 years ago by hopscc

Changed 6 years ago by hopscc

require spaces on ASSIGN and EQ.
(Apply this patch in the cobra Source directory)

Extend as desired to test effect with other operators...

Changed 6 years ago by Charles

related to ticket:339 "Provide a nil safe dereference operator"

Note: See TracTickets for help on using tickets.