20 lines
557 B
Python
20 lines
557 B
Python
import color, mode
|
|
from lex import Grammar, PatternRule, RegionRule
|
|
from mode.python import StringGrammar1, StringGrammar2
|
|
|
|
class ConfGrammar(Grammar):
|
|
rules = [
|
|
PatternRule(r'comment', r'#.*$'),
|
|
PatternRule(r'comment', r'//.*$'),
|
|
RegionRule(r'string', r"'", StringGrammar1, r"'"),
|
|
RegionRule(r'string', r'"', StringGrammar2, r'"'),
|
|
]
|
|
|
|
class Conf(mode.Fundamental):
|
|
name = 'conf'
|
|
extensions = ['.conf', '.cfg', '.cnf', '.config']
|
|
grammar = ConfGrammar
|
|
colors = {}
|
|
|
|
install = Conf.install
|