[SVN] r7628 (C)
Joachim Mårtensson
joachimm at etek.chalmers.se
Sat Jun 30 00:17:25 UTC 2007
> On 29. Jun 2007, at 01:50, Joachim Mårtensson wrote:
>
>> experimental c/c++ grammar
>
> For future reference, please tell us what the change is supposed to
> do, so we don?t have to read diff?s to figure that out :)
Ok for some reason I forgot to put anything meaningful in the commit log.
The main purpose is to introduce a braced scope called meta.block.c, which
matches opening { and end }. The thinking is that inside such braces
everything that looks like a function call is a function call since
function declarations and definitions are illegal inside {...}, to not
mess with c++ initilizing on the string myString("hello world") form, a
rule to catch those were added. Outside braces the opposite is true.
Ofcourse the c grammar is inherited by the c++ grammar where {...} can
belong to class, struct and namespace to name a few, so I added separate
scopes for those.
Also in c++ foo(1) might not be a constructor, but a constructor
initializer, therefore I also introduced a :... { scope, and made the :
in public, private, protected explicit to avoid conflict with those.
please feel free to comment on the additions, tell me if my thinking is
faulty and such.
know bugs:
currently function-calls after return gets scoped wrong for some reason,
probably the fact that meta.function.c picks up leading spaces for some
reason. I did not want to change to much in existing rules before I know
why things are as the are, perhaps someone can explain why the leading
spaces are matched?
future:
It is probably better to move all the function matching to match rules
instead of begin/end patterns
Joachim Mårtensson
More information about the textmate-dev
mailing list