From c60f304fb62395cff28f273f1ec206c0c4df1492 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 22 Nov 2000 20:16:37 +0000 Subject: Improve Jed mode's ability to deal with nested braces in comments [originally from svn r811] --- misc/buttress.sl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'misc') 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); -- cgit v1.1