From 3afaa5f793b2b84a4491bb327096fb3e990f1c75 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Tue, 29 Sep 2009 22:57:21 +0930 Subject: [PATCH] Update syntax table. * wesnoth-mode.el (wesnoth-syntax-table): Updated. (wesnoth-syntactic-keywords): Separated elements to better indicate syntax. --- wesnoth-mode.el | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/wesnoth-mode.el b/wesnoth-mode.el index 307b9ca..cb649b6 100644 --- a/wesnoth-mode.el +++ b/wesnoth-mode.el @@ -326,24 +326,27 @@ is recommended to set this to non-nil." (defvar wesnoth-syntax-table (let ((wesnoth-syntax-table (make-syntax-table))) - (modify-syntax-entry ?# "<" wesnoth-syntax-table) + (modify-syntax-entry ?\# "<" wesnoth-syntax-table) (modify-syntax-entry ?\" "\"" wesnoth-syntax-table) - (modify-syntax-entry ?= "." wesnoth-syntax-table) - (modify-syntax-entry ?| "w" wesnoth-syntax-table) - (modify-syntax-entry ?_ "_" wesnoth-syntax-table) - (modify-syntax-entry ?- "_" wesnoth-syntax-table) - (modify-syntax-entry ?. "_" wesnoth-syntax-table) + (modify-syntax-entry ?\= "." wesnoth-syntax-table) + (modify-syntax-entry ?\| "w" wesnoth-syntax-table) + (modify-syntax-entry ?\_ "_" wesnoth-syntax-table) + (modify-syntax-entry ?\[ "(" wesnoth-syntax-table) + (modify-syntax-entry ?\] ")" wesnoth-syntax-table) + (modify-syntax-entry ?\/ "." wesnoth-syntax-table) + (modify-syntax-entry ?\- "." wesnoth-syntax-table) + (modify-syntax-entry ?\. "_" wesnoth-syntax-table) (modify-syntax-entry ?\n ">" wesnoth-syntax-table) (modify-syntax-entry ?\r ">" wesnoth-syntax-table) wesnoth-syntax-table) "Syntax table for `wesnoth-mode'.") -;; Prevents automatic syntax-highlighting of elements which might be -;; pre-processor statements. +;; Prevent automatic font-locking of elements which might be pre-processor +;; statements. (defvar wesnoth-syntactic-keywords - (list - '("\\([\t ]*\\(#\\(?:define \\|e\\(?:lse\\|nd\\(?:\\(?:de\\|i\\)f\\)\\)\\|\ -\\(?:ifn?\\|un\\)def \\)\\)\\)" 1 "w")) + '(("#\\(?:define\\|if\\(?:n?def\\)\\)" 0 "(") + ("#end\\(?:\\(?:de\\|i\\)f\\)" 0 ")") + ("#\\(?:else\\|undef\\)" 0 "w")) "Syntactic keywords for preprocessor statements within `wesnoth-mode'.") (defvar wesnoth-font-lock-keywords -- 2.11.4.GIT