 (defconst factor-symbols-lines-regex
   (concat (syntax-begin '("SYMBOLS")) ws+ symbols-to-semicolon))
 
-(defconst factor-int-constant-def-regex
-  (syntax-and-1-symbol '("ALIEN" "CHAR" "NAN")))
+;; (defconst factor-int-constant-def-regex
+;;   (syntax-and-1-symbol '("ALIEN" "CHAR" "NAN")))
 
 (defconst factor-type-definition-regex
   (syntax-and-1-symbol
-   '("C-STRUCT" "C-UNION" "COM-INTERFACE" "MIXIN" "SINGLETON"
-     "SPECIALIZED-ARRAY" "STRUCT" "UNION-STRUCT")))
+   '("COM-INTERFACE" "C-TYPE" "MIXIN" "SINGLETON" "SPECIALIZED-ARRAY")))
 
 (defconst factor-constructor-regex
-  "<[^ >]+>")
+  (one-symbol "<[^ >]+>"))
 
 (defconst factor-getter-regex
   (one-symbol "\\(?:\\sw\\|\\s_\\)+>>"))

    ;; definition that is terminated with ";" is searched for words
    ;; that are slot names which are highlighted with the face
    ;; factor-font-lock-symbol.

    (,(format
       "\\(%s:\\)[ \n]+%s\\(?:[ \n]+\\(<\\)[ \n]+%s\\)?"
       (regexp-opt '("BUILTIN"

          symbol ws+
          "\\(=>\\)" ws+ symbols-to-semicolon))

(defconst factor-group-name-to-face
  #s(hash-table test equal data
                ("C" 'factor-font-lock-comment
                 "CO" 'factor-font-lock-constructor
                 "CT" 'factor-font-lock-constant
                 "P" 'factor-font-lock-parsing-word
                 "V" 'factor-font-lock-vocabulary-name
                 "T" 'factor-font-lock-type-name
                 "W" 'factor-font-lock-word)))

(defun factor-group-name-to-face (group-name)
  (gethash group-name factor-group-name-to-face))


(defun factor-groups-to-font-lock (groups)
  (let ((i 0))
    (mapcar (lambda (x)
              (setq i (1+ i))
              (list i (factor-group-name-to-face x)))
            groups)))

(defun factor-syntax (regex groups)
  (append (list regex) (factor-groups-to-font-lock groups)))


;;; Font lock:

(defconst factor-font-lock-keywords
  `(
    ,(factor-syntax factor-brace-words-regex '("P"))
    ,(factor-syntax factor-vocab-ref-regex '("P" "V"))
    ,(factor-syntax factor-using-lines-regex '("P" "V" "P"))
    ,(factor-syntax factor-symbols-lines-regex '("P" "W" "P"))
    ,(factor-syntax factor-from/exclude-regex '("P" "V" "P" "W" "P"))
    ,(factor-syntax (syntax-and-2-symbols '("C")) '("P" "W" "T"))
    ,(factor-syntax factor-symbol-definition-regex '("P" "W"))
    ,(factor-syntax factor-typedef-regex '("P" "T" "T"))
    ,(factor-syntax (syntax-and-2-symbols '("C-GLOBAL")) '("P" "T" "W"))
    ,(factor-syntax (syntax-and-2-symbols '("QUALIFIED-WITH")) '("P" "V" "W"))
    ,(factor-syntax factor-rename-regex '("P" "W" "V" "P" "W"))
    ,(factor-syntax factor-declaration-words-regex '("C"))
    ,(factor-syntax factor-word-definition-regex '("P" "W"))
    ,(factor-syntax (syntax-and-2-symbols '("ALIAS")) '("P" "W" "W"))
    ,(factor-syntax (syntax-and-1-symbol '("ALIEN" "CHAR" "NAN")) '("P" "CT"))
    (,factor-integer-regex . 'factor-font-lock-number)
    (,factor-float-regex . 'factor-font-lock-number)
    (,factor-ratio-regex . 'factor-font-lock-ratio)
    ,(factor-syntax factor-type-definition-regex '("P" "T"))
    ,(factor-syntax (syntax-and-2-symbols '("M" "M:" "BEFORE" "AFTER"))
                    '("P" "T" "W"))

    ;; Highlights tuple and struct definitions. The TUPLE/STRUCT
    ;; parsing word, class name and optional parent classes are
