parent
1856f888aa
commit
2078918a3c
|
@ -95,7 +95,11 @@ MacroGrammar.rules.extend(CGrammar.rules)
|
||||||
class CTabber2(tab.StackTabber2):
|
class CTabber2(tab.StackTabber2):
|
||||||
open_tokens = {'delimiter': {'{': '}', '(': ')', '[': ']'}}
|
open_tokens = {'delimiter': {'{': '}', '(': ')', '[': ']'}}
|
||||||
close_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_eof = False
|
||||||
end_at_tokens = {'delimiter': {';': 1}}
|
end_at_tokens = {'delimiter': {';': 1}}
|
||||||
nocontinue_tokens = {'delimiter': {';': 1, ',': 1}}
|
nocontinue_tokens = {'delimiter': {';': 1, ',': 1}}
|
||||||
|
|
2
tab.py
2
tab.py
|
@ -473,4 +473,4 @@ class StackTabber2(Tabber):
|
||||||
if i == start:
|
if i == start:
|
||||||
self._save_curr_level()
|
self._save_curr_level()
|
||||||
self._pop_while('continue');
|
self._pop_while('continue');
|
||||||
self._append('control', name, self._get_next_level(), y)
|
self._append_unless('control', name, self._get_next_level(), y)
|
||||||
|
|
Loading…
Reference in New Issue