pmacs3/mode/conf.py

21 lines
631 B
Python
Raw Permalink Normal View History

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
from mode.python import StringGrammar1, StringGrammar2
2008-04-07 16:09:18 -04:00
class ConfGrammar(Grammar):
rules = [
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):
name = 'conf'
2008-04-07 16:09:18 -04:00
extensions = ['.conf', '.cfg', '.cnf', '.config']
grammar = ConfGrammar
colors = {}
install = Conf.install