2008-04-07 16:09:18 -04:00
|
|
|
import color, mode
|
|
|
|
from lex import Grammar, PatternRule, RegionRule
|
|
|
|
from mode.sh import StringGrammar
|
|
|
|
|
|
|
|
class ConfGrammar(Grammar):
|
|
|
|
rules = [
|
|
|
|
PatternRule(r'comment', r'#.*$'),
|
2008-05-03 14:40:31 -04:00
|
|
|
PatternRule(r'comment', r'//.*$'),
|
2008-04-07 16:09:18 -04:00
|
|
|
RegionRule(r'string', r"'", Grammar, r"'"),
|
|
|
|
RegionRule(r'string', r'"', StringGrammar, r'"'),
|
|
|
|
]
|
|
|
|
|
|
|
|
class Conf(mode.Fundamental):
|
|
|
|
modename = 'conf'
|
|
|
|
extensions = ['.conf', '.cfg', '.cnf', '.config']
|
|
|
|
grammar = ConfGrammar
|
|
|
|
colors = {}
|
|
|
|
|
|
|
|
install = Conf.install
|