Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions php-mode-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,9 @@ 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)))
:faces (cond ((eq emacs-major-version 24) ".24.faces")
((version<= "27" emacs-version) ".27.faces")
(t 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))
Expand Down
166 changes: 166 additions & 0 deletions tests/comments.php.27.faces
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
;; -*- mode: emacs-lisp -*-
(("<?php" . php-php-tag)
("\n\n")
("/**\n * File level doc-comment\n *\n * " . font-lock-doc-face)
("@copyright" php-doc-annotation-tag font-lock-doc-face)
(" 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad\n * " . font-lock-doc-face)
("@copyright" php-doc-annotation-tag font-lock-doc-face)
(" 2008 Aaron S. Hawley\n * " . font-lock-doc-face)
("@copyright" php-doc-annotation-tag font-lock-doc-face)
(" 2011, 2012, 2013, 2014, 2015, 2016 Eric James Michael Ritz\n * " . font-lock-doc-face)
("@author" php-doc-annotation-tag font-lock-doc-face)
(" USAMI Kenta <tadsan@pixiv.com>\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)
("*/" . font-lock-comment-delimiter-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" . font-lock-type-face)
(" = ")
("'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"))