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-03-29 20:50:27 -04:00
|
|
|
PatternRule('comment', '#.*$'),
|
|
|
|
PatternRule('comment', '//.*$'),
|
|
|
|
RegionRule('string', "'", StringGrammar1, "'"),
|
|
|
|
RegionRule('string', '"', StringGrammar2, '"'),
|
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
|