diff --git a/src/irpf90_indent.py b/src/irpf90_indent.py index bda0dcb..eb042da 100755 --- a/src/irpf90_indent.py +++ b/src/irpf90_indent.py @@ -17,7 +17,7 @@ class Grep(object): def end_program(self,string): 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): return re.match(self.re_begin_subroutine,string) is not None diff --git a/src/subroutine.py b/src/subroutine.py index 5003310..01c7f94 100644 --- a/src/subroutine.py +++ b/src/subroutine.py @@ -59,7 +59,7 @@ class Sub(object): if '_doc' not in self.__dict__: def f(l): return 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 == []: error.warn(None,"Subroutine %s is not documented"%(self.name)) return self._doc diff --git a/src/variable.py b/src/variable.py index b8418d5..c8f452d 100644 --- a/src/variable.py +++ b/src/variable.py @@ -106,7 +106,7 @@ class Variable(object): if '_doc' not in self.__dict__: text = self.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 == []: error.warn(None,"Variable %s is not documented"%(self.name)) return self._doc