from mode import Fundamental from point import Point from lex import Grammar, PatternRule, RegionRule, OverridePatternRule from mode.lisp import Lisp, LispTabber class StringGrammar(Grammar): rules = [ PatternRule(r'octal', r'\\[0-7]{3}'), PatternRule(r'escaped', r'\\.'), PatternRule(r'data', r'[^\\"]+'), ] class ELispGrammar(Grammar): rules = [ PatternRule(r'comment', r';.*$'), PatternRule(r'delimiter', r'[()]'), PatternRule(r'spaces', r' +'), PatternRule(r'eol', r'\n'), PatternRule(r'elisp_reserved', r'(?:t|nil)(?![^\"\' \t()])'), PatternRule(r'keyword', r'(?:while|when|unless|setq-default|setq|setcar|require|provide|or|not|mapcar|list|let\*|let|lambda|if|exists|equal|defvar|defun|defstruct|defface|defalias|count|cons|c[ad]+r|apply|and)(?![^\"\' \t()])'), PatternRule(r'elisp_symbol', r"'[a-zA-Z_][a-zA-Z0-9-_]*"), PatternRule(r'delimiter', r"'"), PatternRule(r'elisp_type', r":[a-zA-Z_][a-zA-Z0-9-_]*"), PatternRule(r'attribute', r"&[a-zA-Z_][a-zA-Z0-9-_]*"), PatternRule(r"integer", r"(?