2008-04-07 16:09:18 -04:00
|
|
|
import color, mode
|
|
|
|
from lex import Grammar, PatternRule, RegionRule
|
2008-10-01 16:58:43 -04:00
|
|
|
from mode.python import StringGrammar1, StringGrammar2
|
2008-04-07 16:09:18 -04:00
|
|
|
|
|
|
|
class ConfGrammar(Grammar):
|
|
|
|
rules = [
|
|
|
|
PatternRule(r'comment', r'#.*$'),
|
2008-05-03 14:40:31 -04:00
|
|
|
PatternRule(r'comment', r'//.*$'),
|
2008-10-01 16:58:43 -04:00
|
|
|
RegionRule(r'string', r"'", StringGrammar1, r"'"),
|
|
|
|
RegionRule(r'string', r'"', StringGrammar2, r'"'),
|
2008-04-07 16:09:18 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
class Conf(mode.Fundamental):
|
2009-03-17 15:24:10 -04:00
|
|
|
name = 'conf'
|
2008-04-07 16:09:18 -04:00
|
|
|
extensions = ['.conf', '.cfg', '.cnf', '.config']
|
|
|
|
grammar = ConfGrammar
|
|
|
|
colors = {}
|
|
|
|
|
|
|
|
install = Conf.install
|