-
- ;; keywords followed by a name that should be in function-name-face.
- (list
- (apply
- 'concat
- (append
- '("\\<\\("
- "accept\\|"
- "entry\\|"
- "function\\|"
- "package[ \t]+body\\|"
- "package\\|"
- "pragma\\|"
- "procedure\\|"
- "task[ \t]+body\\|"
- "task[ \t]+type\\|"
- "task\\|"
- )
- (when (member ada-language-version '(ada95 ada2005 ada2012))
- '("\\|"
- "protected[ \t]+body\\|"
- "protected[ \t]+function\\|"
- "protected[ \t]+procedure\\|"
- "protected[ \t]+type\\|"
- "protected"
- ))
- (list
- "\\)\\>[ \t]*"
- ada-name-regexp "?")))
- '(1 font-lock-keyword-face) '(2 font-lock-function-name-face nil t))
-
- ;; keywords followed by a name that should be in type-face.
- (list (concat
- "\\<\\("
- "access[ \t]+all\\|"
- "access[ \t]+constant\\|"
- "access\\|"
- "constant\\|"
- "in[ \t]+reverse\\|"; loop iterator
- "in[ \t]+not[ \t]+null\\|"
- "in[ \t]+out[ \t]+not[ \t]+null\\|"
- "in[ \t]+out\\|"
- "in\\|"
- ;; "return\\|" can't distinguish between 'function ... return <type>;' and 'return ...;'
- ;; An indentation engine can, so a rule for this is added there
- "of[ \t]+reverse\\|"
- "of\\|"
- "out\\|"
- "subtype\\|"
- "type"
- "\\)\\>[ \t]*"
- ada-name-regexp "?")
- '(1 font-lock-keyword-face nil t) '(2 font-lock-type-face nil t))
-
- ;; Keywords not treated elsewhere. After above so it doesn't
- ;; override fontication of second or third word in those patterns.
- (list (concat
- "\\<"
- (regexp-opt
- (append
- '("abort" "abs" "accept" "all"
- "and" "array" "at" "begin" "case" "declare" "delay" "delta"
- "digits" "do" "else" "elsif" "entry" "exception" "exit" "for"
- "generic" "if" "in" "limited" "loop" "mod" "not"
- "null" "or" "others" "private" "raise"
- "range" "record" "rem" "renames" "reverse"
- "select" "separate" "task" "terminate"
- "then" "when" "while" "xor")
- (when (member ada-language-version '(ada95 ada2005 ada2012))
- '("abstract" "aliased" "requeue" "tagged" "until"))
- (when (member ada-language-version '(ada2005 ada2012))
- '("interface" "overriding" "synchronized"))
- (when (member ada-language-version '(ada2012))
- '("some"))
- )
- t)
- "\\>")
- '(0 font-lock-keyword-face))
-
- ;; object and parameter declarations; word after ":" should be in
- ;; type-face if not already fontified or an exception.
- (list (concat
- ":[ \t]*"
- ada-name-regexp
- "[ \t]*\\(=>\\)?")
- '(1 (if (match-beginning 2)
- 'default
- font-lock-type-face)
- nil t))
-
- ;; keywords followed by a name that should be in function-name-face if not already fontified
- (list (concat
- "\\<\\("
- "end"
- "\\)\\>[ \t]*"
- ada-name-regexp "?")
- '(1 font-lock-keyword-face) '(2 font-lock-function-name-face nil t))
-
- ;; Keywords followed by a name that could be a type or a function (generic instantiation).
- (list (concat
- "\\<\\("
- "new"
- "\\)\\>[ \t]*"
- ada-name-regexp "?[ \t]*\\((\\)?")
- '(1 font-lock-keyword-face)
- '(2 (if (match-beginning 3)
- font-lock-function-name-face
- font-lock-type-face)
- nil t))
-
- ;; keywords followed by a name that should be in type-face if not already fontified (for subtypes)
- ;; after "new" to handle "is new"
- (list (concat
- "\\<\\("
- "is"
- "\\)\\>[ \t]*"
- ada-name-regexp "?")
- '(1 font-lock-keyword-face) '(2 font-lock-type-face nil t))
-
- ;; Keywords followed by a comma separated list of names which
- ;; should be in constant-face, unless already fontified. Ada mode 4.01 used this.
- (list (concat
- "\\<\\("
- "goto\\|"
- "use\\|"
- ;; don't need "limited" "private" here; they are matched separately
- "with"; context clause
- "\\)\\>[ \t]*"
- "\\(\\(?:\\sw\\|[_., \t]\\)+\\>\\)?"; ada-name-regexp, plus ", \t"
- )
- '(1 font-lock-keyword-face) '(2 font-lock-constant-face nil t))
-
- ;; statement labels
- '("<<\\(\\sw+\\)>>" 1 font-lock-constant-face)
-
- ;; based numberic literals
- (list "\\([0-9]+#[0-9a-fA-F_]+#\\)" '(1 font-lock-constant-face t))
-
- ;; numeric literals
- (list "\\W\\([-+]?[0-9._]+\\)\\>" '(1 font-lock-constant-face))
-