From f29fd8694cc85e5d6ba7adad3930c9cb27786d74 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 8 Feb 2010 18:27:29 -0500 Subject: [PATCH] Fix ada-mode handling of number literals. * progmodes/ada-mode.el (ada-in-numeric-literal-p): New function. (ada-adjust-case): Don't adjust case in hexadecimal number literals. --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/ada-mode.el | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 95bed4244af..6d4c7062745 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2010-02-08 Jose E. Marchesi + + * progmodes/ada-mode.el (ada-in-numeric-literal-p): New function. + (ada-adjust-case): Don't adjust case in hexadecimal number + literals. + 2010-02-08 Kenichi Handa * international/mule-util.el (with-coding-priority): Add autoload diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index a08e31e2016..95f9f6babf3 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -1017,6 +1017,9 @@ If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'." (line-beginning-position) (point)))) (or (ada-in-string-p parse-result) (ada-in-comment-p parse-result))) +(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_]+\\)")) ;;------------------------------------------------------------------ ;; Contextual menus @@ -1606,6 +1609,8 @@ If FORCE-IDENTIFIER is non-nil then also adjust keyword as identifier." (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) -- 2.39.5