mirror of
https://github.com/godotengine/emacs-gdscript-mode.git
synced 2025-12-31 21:48:34 +03:00
Use gdscript-mode-syntax-table instead of gdscript-syntax-table
Highlight '$' operator constant similar to Godot editor
This commit is contained in:
@@ -110,9 +110,9 @@ the last command event was a string delimiter."
|
||||
(setq-local tab-width gdscript-tab-width)
|
||||
(setq-local indent-tabs-mode gdscript-use-tab-indents)
|
||||
|
||||
(set-syntax-table gdscript-syntax-table)
|
||||
(modify-syntax-entry ?\# "\<" gdscript-syntax-table)
|
||||
(modify-syntax-entry ?\n ">" gdscript-syntax-table)
|
||||
(set-syntax-table gdscript-mode-syntax-table)
|
||||
(modify-syntax-entry ?\# "\<" gdscript-mode-syntax-table)
|
||||
(modify-syntax-entry ?\n ">" gdscript-mode-syntax-table)
|
||||
|
||||
(setq-local comment-start "# ")
|
||||
(setq-local comment-start-skip "#+\\s-*")
|
||||
|
||||
@@ -56,7 +56,11 @@
|
||||
(_ form))))
|
||||
|
||||
;; Controls font-face mappings or colors to highlight groups of keywords
|
||||
(defvar gdscript-font-lock `((,(gdscript-syntax-regex-maker gdscript-keywords)
|
||||
(defvar gdscript-font-lock `((,(rx (and "$" (one-or-more (or "/" (one-or-more word)))))
|
||||
(0 font-lock-constant-face))
|
||||
(,(rx (and (group "$") "\"" (zero-or-more nonl) "\""))
|
||||
(1 font-lock-constant-face))
|
||||
(,(gdscript-syntax-regex-maker gdscript-keywords)
|
||||
1
|
||||
font-lock-keyword-face)
|
||||
(,(gdscript-syntax-regex-maker (append gdscript-built-in-constants
|
||||
@@ -82,8 +86,6 @@
|
||||
"(")
|
||||
(1 font-lock-function-name-face))))
|
||||
|
||||
(defvar gdscript-syntax-table (make-syntax-table))
|
||||
|
||||
(defun gdscript-syntax-context (type &optional syntax-ppss)
|
||||
"Return non-nil if point is on TYPE using SYNTAX-PPSS.
|
||||
TYPE can be `comment', `string' or `paren'. It returns the start
|
||||
|
||||
Reference in New Issue
Block a user