Whitespace parsing bug
Posted: Thu Feb 21, 2008 4:52 am
0.7.3
If you have a cobra program that uses (or starts with, its not clear) tabs for indentation and insert a line indented to the
correct offset with spaces instead of tabs
you get a non helpful compilation error at the start of the inserted line(s)
e.g
WinForms.cobra(36): error: WinForms.cobra(36,1): error: Expecting an expression.
for an example take WinForms.cobra (its all tab indented) and drop some trace statements into it
(in main, handleclick or init )
using space indentation rather than tabs.
Note that the lines aren't mixing tabs and spaces within the same line
but they are within the program, some lines using Tabs, some using spaces
(not desirable but easy enough to do with multiple program maintainers using different editors or editor settings)
If the compilation error is intended (it shouldnt be - its too easy to do accidentally)
there should be a much better error diagnostic
If you have a cobra program that uses (or starts with, its not clear) tabs for indentation and insert a line indented to the
correct offset with spaces instead of tabs
you get a non helpful compilation error at the start of the inserted line(s)
e.g
WinForms.cobra(36): error: WinForms.cobra(36,1): error: Expecting an expression.
for an example take WinForms.cobra (its all tab indented) and drop some trace statements into it
(in main, handleclick or init )
using space indentation rather than tabs.
Note that the lines aren't mixing tabs and spaces within the same line
but they are within the program, some lines using Tabs, some using spaces
(not desirable but easy enough to do with multiple program maintainers using different editors or editor settings)
If the compilation error is intended (it shouldnt be - its too easy to do accidentally)
there should be a much better error diagnostic