boo-lang / boo

The Boo Programming Language.
BSD 3-Clause "New" or "Revised" License
874 stars 148 forks source link

Detect indentation inconsistency when spaces and tabs are mixed #67

Closed drslump closed 11 years ago

drslump commented 11 years ago

Fixes the issue https://github.com/bamboo/boo/issues/19

Includes a check in the indent based lexer to detect problems with the indentation used in the source code. I wasn't sure if it could be better solved by separating the WS terminal into spaces and tabs, but I guess that the performance hit would be pretty similar.

A related issue is that Boo doesn't enforce to use the same amount of indentation everywhere, which makes the following valid code:

class Foo:
  a as int
  def foo():
   if a:
        print a

I guess that the compiler is right about that, it should be the job of a linting tool (or custom step) to warn the programmer about those inconsistencies.