Georg Bauhaus <[email protected]> writes:

> Emacs Ada mode v5.0 does not currently support some of the wide
> character encodings that the GNAT reference manual specifies:
> indentation breaks when using Brackets Encoding.

ok.

> For example, where the intent is to write literals (or identifiers)
>
>   X1 : Wide_String := "in ‰";  -- per mille sign
>   X2 : Wide_String := "in €";  -- Euro sign
>   X3 : Wide_Character := 'θ';  -- theta
>   π : constant := Pi;  -- from Ada.Numerics (LRM)
 
Ada mode 5.0 handles this source - I'm mildly surprised, but certainly
pleased :). It just ignores everything between the quotes, but the pi
symbol is #x3c0. Ah; Emacs sets the syntax of that character to 'word',
which is all wisi cares about; excellent.

> then under some ASCII policy one would be writing, using brackets
> encoding,
>
>   X1 : Wide_String := "in ["2030"]";  -- per mille sign
>   X2 : Wide_String := "in ["20AC"]";  -- Euro sign
>   X3 : Wide_Character := '["03B8"]';  -- theta
>   ["03C0"] : constant := Pi;  -- c&p from Ada.Numerics (GNAT)
>
> GNAT translates these declarations as expected. Ada mode, however,
> is not prepared to handle these, in part, I guess, because '['
> and ']' cannot be identifier characters, 

They are not currently identifier characters, but that's easy to change,
because they are not otherwise used in the Ada syntax. But we can't do
that for ".

> and because the quotes
> around the four hex digits in brackets would not otherwise be
> legal in string literals (they do work, in GNAT brackets encoding).

That's more complicated. 

font-lock is also confused by those quotes.

> Can this be handled in the lexer?

The literals probably, I'm less sure about the identifier.

I'll add a test for these. I'm a little swamped by my pay job, so I may
not get to this for a while.

Hmm. I'm also playing with gnatinspect as a replacement for gnat find -
I wonder how either of those deals with this? Have you tried C-c C-d on
["03C0"]?

-- 
-- Stephe

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to