branch: elpa/lua-mode
commit 9d758785dcad9771d4f87f73798b418111f235f4
Author: immerrr <[email protected]>
Commit: immerrr <[email protected]>
lua-font-lock-keywords: highlight numbers as constants (issue #15)
---
lua-mode.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lua-mode.el b/lua-mode.el
index 8c499af..2e9bb4b 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -348,6 +348,13 @@ index of respective Lua reference manuals.")
'("\\(\\(\\sw:\\|\\sw\\.\\|\\sw_\\|\\sw\\)+\\)[ \t]*=[
\t]*\\(function\\)\\_>"
(1 font-lock-function-name-face nil t) (3 font-lock-keyword-face))
+ ;; octal numbers
+ '("\\_<0x[[:xdigit:]]+\\_>" . font-lock-constant-face)
+
+ ;; regular numbers
+
'("\\_<\\(?1:\\(?:\\(?:[0-9]+\\.?[0-9]*\\|[0-9]*\\.?[0-9]+\\)\\(?:[eE][+-]?[0-9]+\\)?\\)\\)\\_>"
+ . font-lock-constant-face)
+
;; Keywords.
(concat "\\_<"
(regexp-opt '("and" "break" "do" "else" "elseif" "end" "false"