mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-12-22 04:13:33 +01:00
support for recursive subroutines in indent
This commit is contained in:
parent
67e6def151
commit
051e65ebf9
@ -17,7 +17,7 @@ class Grep(object):
|
|||||||
def end_program(self,string):
|
def end_program(self,string):
|
||||||
return re.match(self.re_end_program,string) is not None
|
return re.match(self.re_end_program,string) is not None
|
||||||
|
|
||||||
re_begin_subroutine = re.compile(r"^\s*subroutine\s",flags=re.I)
|
re_begin_subroutine = re.compile(r"^\s*(recursive)?\s*subroutine\s",flags=re.I)
|
||||||
def begin_subroutine(self,string):
|
def begin_subroutine(self,string):
|
||||||
return re.match(self.re_begin_subroutine,string) is not None
|
return re.match(self.re_begin_subroutine,string) is not None
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ class Sub(object):
|
|||||||
if '_doc' not in self.__dict__:
|
if '_doc' not in self.__dict__:
|
||||||
def f(l): return
|
def f(l): return
|
||||||
buffer = filter(lambda l:type(l) == Doc, self.text)
|
buffer = filter(lambda l:type(l) == Doc, self.text)
|
||||||
self._doc = map(lambda l: l.text[1:], buffer)
|
self._doc = map(lambda l: l.text.lstrip()[1:], buffer)
|
||||||
if buffer == []:
|
if buffer == []:
|
||||||
error.warn(None,"Subroutine %s is not documented"%(self.name))
|
error.warn(None,"Subroutine %s is not documented"%(self.name))
|
||||||
return self._doc
|
return self._doc
|
||||||
|
@ -106,7 +106,7 @@ class Variable(object):
|
|||||||
if '_doc' not in self.__dict__:
|
if '_doc' not in self.__dict__:
|
||||||
text = self.text
|
text = self.text
|
||||||
buffer = filter(lambda l:type(l) == Doc, text)
|
buffer = filter(lambda l:type(l) == Doc, text)
|
||||||
self._doc = map(lambda l: l.text[1:], buffer)
|
self._doc = map(lambda l: l.text.lstrip()[1:], buffer)
|
||||||
if buffer == []:
|
if buffer == []:
|
||||||
error.warn(None,"Variable %s is not documented"%(self.name))
|
error.warn(None,"Variable %s is not documented"%(self.name))
|
||||||
return self._doc
|
return self._doc
|
||||||
|
Loading…
Reference in New Issue
Block a user