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', '//.*$'),
|
2021-12-28 22:47:37 -05:00
|
|
|
RegionRule('conf.string', "'", StringGrammar1, "'"),
|
|
|
|
RegionRule('conf.string', '"', StringGrammar2, '"'),
|
2009-04-05 22:30:19 -04:00
|
|
|
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
|