~yacinechaouche/mergou/trunk

« back to all changes in this revision

Viewing changes to reader.py

  • Committer: yacinechaouche at yahoo
  • Date: 2013-11-13 23:52:01 UTC
  • Revision ID: yacinechaouche@yahoo.com-20131113235201-p0dlv59s2ox5gcjw
Another bug in reader that discounted (but printed) single line docstrings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
        
22
22
        """
23
23
        docstring = False
 
24
        nquotes   = 0
24
25
        for line in code :
25
26
            _line = line.strip()
26
27
            utils.debug("[DEBUG Reader.process]",_line,len(_line))
30
31
            elif (not _line):
31
32
                utils.debug("[DEBUG Reader.process] BLANK LINE")
32
33
                continue
33
 
            elif  _line.count('"""') == 1:
34
 
                utils.debug("[DEBUG Reader.process] Begining or end of ML docstring")                
35
 
                docstring = not docstring               
36
 
                continue           
 
34
            nquotes = _line.count('"""')
 
35
            if nquotes :
 
36
                utils.debug("[DEBUG Reader.process] Begining or end of ML docstring")
 
37
                docstring = (not docstring, docstring)[nquotes == 2]
 
38
                continue
37
39
            if not docstring:
38
40
                self._parse(line)
39
41