branch : pmacs2
This commit is contained in:
moculus 2007-08-15 22:37:49 +00:00
parent 90c0c654dc
commit 417ddb8bac
2 changed files with 14 additions and 3 deletions

View File

@ -14,9 +14,20 @@ class LispGrammar(Grammar):
]
class LispTabber(tab2.StackTabber):
wsre = regex.whitespace
wst = ('spaces', 'null', 'eol',)
sre = regex.space
st = ('spaces', 'null',)
def _handle_open_token(self, currlvl, y, i):
level = self.get_curr_level() + 4
self._append(self.get_token(y, i).string, level)
token = self.get_token(y, i)
rtoken = self.get_next_right_token(y, i)
if rtoken is not None and rtoken.string != '(':
rtoken = self.get_next_right_token(y, i + 1)
if rtoken is None:
level = self.get_curr_level() + 4
else:
level = rtoken.x
self._append(token.string, level)
return currlvl
class Lisp(mode2.Fundamental):

View File

@ -14,7 +14,7 @@ class SchemeGrammar(Grammar):
PatternRule(r'abbrev', r"'|`|,\@|,"),
# from r5rs
PatternRule(r'keyword', r'(?:=>|unquote-splicing|unquote|syntax-rules|set!|quote|quasiquote|or|map|loop|letrec-syntax|letrec|let-syntax|let\*|let|lambda|if|for-each|else|dynamic-wind|do|delay|define-syntax|define-macro|define|cond|case|call-with-output-file|call-with-input-file|call-with-current-continuation|begin|and)(?![^ )])'),
PatternRule(r'keyword', r'(?:=>|unquote-splicing|unquote|syntax-rules|set!|quote|quasiquote|or|map|loop|letrec-syntax|letrec|let-syntax|let\*|let|lambda|if|for-each|else|dynamic-wind|do|delay|define-syntax|define-macro|define|cond|case|call-with-output-file|call-with-input-file|call-with-current-continuation|begin|and)(?![^\n )])'),
PatternRule(r'boolean', r'#[tf]'),
PatternRule(r'char', r'#\\space|#\\newline|#\\.'),