branch: externals/phps-mode
commit ce656a57256030c3f421c449b6c0b4a252d83998
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
More general cleaning up
---
phps-automation.el | 8 +++--
phps-flymake.el | 3 +-
phps-font-lock.el | 93 +---------------------------------------------------
phps-map.el | 2 ++
phps-syntax-table.el | 1 -
5 files changed, 9 insertions(+), 98 deletions(-)
diff --git a/phps-automation.el b/phps-automation.el
index 3ab13df..46687fc 100644
--- a/phps-automation.el
+++ b/phps-automation.el
@@ -1,8 +1,9 @@
-;;; phps-automation --- Genereate a Wisent Parser file
+;;; phps-automation --- Generate a Wisent Parser file
;;; Commentary:
+
;;; Uses a parser to convert LALR Yacc grammar to Wisent grammar
;;; AST should be like this: (root (block (rule (logic))))
@@ -10,6 +11,7 @@
;;; Code:
+
(add-to-list 'load-path (expand-file-name
"~/.emacs.d/emacs-wisent-grammar-converter/"))
(require 'emacs-wisent-grammar-converter)
@@ -28,5 +30,5 @@
(emacs-wisent-grammar-converter/generate-grammar-from-filename php-yacc-file
wisent-destination)
(message "Automation completed"))
-(provide 'phps-automation2)
-;;; phps-automation2.el ends here
+(provide 'phps-automation)
+;;; phps-automation.el ends here
diff --git a/phps-flymake.el b/phps-flymake.el
index 6da1421..05dddca 100644
--- a/phps-flymake.el
+++ b/phps-flymake.el
@@ -32,9 +32,8 @@
;;; Commentary:
-;; Please see README.md from the same repository for extended documentation.
-;;; Commentary:
+;; Please see README.md from the same repository for extended documentation.
;;; Code:
diff --git a/phps-font-lock.el b/phps-font-lock.el
index ca28b42..7b23db9 100644
--- a/phps-font-lock.el
+++ b/phps-font-lock.el
@@ -32,103 +32,13 @@
;;; Commentary:
-;; Please see README.md from the same repository for extended documentation.
-;;; Commentary:
+;; Please see README.md from the same repository for extended documentation.
;;; Code:
-(defconst phps-mode/keywords
- (list
- "__halt_compiler"
- "abstract"
- "and"
- "array"
- "as"
- "break"
- "callable"
- "case"
- "catch"
- "class"
- "clone"
- "const"
- "continue"
- "declare"
- "default"
- "die"
- "do"
- "echo"
- "else"
- "elseif"
- "empty"
- "enddeclare"
- "endfor"
- "endforeach"
- "endif"
- "endswitch"
- "endwhile"
- "eval"
- "exit"
- "extends"
- "final"
- "finally"
- "for"
- "foreach"
- "function"
- "global"
- "goto"
- "if"
- "implements"
- "include"
- "include_once"
- "instanceof"
- "insteadof"
- "interface"
- "isset"
- "list"
- "namespace"
- "new"
- "or"
- "print"
- "private"
- "protected"
- "public"
- "require"
- "require_once"
- "return"
- "static"
- "switch"
- "throw"
- "trait"
- "try"
- "unset"
- "use"
- "var"
- "while"
- "xor"
- "yield"
-
- ;; Compile-time constants here
- "__CLASS__"
- "__DIR__"
- "__FILE__"
- "__FUNCTION__"
- "__LINE__"
- "__METHOD__"
- "__NAMESPACE__"
- "__TRAIT__"
- )
- "Use list of keywords to build regular expression for syntax highlighting.")
-
-(defconst phps-mode/font-lock-keywords
- (let ((regex (concat "\\<" (regexp-opt phps-mode/keywords t) "\\>")))
- (list
- `(,regex . font-lock-builtin-face)
- '("\\('\\w*'\\)" . font-lock-variable-name-face)))
- "Minimal highlighting expressions for major mode.")
-
(defun phps-mode/font-lock-init ()
"Apply font-lock."
@@ -137,7 +47,6 @@
;; This makes it possible to have full control over syntax coloring from the
lexer
(set (make-local-variable 'font-lock-defaults) '(nil t))
- ;; (set (make-local-variable 'font-lock-defaults)
'(phps-mode/font-lock-keywords))
)
(provide 'phps-mode/font-lock)
diff --git a/phps-map.el b/phps-map.el
index 12320a6..e398e31 100644
--- a/phps-map.el
+++ b/phps-map.el
@@ -30,8 +30,10 @@
;;; Commentary:
+
;; Please see README.md from the same repository for extended documentation.
+
;;; Code:
diff --git a/phps-syntax-table.el b/phps-syntax-table.el
index 0bd9e61..c35268b 100644
--- a/phps-syntax-table.el
+++ b/phps-syntax-table.el
@@ -65,7 +65,6 @@
(defun phps-mode/syntax-table-init ()
"Apply syntax table."
- ;; (setq font-lock-keywords-only t)
(set-syntax-table phps-mode/syntax-table))
(provide 'phps-mode/syntax-table)