preparation for CTabber fix

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2009-08-27 11:27:09 -04:00
parent 1856f888aa
commit 2078918a3c
2 changed files with 6 additions and 2 deletions

View File

@ -95,7 +95,11 @@ MacroGrammar.rules.extend(CGrammar.rules)
class CTabber2(tab.StackTabber2):
open_tokens = {'delimiter': {'{': '}', '(': ')', '[': ']'}}
close_tokens = {'delimiter': {'}': '{', ')': '(', ']': '['}}
control_tokens = {'c.builtin': {'if': 1, 'else': 1, 'while': 1, 'do': 1, 'for': 1}}
# NOTE: we actually need at least two kinds of control tokens:
# an if/else class, and a do/for/while class. this is so we can get
# indenting support for else working correctly.
control_tokens = {'c.builtin': {'if': 1, 'else': 1, 'while': 1,
'do': 1, 'for': 1}}
end_at_eof = False
end_at_tokens = {'delimiter': {';': 1}}
nocontinue_tokens = {'delimiter': {';': 1, ',': 1}}

2
tab.py
View File

@ -473,4 +473,4 @@ class StackTabber2(Tabber):
if i == start:
self._save_curr_level()
self._pop_while('continue');
self._append('control', name, self._get_next_level(), y)
self._append_unless('control', name, self._get_next_level(), y)