pmacs3/mode/conf.py

20 lines
552 B
Python
Raw 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 = [
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):
name = 'conf'
2008-04-07 16:09:18 -04:00
extensions = ['.conf', '.cfg', '.cnf', '.config']
grammar = ConfGrammar
colors = {}
install = Conf.install