changeset 107113:bb513dfefeaf

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.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 08 Feb 2010 18:27:29 -0500
parents 759400918e76
children e5188f4e7403
files lisp/ChangeLog lisp/progmodes/ada-mode.el
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Feb 08 09:11:15 2010 -0800
+++ b/lisp/ChangeLog	Mon Feb 08 18:27:29 2010 -0500
@@ -1,3 +1,9 @@
+2010-02-08  Jose E. Marchesi  <jemarch@gnu.org>
+
+	* 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  <handa@m17n.org>
 
 	* international/mule-util.el (with-coding-priority): Add autoload
--- a/lisp/progmodes/ada-mode.el	Mon Feb 08 09:11:15 2010 -0800
+++ b/lisp/progmodes/ada-mode.el	Mon Feb 08 18:27:29 2010 -0500
@@ -1017,6 +1017,9 @@
 			  (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 @@
 		 (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)