fixed some minor perl indenting issues
--HG-- branch : pmacs2
This commit is contained in:
parent
9d38d5d45e
commit
34571d027d
2
BUGS
2
BUGS
|
@ -1,7 +1,7 @@
|
|||
=== OUSTANDING BUGS ===
|
||||
|
||||
2008/06/25:
|
||||
* when the "first" point is on a wrapping line bad things happen.
|
||||
* occasionally when the "first" point is wrapped things get confused.
|
||||
* the "last visible" calculation doesn't handle long lines correctly.
|
||||
this affects page-up/page-down/etc.
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ class PerlTabber2(StackTabber2):
|
|||
close_tokens = {'delimiter': {'}': '{', ')': '(', ']': '['}}
|
||||
end_at_eof = False
|
||||
end_at_tokens = {'delimiter': {';': 1}}
|
||||
nocontinue_tokens = {'delimiter': {';': 1, ',': 1},
|
||||
nocontinue_tokens = {'delimiter': {';': 1, ',': 1, '}': 1},
|
||||
'heredoc.end': 1, 'evaldoc.end': 1, 'pod.end': 1}
|
||||
start_free_tokens = {'string.start': 1, 'pod.start': 1, 'heredoc.start': 1,
|
||||
'evaldoc.start': 1}
|
||||
|
|
18
tab.py
18
tab.py
|
@ -374,6 +374,18 @@ class StackTabber2(Tabber):
|
|||
if i == 0:
|
||||
self._save_curr_level()
|
||||
|
||||
# add implicit continuation XYZYXYZY
|
||||
name, s = t.fqname(), t.string
|
||||
top = self._peek()
|
||||
if (i + start == end and
|
||||
(not top or top.name in self.scope_tokens.get(top.type_, {}))):
|
||||
d = self.nocontinue_tokens.get(name)
|
||||
if d is None or d != 1 and s not in d:
|
||||
if s == '}':
|
||||
raise Exception, "foog: %r %r %r" % (s not in d, s, d)
|
||||
self._append_unless('continue', name, self._get_next_level())
|
||||
#XYZYZYXYXY
|
||||
|
||||
def _is_open_token(self, t):
|
||||
return (t.name == 'delimiter' and
|
||||
t.string in self.open_tokens['delimiter'])
|
||||
|
@ -407,10 +419,6 @@ class StackTabber2(Tabber):
|
|||
self._pop('macro')
|
||||
return
|
||||
|
||||
#d = self.end_at_tokens.get(name, {})
|
||||
#if d:
|
||||
# raise Exception, (name, s, d, d.get(s), d[s])
|
||||
|
||||
# remove implicit continuation
|
||||
if self.end_at_eof and i + start == end:
|
||||
self._pop_while('continue', 'control')
|
||||
|
@ -419,7 +427,7 @@ class StackTabber2(Tabber):
|
|||
|
||||
# add implicit continuation
|
||||
top = self._peek()
|
||||
if i + start == end and top and top.name in self.scope_tokens.get(top.type_, {}):
|
||||
if i + start == end and (top and top.name in self.scope_tokens.get(top.type_, {}) or not top):
|
||||
if self.continue_tokens:
|
||||
if s in self.continue_tokens.get(name, {}):
|
||||
self._append_unless('continue', name, self._get_next_level())
|
||||
|
|
Loading…
Reference in New Issue