import mode
from lex import Grammar, PatternRule, RegionRule, PatternGroupRule

class AboutGrammar(Grammar):
    rules = [
        PatternRule(r'stars', r'\*+'),
        PatternRule(r'equals', r'=+'),
        PatternRule(r'pmacs', r'pmacs'),
        PatternRule(r'author', r'Erik Osheim'),
        PatternRule(r'copyright', r'\(c\) 2005-2007'),
        PatternRule(r'license', r'GNU General Public License v2'),
        PatternRule(r'binding', r'C-c M-h'),
        PatternRule(r'command', r'\(show-bindings-buffer\)'),
    ]

class About(mode.Fundamental):
    modename = 'About'
    grammar = AboutGrammar()
    colors = {
        'stars':     ('yellow', 'default'),
        'equals':    ('red', 'default'),
        'pmacs':     ('cyan', 'default'),
        'author':    ('cyan', 'default'),
        'copyright': ('blue', 'default'),
        'license':   ('cyan', 'default'),
        'binding':   ('cyan', 'default'),
        'command':   ('blue', 'default'),
    }

install = About.install