[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Casing of number literals in ada-mode
From: |
Stephen Leake |
Subject: |
Re: Casing of number literals in ada-mode |
Date: |
Mon, 08 Feb 2010 11:37:05 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) |
Chong Yidong <address@hidden> writes:
> Hi Stephen, could you check this patch? If it's OK, we can commit it.
I can't reproduce the problem, so I don't see the need for the fix.
Jose; can you file a bug report, with a reproducer?
>
> Thanks.
>
>
> address@hidden writes:
>
>> Appended is a little patch that makes ada-mode to not case number
>> literals to avoid situations like:
>>
>> subtype U32 is range 16#0000_0000#..16#Ffff_Ffff#;
>>
>> Note the Ffff_Ffff.
>>
>> 2010-02-06 Jose E. Marchesi <address@hidden>
>>
>> * progmodes/ada-mode.el (ada-in-numeric-literal-p): New function.
>> (ada-adjust-case): Don't adjust case in hexadecimal number
>> literals.
>>
>> === modified file 'lisp/progmodes/ada-mode.el'
>> --- lisp/progmodes/ada-mode.el 2010-01-23 12:34:52 +0000
>> +++ lisp/progmodes/ada-mode.el 2010-02-07 22:02:29 +0000
>> @@ -1009,6 +1009,10 @@
>> (parse-partial-sexp
>> (line-beginning-position) (point)))))
>>
>> +(defsubst ada-in-numeric-literal-p ()
>> + "Return t if point is after a prefix of a numeric literal."
>> + (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)"))
>> +
>> (defsubst ada-in-string-or-comment-p (&optional parse-result)
>> "Return t if inside a comment or string.
>> If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'."
>> @@ -1606,6 +1610,8 @@
>> (eq (char-syntax (char-before)) ?w)
>> ;; if in a string or a comment
>> (not (ada-in-string-or-comment-p))
>> + ;; if in a numeric literal
>> + (not (ada-in-numeric-literal-p))
>> )
>> (if (save-excursion
>> (forward-word -1)
--
-- Stephe