[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with parenthesis matching and autoindentation in MacOS X ver
From: |
Juha Nieminen |
Subject: |
Re: Problem with parenthesis matching and autoindentation in MacOS X version of emacs |
Date: |
Thu, 18 Dec 2008 00:32:25 GMT |
User-agent: |
Thunderbird 2.0.0.18 (X11/20081112) |
Alan Mackenzie wrote:
>> Would it be a great loss if the <> "brackets" were not included in the
>> matching logic at all?
>
> It would be a loss, yes. Maybe not that great, but it would be a loss in
> consistency, since paren matching should match any sort of
> parens/braces/brackets, etc.
I know that the C++ language syntax is not a context-free grammar. In
other words, the meaning of tokens (eg. the tokens < and >) cannot be
deduced without the context.
OTOH, it basically only makes the life of compilers and code editing
software harder, not people writing C++. It *is* the duty of programs to
do all the hard work, rather than leaving it to the user. :)
OTOH, given that it's impossible to know the meaning of the < and >
symbols in C++ without the full context, I assume it will be impossible
to make any matching logic which would work in all cases. I don't really
think it would be a huge loss if those were not included in the
parenthesis matching rules.