import color, mode from lex import Grammar, PatternRule, RegionRule from mode.python import StringGrammar1, StringGrammar2 class ConfGrammar(Grammar): rules = [ PatternRule(r'comment', r'#.*$'), PatternRule(r'comment', r'//.*$'), RegionRule(r'string', r"'", StringGrammar1, r"'"), RegionRule(r'string', r'"', StringGrammar2, r'"'), ] class Conf(mode.Fundamental): modename = 'conf' extensions = ['.conf', '.cfg', '.cnf', '.config'] grammar = ConfGrammar colors = {} install = Conf.install