summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2000-11-22 20:16:37 +0000
committerSimon Tatham <anakin@pobox.com>2000-11-22 20:16:37 +0000
commitc60f304fb62395cff28f273f1ec206c0c4df1492 (patch)
treed06dcd93daf11609da3d8c47305cf50eca5b8043 /misc
parentcd4e3150d31094b1d20f5718bb0e2b1812ec3bb3 (diff)
downloadhalibut-c60f304fb62395cff28f273f1ec206c0c4df1492.zip
halibut-c60f304fb62395cff28f273f1ec206c0c4df1492.tar.gz
halibut-c60f304fb62395cff28f273f1ec206c0c4df1492.tar.bz2
halibut-c60f304fb62395cff28f273f1ec206c0c4df1492.tar.xz
Improve Jed mode's ability to deal with nested braces in comments
[originally from svn r811]
Diffstat (limited to 'misc')
-rw-r--r--misc/buttress.sl8
1 files changed, 8 insertions, 0 deletions
diff --git a/misc/buttress.sl b/misc/buttress.sl
index 1a88515..3474790 100644
--- a/misc/buttress.sl
+++ b/misc/buttress.sl
@@ -11,6 +11,14 @@ set_syntax_flags ($1, 8);
#ifdef HAS_DFA_SYNTAX
%enable_highlight_cache ("buttress.dfa", $1);
+
+% A braced comment in Buttress is \#{ ... }, where ... may contain
+% any correctly nested sequence of braces. Of course we can't match
+% that in a DFA rule, so we'll go down to a reasonable depth of 3
+% instead.
+define_highlight_rule ("\\\\#{[^{}]*({[^{}]*({[^}]*}[^{}]*)*}[^{}]*)*}",
+ "Qcomment", $1);
+
define_highlight_rule ("\\\\#.*$", "comment", $1);
define_highlight_rule ("^\\\\c([ \t].*)?$", "string", $1);
define_highlight_rule ("\\\\[\\\\{}\\-_]", "keyword0", $1);