diff --git a/php-mode-test.el b/php-mode-test.el index edb87087..2c0b5015 100644 --- a/php-mode-test.el +++ b/php-mode-test.el @@ -370,326 +370,6 @@ style from Drupal." "Closure indentation." (with-php-mode-test ("issue-145.php" :indent t))) -(ert-deftest php-mode-test-comments () - "Proper highlighting for comments and doc-blocks." - (with-php-mode-test ("comments.php") - (search-forward "/**") - (should (eq (get-text-property (match-beginning 0) 'face) - 'font-lock-doc-face)) - - (search-forward "@copyright") - (should (equal (get-text-property (match-beginning 0) 'face) - '(php-doc-annotation-tag font-lock-doc-face))) - (search-forward-regexp "@link +\\(https://github.com/emacs-php/php-mode\\)") - (should (equal (get-text-property (match-beginning 1) 'face) - '(link font-lock-doc-face))) - (search-forward-regexp "@package +\\(Emacs\\\\PHPMode\\)") - (should (equal (get-text-property (match-beginning 0) 'face) - '(php-doc-annotation-tag font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 1) 'face) - '(php-string font-lock-doc-face))) - - - (search-forward-regexp "// \\(@annotation This is NOT annotation. 1\\)") - (should (eq (get-text-property (match-beginning 0) 'face) - 'font-lock-comment-delimiter-face)) - (should (eq (get-text-property (match-beginning 1) 'face) - 'font-lock-comment-face)) - - (search-forward-regexp "\\* \\(@annotation This is NOT annotation. 2\\)") - (should (eq (get-text-property (match-beginning 0) 'face) - 'font-lock-comment-face)) - (should (eq (get-text-property (match-beginning 1) 'face) - 'font-lock-comment-face)) - - ;; Comment outed doc-block - (search-forward "/**") - (should (eq (get-text-property (match-beginning 0) 'face) - 'font-lock-comment-face)) - - (search-forward-regexp "\\* \\(@annotation This is NOT annotation. 3\\)") - (should (equal (get-text-property (match-beginning 0) 'face) - 'font-lock-comment-face)) - - (should (equal (get-text-property (match-beginning 1) 'face) - 'font-lock-comment-face)) - - (search-forward "class CommentOuted") - (should (eq (get-text-property (match-beginning 0) 'face) - 'font-lock-comment-face)) - - ;; Class level doc-comment - (search-forward-regexp "{@internal \\(Description\\)}") - (should (equal (get-text-property (match-beginning 0) 'face) - '(php-doc-annotation-tag font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 1) 'face) - '(php-string php-doc-annotation-tag font-lock-doc-face))) - - (should (equal (get-text-property (1- (match-end 0)) 'face) - '(php-doc-annotation-tag font-lock-doc-face))) - (should (equal (get-text-property (match-end 0) 'face) - 'font-lock-doc-face)) - - (search-forward-regexp "@property\\(-read\\)") - (should (equal (get-text-property (match-beginning 0) 'face) - '(php-doc-annotation-tag font-lock-doc-face))) - - (should (equal (get-text-property (match-beginning 1) 'face) - '(php-doc-annotation-tag font-lock-doc-face))) - - (search-forward-regexp "@ORM\\(\\\\Table\\)") - (should (equal (get-text-property (match-beginning 0) 'face) - '(php-doc-annotation-tag font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 1) 'face) - '(php-doc-annotation-tag font-lock-doc-face))) - - (search-forward-regexp "@var \\(string\\) \\(sample property doc-comment\\)") - (should (equal (get-text-property (match-beginning 0) 'face) - '(php-doc-annotation-tag font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 1) 'face) - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 2) 'face) - 'font-lock-doc-face)) - - (search-forward-regexp "// \\(comment in after code\\)") - (should (eq (get-text-property (match-beginning 0) 'face) - 'font-lock-comment-delimiter-face)) - (should (eq (get-text-property (match-beginning 1) 'face) - 'font-lock-comment-face)) - - (search-forward-regexp "@var \\(string\\)|\\(bool\\)|\\(array\\)\\([[]]\\)|\\(ArrayObject\\) \\*/$") - (should (equal (get-text-property (match-beginning 0) 'face) ;; matches `@' - '(php-doc-annotation-tag font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `s' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (match-end 1) 'face) ;; matches `|' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 2) 'face) ;; matches `b' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (match-end 2) 'face) ;; matches `|' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 3) 'face) ;; matches `a' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 4) 'face) ;; matches `[' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-end 4) 'face) ;; matches `|' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 5) 'face) ;; matches `A' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-end 5) 'face) ;; matches ` ' - ' font-lock-doc-face)) - - (search-forward-regexp "// \\(one-line comment\\)") - (should (eq (get-text-property (match-beginning 0) 'face) - 'font-lock-comment-delimiter-face)) - (should (eq (get-text-property (match-beginning 1) 'face) - 'font-lock-comment-face)) - - (search-forward-regexp "// \\(@annotation This is NOT annotation. 4\\)") - (should (eq (get-text-property (match-beginning 0) 'face) - 'font-lock-comment-delimiter-face)) - (should (eq (get-text-property (match-beginning 1) 'face) - 'font-lock-comment-face)) - - (search-forward-regexp "@var \\(int\\) \\(internal linter variable\\) \\*/$") - (should (equal (get-text-property (match-beginning 0) 'face) ;; matches `@' - '(php-doc-annotation-tag font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (match-end 1) 'face) ;; matches ` ' - 'font-lock-doc-face)) - (should (equal (get-text-property (match-beginning 2) 'face) ;; matches `i' - 'font-lock-doc-face)) - (should (equal (get-text-property (match-end 2) 'face) ;; matches ` ' - 'font-lock-doc-face)) - - (search-forward-regexp "@throws \\(\\\\RuntimeException\\)$") - (should (equal (get-text-property (match-beginning 0) 'face) ;; matches `@' - '(php-doc-annotation-tag font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `\' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1+ (match-beginning 1)) 'face) ;; matches `R' - '(php-string font-lock-doc-face))))) - -(ert-deftest php-mode-test-comment-return-type () - "Proper highlighting for type annotation in doc-block." - (with-php-mode-test ("doc-comment-return-type.php") - ;; Test for premitive type (int) - (search-forward-regexp "@return \\(int\\) +\\(A integer value\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\?int\\) +\\(A nullable integer value\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `?' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1+ (match-beginning 1)) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\int\\[\\]\\) +\\(A list of integer values\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (1- (match-end 1)) 'face) ;; matches `]' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - ;; Test for class type (DateTime) - (search-forward-regexp "@return \\(DateTime\\) +\\(A DateTime object value\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `D' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\?DateTime\\) +\\(A nullable DateTime object value\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `?' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1+ (match-beginning 1)) 'face) ;; matches `D' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\DateTime\\[]\\) +\\(A list of DateTime object values\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `D' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1- (match-end 1)) 'face) ;; matches `]' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - ;; Test for class type (stdClass) - (search-forward-regexp "@return \\(stdClass\\) +\\(A stdClass object value\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `s' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\?stdClass\\) +\\(A nullable stdClass object value\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `?' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1+ (match-beginning 1)) 'face) ;; matches `s' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(stdClass\\[]\\) +\\(A list of stdClass object values\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `s' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1- (match-end 1)) 'face) ;; matches `]' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - ;; Test for class type (\App\User) - (search-forward-regexp "@return \\(\\\\App\\\\User\\) +\\(A \\\\App\\\\User object value\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `\' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1+ (match-beginning 1)) 'face) ;; matches `A' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\?\\\\App\\\\User\\) +\\(A nullable \\\\App\\\\User object value\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `?' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1+ (match-beginning 1)) 'face) ;; matches `\\' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\\\App\\\\User\\[]\\) +\\(A list of \\\\App\\\\User object values\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `\' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1- (match-end 1)) 'face) ;; matches `]' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `A' - 'font-lock-doc-face)) - - ;; Test for multiple types - (search-forward-regexp "@return \\(int\\)\\(|\\)\\(string\\) +\\(Multiple types by int and string\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 2) 'face) ;; matches `|' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 3) 'face) ;; matches `s' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 4) 'face) ;; matches `M' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(int\\[]\\)\\(|\\)\\(string\\) +\\(Multiple types by list of int and string\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (1- (match-end 1)) 'face) ;; matches `]' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 2) 'face) ;; matches `|' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 3) 'face) ;; matches `s' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 4) 'face) ;; matches `M' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(int\\)\\(|\\)\\(stdClass\\) +\\(Multiple types by int and stdClass\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 2) 'face) ;; matches `|' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 3) 'face) ;; matches `s' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 4) 'face) ;; matches `M' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(int\\)\\(|\\)\\(\\\\App\\\\User\\) +\\(Multiple types by int and \\\\App\\\\User\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 2) 'face) ;; matches `|' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 3) 'face) ;; matches `\' - '(php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 4) 'face) ;; matches `M' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(DateTime\\)\\(|\\)\\(int\\) +\\(Multiple types by DateTime and int\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `D' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 2) 'face) ;; matches `|' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 3) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 4) 'face) ;; matches `M' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\\\App\\\\User\\)\\(|\\)\\(int\\) +\\(Multiple types by \\\\App\\\\User and int\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `\' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (1+ (match-beginning 1)) 'face) ;; matches `A' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 2) 'face) ;; matches `|' - '(php-string font-lock-doc-face))) - (should (equal (get-text-property (match-beginning 3) 'face) ;; matches `i' - '(font-lock-type-face php-string font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 4) 'face) ;; matches `M' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\$this\\) +\\(this is special variable\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `$' - '(php-doc-$this-sigil php-doc-variable-sigil font-lock-doc-face))) - (should (equal (get-text-property (1+ (match-beginning 1)) 'face) ;; matches `t' - '(php-doc-$this php-variable-name font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `M' - 'font-lock-doc-face)) - - (search-forward-regexp "@return \\(\\$that\\) +\\(that is NOT special variable\\)") - (should (equal (get-text-property (match-beginning 1) 'face) ;; matches `$' - '(php-doc-variable-sigil font-lock-doc-face))) - (should (equal (get-text-property (1+ (match-beginning 1)) 'face) ;; matches `t' - '(php-variable-name font-lock-doc-face))) - (should (eq (get-text-property (match-beginning 2) 'face) ;; matches `M' - 'font-lock-doc-face)) - )) - (ert-deftest php-mode-test-constants () "Proper highlighting for constants." (custom-set-variables '(php-extra-constants (quote ("extraconstant")))) @@ -987,6 +667,11 @@ Meant for `php-mode-test-issue-503'." (ert-deftest php-mode-test-lang () "Test highlighting for language constructs." + (with-php-mode-test ("comments.php" + :faces (if (eq emacs-major-version 24) + ".24.faces" + t))) + (with-php-mode-test ("doc-comment-return-type.php" :faces t)) (with-php-mode-test ("lang/types/cast.php" :faces t)) (with-php-mode-test ("lang/types/function.php" :faces t)) (with-php-mode-test ("lang/types/keywords.php" :faces t)) diff --git a/tests/comments.php.24.faces b/tests/comments.php.24.faces new file mode 100644 index 00000000..ed0e39b3 --- /dev/null +++ b/tests/comments.php.24.faces @@ -0,0 +1,165 @@ +;; -*- mode: emacs-lisp -*- +(("\n * " . font-lock-doc-face) + ("@link" php-doc-annotation-tag font-lock-doc-face) + (" " . font-lock-doc-face) + ("https://github.com/emacs-php/php-mode" link font-lock-doc-face) + ("\n * " . font-lock-doc-face) + ("@package" php-doc-annotation-tag font-lock-doc-face) + (" " . font-lock-doc-face) + ("Emacs\\PHPMode" php-string font-lock-doc-face) + ("\n */" . font-lock-doc-face) + ("\n\n") + ("// " . font-lock-comment-delimiter-face) + ("one-line comment\n" . font-lock-comment-face) + ("// " . font-lock-comment-delimiter-face) + ("@annotation This is NOT annotation. 1\n" . font-lock-comment-face) + ("\n") + ("/*" . font-lock-comment-delimiter-face) + ("------------------------------------------------\n Multi-line comment\n\n * @annotation This is NOT annotation. 2\n -------------------------------------------------*/" . font-lock-comment-face) + ("\n\n") + ("// " . font-lock-comment-delimiter-face) + ("/**\n" . font-lock-comment-face) + ("// " . font-lock-comment-delimiter-face) + ("* Comment outed class implementation\n" . font-lock-comment-face) + ("// " . font-lock-comment-delimiter-face) + ("*\n" . font-lock-comment-face) + ("// " . font-lock-comment-delimiter-face) + ("* @annotation This is NOT annotation. 3\n" . font-lock-comment-face) + ("// " . font-lock-comment-delimiter-face) + ("*/\n" . font-lock-comment-face) + ("// " . font-lock-comment-delimiter-face) + ("class CommentOuted\n" . font-lock-comment-face) + ("// " . font-lock-comment-delimiter-face) + ("{\n" . font-lock-comment-face) + ("// " . font-lock-comment-delimiter-face) + ("}\n" . font-lock-comment-face) + ("\n") + ("/**\n * Class level doc-comment\n *\n * Description " . font-lock-doc-face) + ("{@internal " php-doc-annotation-tag font-lock-doc-face) + ("Description" php-string php-doc-annotation-tag font-lock-doc-face) + ("}" php-doc-annotation-tag font-lock-doc-face) + (" inline tag.\n *\n * " . font-lock-doc-face) + ("@property-read" php-doc-annotation-tag font-lock-doc-face) + (" " . font-lock-doc-face) + ("string" font-lock-type-face php-string font-lock-doc-face) + ("[]" php-string font-lock-doc-face) + (" " . font-lock-doc-face) + ("$" php-doc-variable-sigil font-lock-doc-face) + ("name" php-variable-name font-lock-doc-face) + ("\n * " . font-lock-doc-face) + ("@ORM\\Table" php-doc-annotation-tag font-lock-doc-face) + ("(name=\"majormodes\")\n * " . font-lock-doc-face) + ("@ORM\\Entity" php-doc-annotation-tag font-lock-doc-face) + ("(repositoryClass=\"Emacs\\Repository\\MajorModeRepository\")\n */" . font-lock-doc-face) + ("\n") + ("final" . php-keyword) + (" ") + ("class" . php-keyword) + (" ") + ("SampleClass" . font-lock-type-face) + ("\n{\n ") + ("/** Const doc-comment */" . font-lock-doc-face) + ("\n ") + ("const" . php-keyword) + (" ") + ("SAMPLE" . php-constant-assign) + (" = ") + ("'SAMPLE'" . php-string) + (";\n ") + ("/** " . font-lock-doc-face) + ("@var" php-doc-annotation-tag font-lock-doc-face) + (" " . font-lock-doc-face) + ("string" font-lock-type-face php-string font-lock-doc-face) + (" sample property doc-comment */" . font-lock-doc-face) + ("\n ") + ("private" . php-keyword) + (" ") + ("$" . php-variable-sigil) + ("name" . php-variable-name) + (";\n\n ") + ("/**\n * " . font-lock-doc-face) + ("@param" php-doc-annotation-tag font-lock-doc-face) + (" " . font-lock-doc-face) + ("string" font-lock-type-face php-string font-lock-doc-face) + (" " . font-lock-doc-face) + ("$" php-doc-variable-sigil font-lock-doc-face) + ("name" php-variable-name font-lock-doc-face) + ("\n */" . font-lock-doc-face) + ("\n ") + ("public" . php-keyword) + (" ") + ("function" . php-keyword) + (" ") + ("__construct" . php-function-name) + ("(") + ("$" . php-variable-sigil) + ("name" . php-variable-name) + (")\n {\n ") + ("$" . php-$this-sigil) + ("this" . php-$this) + ("->" . php-object-op) + ("name" . php-property-name) + (" = ") + ("$" . php-variable-sigil) + ("name" . php-variable-name) + ("; ") + ("// " . font-lock-comment-delimiter-face) + ("comment in after code\n" . font-lock-comment-face) + ("\n ") + ("/** " . font-lock-doc-face) + ("@var" php-doc-annotation-tag font-lock-doc-face) + (" " . font-lock-doc-face) + ("string" font-lock-type-face php-string font-lock-doc-face) + ("|" php-string font-lock-doc-face) + ("bool" font-lock-type-face php-string font-lock-doc-face) + ("|" php-string font-lock-doc-face) + ("array" font-lock-type-face php-string font-lock-doc-face) + ("[]|ArrayObject" php-string font-lock-doc-face) + (" */" . font-lock-doc-face) + ("\n ") + ("$" . php-variable-sigil) + ("foo" . php-variable-name) + (" = hoge();\n\n ") + ("// " . font-lock-comment-delimiter-face) + ("one-line comment\n" . font-lock-comment-face) + (" ") + ("// " . font-lock-comment-delimiter-face) + ("@annotation This is NOT annotation. 4\n" . font-lock-comment-face) + ("\n ") + ("/** " . font-lock-doc-face) + ("@var" php-doc-annotation-tag font-lock-doc-face) + (" " . font-lock-doc-face) + ("int" font-lock-type-face php-string font-lock-doc-face) + (" internal linter variable */" . font-lock-doc-face) + ("\n ") + ("$" . php-variable-sigil) + ("offset" . php-variable-name) + (" = 0;\n }\n\n ") + ("/**\n * Summary\n *\n * " . font-lock-doc-face) + ("@throws" php-doc-annotation-tag font-lock-doc-face) + (" " . font-lock-doc-face) + ("\\RuntimeException" php-string font-lock-doc-face) + ("\n */" . font-lock-doc-face) + ("\n ") + ("public" . php-keyword) + (" ") + ("function" . php-keyword) + (" ") + ("test" . php-function-name) + ("()\n {\n ") + ("throw" . php-keyword) + (" ") + ("new" . php-keyword) + (" ") + ("\\RuntimeException" . font-lock-type-face) + (";\n }\n}\n")) diff --git a/tests/doc-comment-return-type.php.faces b/tests/doc-comment-return-type.php.faces new file mode 100644 index 00000000..13d08f2f --- /dev/null +++ b/tests/doc-comment-return-type.php.faces @@ -0,0 +1,199 @@ +;; -*- mode: emacs-lisp -*- +(("