GNU bug report logs -
#1913
Identifier after reserved word "raise" is not always highlighted in Ada-mode
Previous Next
Reported by: Erik <esigra <at> gmail.com>
Date: Thu, 15 Jan 2009 08:05:05 UTC
Severity: minor
Done: Stephen Leake <stephen_leake <at> stephe-leake.org>
Bug is archived. No further changes may be made.
Full log
Message #45 received at 1913 <at> debbugs.gnu.org (full text, mbox):
It is clear that [a-zA-Z] does not match the characters permitted by
the Ada standard.
However, neither does [[:alpha:]] - consider this fragment:
procedure doµ
the 'µ' (entered by C-x 8 u) is not matched by [[:alpha:]]*
(Emacs 23.1, Windows XP, LANG=C.UTF-8).
This could be fixed by the user; they can define µ to have word
syntax.
Ideally, we would have regular expression character ranges that match
those defined by ISO/IEC 10646:2003 (see LRM 2.1);
Letter, Uppercase
Letter, Lowercase
Letter, Titlecase
Letter, Modifier
Letter, Other
Mark, Non-Spacing
Mark, Spacing Combining
Number, Decimal
Number, Letter
Punctuation, Connector
Other, Format
Separator, Space
Separator, Line
Separator, Paragraph
These categories are used to define Ada lexical elements (LRM 2.2).
But I don't think that's going to happen.
It seems the best compromise is to replace a-z etc with [:alpha:] or
[:alnum:] as appropriate, and hope the user knows how to define
characters to have word syntax. That's a lot of work, since each
modified regexp needs to be tested.
As for matching leading underscores, I agree it would be nice to get
it right. Using shy groups (the elisp name for non-capturing groups)
would help, since it won't disturb the group numbering, as well as
being faster. If it doesn't complicate the testing, I'll try to do
that.
Do you have suggestions about which regular expressions are more
important to be fixed? If you can provide typical code, and point out
the most annoying font-lock failures, that would be a good start.
--
-- Stephe
This bug report was last modified 4 years and 330 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.