2009-03-29 20:50:27 -04:00
|
|
|
from mode import Fundamental
|
2008-04-07 16:09:18 -04:00
|
|
|
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 = [
|
2009-04-05 22:30:19 -04:00
|
|
|
PatternRule('conf.comment', '#.*$'),
|
|
|
|
PatternRule('conf.comment', '//.*$'),
|
|
|
|
RegionRule('conf.string', "'", StringGrammar1, "'"),
|
|
|
|
RegionRule('conf.string', '"', StringGrammar2, '"'),
|
|
|
|
PatternRule('conf.data', r'(?:[^\'"#/]|/(?!/))+'),
|
2008-04-07 16:09:18 -04:00
|
|
|
]
|
|
|
|
|
2009-03-29 20:50:27 -04:00
|
|
|
class Conf(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
|