For instance:
A := 1; -- A multi-line comment
- -- aligned if ada-indent-align-comments is t"
+ -- aligned if `ada-indent-align-comments' is t"
:type 'boolean :group 'ada)
(defcustom ada-indent-comment-as-code t
(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
(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)
(insert " ")
(ada-adjust-case)
;; horrible dekludge
- (delete-backward-char 1)
+ (delete-char -1)
;; some special keys and their bindings
(cond
((eq lastk ?\n)
(defun ada-in-paramlist-p ()
- "Return t if point is inside a parameter-list."
+ "Return t if point is inside the parameter-list of a declaration, but not a subprogram call or aggregate."
(save-excursion
(and
(ada-search-ignore-string-comment "(\\|)" t nil t)
;; right keyword two words before parenthesis ?
;; Type is in this list because of discriminants
+ ;; pragma is not, because the syntax is that of a subprogram call.
(looking-at (eval-when-compile
(concat "\\<\\("
"procedure\\|function\\|body\\|"
"task\\|entry\\|accept\\|"
"access[ \t]+procedure\\|"
"access[ \t]+function\\|"
- "pragma\\|"
"type\\)\\>"))))))
(defun ada-search-ignore-complex-boolean (regexp backwardp)