parent
e0fd436877
commit
d2f4ba2d64
|
@ -92,7 +92,7 @@ MacroGrammar.rules.extend(CGrammar.rules)
|
|||
class CTabber2(tab.StackTabber2):
|
||||
open_tokens = {'delimiter': {'{': '}', '(': ')', '[': ']'}}
|
||||
close_tokens = {'delimiter': {'}': '{', ')': '(', ']': '['}}
|
||||
control_tokens = {'c.keyword': {'if': 1, 'else': 1, 'while': 1, 'do': 1, 'for': 1}}
|
||||
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}}
|
||||
|
|
4
tab.py
4
tab.py
|
@ -354,10 +354,8 @@ class StackTabber2(Tabber):
|
|||
self.record[y] = tuple(self.stack)
|
||||
|
||||
def _is_indent(self, t):
|
||||
#return t.name == 'spaces'
|
||||
return t.name in self.is_indent_tokens
|
||||
def _is_ignored(self, t):
|
||||
#return t.name in ('spaces', 'eol', 'comment')
|
||||
return t.name in self.is_ignored_tokens
|
||||
|
||||
def _is_close_token(self, t):
|
||||
|
@ -461,4 +459,4 @@ class StackTabber2(Tabber):
|
|||
# handle control keywords
|
||||
if i == start:
|
||||
self._save_curr_level()
|
||||
self._append_unless('control', name, self._get_next_level(), y)
|
||||
self._append('control', name, self._get_next_level(), y)
|
||||
|
|
Loading…
Reference in New Issue