pmacs3/mode/conf.py

20 lines
557 B
Python
Raw Normal View History

2008-04-07 16:09:18 -04:00
import color, mode
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(r'comment', r'#.*$'),
PatternRule(r'comment', r'//.*$'),
RegionRule(r'string', r"'", StringGrammar1, r"'"),
RegionRule(r'string', r'"', StringGrammar2, r'"'),
2008-04-07 16:09:18 -04:00
]
class Conf(mode.Fundamental):
name = 'conf'
2008-04-07 16:09:18 -04:00
extensions = ['.conf', '.cfg', '.cnf', '.config']
grammar = ConfGrammar
colors = {}
install = Conf.install