On 11. Jun 2007, at 15:33, Steve King wrote:
[...] Just out of curiosity, C is chock full of multi-line constructs. In fact, the language itself (ignoring the pre-processor) assigns no special meaning to the end-of-line. It's just another whitespace character. How are multiline language constructs handled elsewhere, and why do function prototypes cause a particular problem?
TextMate only has the current line as look-ahead, and that is not enough to say if what we’re looking at is starting a function or some other construct. If C functions were all prefixed with a ‘function’ keyword or if there weren’t a zillion other constructs, which given only the first line, could be mistaken for a function, there wouldn’t be a problem.
So the problem boils down to, given just the first line of a construct, can you say what the construct is? In C you sometimes can’t, in most other languages you generally can.