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