From 7a3d761c3502e98549f2e44f9e194ed698f209be Mon Sep 17 00:00:00 2001 From: moculus Date: Thu, 19 Jun 2008 20:20:07 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- mode/bds.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mode/bds.py b/mode/bds.py index eeaa937..5f5193d 100644 --- a/mode/bds.py +++ b/mode/bds.py @@ -4,21 +4,23 @@ from lex import Grammar, PatternRule, RegionRule, Grammar from method import Method from mode.perl import PerlGrammar from mode.xml import TagGrammar -from mode.perl import StringGrammar +from mode.perl import StringGrammar, StrictStringGrammar class BDSGrammar(Grammar): rules = [ RegionRule(r'comment', r''), RegionRule(r'xml_tag', r'< */?', TagGrammar, r'/?>'), PatternRule(r'delimiter', r'[\[\]\{\}\(\),\?:]'), - PatternRule(r'bds_derived', r'(?:FM|CD|FS|FM|TA)[0-9]{3}-[0-9]{3}-[0-9]{3}'), + PatternRule(r'bds_alias', r'[a-z0-9]+(?=:)'), + PatternRule(r'keyword', r'if|else|elsif|unless'), + PatternRule(r'bds_derived', r'(?:CN|FM|CD|IS|FS|FM|TA)[0-9]{3}-[0-9]{3}-[0-9]{3}'), PatternRule(r'bds_question', r'GQ[0-9]{3}-[0-9]{3}-[0-9]{3}:MQ[0-9]{3}-[0-9]{3}-[0-9]{3}'), PatternRule(r'bds_function', r'[A-Z_][A-Z0-9_]+(?= *\()'), PatternRule(r'bds_perlfunc', r'[a-zA-Z_][a-zA-Z0-9_]+(?= *\()'), PatternRule(r'bds_misquoted', r"'[A-Z]{2}[0-9]{3}-[0-9]{3}-[0-9]{3}(?::[A-Z]{2}[0-9]{3}-[0-9]{3}-[0-9]{3})?'"), PatternRule(r'bds_misquoted', r'"[A-Z]{2}[0-9]{3}-[0-9]{3}-[0-9]{3}(?::[A-Z]{2}[0-9]{3}-[0-9]{3}-[0-9]{3})?"'), RegionRule(r'string', '"', StringGrammar, '"'), - RegionRule(r'string', "'", Grammar, "'"), + RegionRule(r'string', "'", StrictStringGrammar, "'"), PatternRule(r'bds_operator', r'(?:>=|<=|>|<|==|&&|\|\||eq|ne)'), ] @@ -47,6 +49,7 @@ class BDS(mode.Fundamental): closetokens = ('delimiter',) closetags = {')': '(', ']': '[', '}': '{'} colors = { + 'bds_alias': ('yellow', 'default', 'bold'), 'bds_derived': ('yellow', 'default', 'bold'), 'bds_question': ('yellow', 'default', 'bold'), 'bds_misquoted': ('yellow', 'red', 'bold'),