parent
435bd37405
commit
57056968da
|
@ -145,6 +145,7 @@ class Application(object):
|
|||
'.rst': 'rst',
|
||||
'.java': 'java',
|
||||
'.el': 'elisp',
|
||||
'.scm': 'scheme',
|
||||
}
|
||||
self.mode_detection = {
|
||||
'python': 'python',
|
||||
|
|
|
@ -12,13 +12,13 @@ class StringGrammar(Grammar):
|
|||
class SchemeGrammar(Grammar):
|
||||
rules = [
|
||||
PatternRule(r'comment', r';.*$'),
|
||||
PatternRule(r'delimiter', r'\(|\)'),
|
||||
PatternRule(r'delimiter', r'[()]'),
|
||||
RegionRule(r'string', r'"', StringGrammar, r'"'),
|
||||
PatternRule(r'spaces', r' +'),
|
||||
PatternRule(r'eol', r'\n'),
|
||||
PatternRule(r'abbrev', r"'|`|,\@|,"),
|
||||
|
||||
PatternRule(r'keyword', r'define-syntax|define-macro|syntax-rules'),
|
||||
PatternRule(r'keyword', r'define-syntax|define-macro|syntax-rules|let-syntax|letrec-syntax'),
|
||||
PatternRule(r'keyword', r'quote|lambda|if|set\!|begin|cond|and|or|case|let\*|letrec|let|do|delay|quasiquote|else|=>|define|unquote-splicing|unquote|loop'),
|
||||
|
||||
# builtin predicates, mutators, and general procedures
|
||||
|
@ -36,15 +36,19 @@ class SchemeGrammar(Grammar):
|
|||
]
|
||||
|
||||
class SchemeTabber(tab2.StackTabber):
|
||||
pass
|
||||
def _handle_open_token(self, currlvl, y, i):
|
||||
level = self.get_curr_level() + 4
|
||||
token = self.get_token(y, i)
|
||||
self._append(token.string, level)
|
||||
return currlvl
|
||||
|
||||
class Scheme(mode2.Fundamental):
|
||||
tabbercls = SchemeTabber
|
||||
grammar = SchemeGrammar
|
||||
opentokens = ('delimiter',)
|
||||
opentags = {'(': ')',},
|
||||
opentags = {'(': ')'}
|
||||
closetokens = ('delimiter',)
|
||||
closetags = {')': '(',},
|
||||
closetags = {')': '('}
|
||||
colors = {
|
||||
'comment': ('red', 'default'),
|
||||
|
||||
|
|
Loading…
Reference in New Issue