   (setq-local comment-start-skip "!+ *")
   (setq-local parse-sexp-ignore-comments t)
   (setq-local parse-sexp-lookup-properties t)
-  (setq-local font-lock-defaults '(factor-font-lock-keywords nil nil nil nil))
+  (setq-local font-lock-defaults '(factor-font-lock-keywords))
+  ;; Some syntactic constructs are often split over multiple lines so
+  ;; we need to setup multiline font-lock.
+  (setq-local font-lock-multiline t)
+  (add-hook 'font-lock-extend-region-functions 'factor-font-lock-extend-region)
 
   (define-key factor-mode-map [remap ff-get-other-file]
     'factor-visit-other-file)

  '(":" "::" ";" "&:" "<<" "<PRIVATE" ">>"
    "ABOUT:" "AFTER:" "ALIAS:" "ALIEN:" "ARTICLE:"
    "B" "BEFORE:"
    "C:" "CALLBACK:" "C-GLOBAL:" "C-TYPE:" "CHAR:" "COM-INTERFACE:" "CONSTANT:"
    "CONSULT:" "call-next-method"
    "DEFER:" "DESTRUCTOR:"
    "EBNF:" ";EBNF" "ENUM:" "ERROR:" "EXCLUDE:"

    (,factor-constant-words-regex . 'factor-font-lock-constant)
    (,factor-parsing-words-regex . 'factor-font-lock-parsing-word)))

;; Handling of multi-line constructs
(defun factor-font-lock-extend-region ()
  (eval-when-compile (defvar font-lock-beg) (defvar font-lock-end))
  (save-excursion
    (goto-char font-lock-beg)
    (let ((found (or (re-search-backward "\n\n" nil t) (point-min))))
      (goto-char font-lock-end)
      (when (re-search-forward "\n\n" nil t)
        (beginning-of-line)
        (setq font-lock-end (point)))
      (setq font-lock-beg found))))

;;; Source code analysis:

