Wiki

Ticket #112 (new enhancement)

Opened 16 years ago

Last modified 12 years ago

Allow extra spaces for alignment inside line continuations only

Reported by: Chuck Owned by:
Priority: medium Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

This is a controlled violation of the "you cannot mix tabs and spaces" rule.

An example:

class X

	def fooBar(i as int,
			   j as int) as int is shared
		return i + j

	def main is shared
		assert .fooBar(2, 3) == 5

That example will make more sense when viewed in your editor. The "j as int) ..." line is indented with TABs like the rest of the source, but then 3 additional SPACEs are used to line up the j underneath the i.

  • 1 - 3 spaces
  • No more than 3
  • Not allowed outside of line continuations
  • Also, cook up the same example with spaces only, no tabs. (In that case there is no such detection as "1 - 3" spaces.)
  • Test cases for TABs followed by 4 or more spaces producing an error.

Change History

follow-up: ↓ 2   Changed 12 years ago by Charles

Applied in changeset:2783 which also fixes ticket:116

in reply to: ↑ 1   Changed 12 years ago by Charles

Replying to Charles:

Applied in changeset:2783 which also fixes ticket:116

Ignore the above comment. It was intended to be put on ticket:211.

  Changed 12 years ago by hopscc

See patch on ticket:210.

Note: See TracTickets for help on using tickets.