ref: de0d00556e92b41cc5ee976e566aa384108c573e
parent: 8f7d17bfe336f1fa0ea0fa335f974993420c6333
author: Werner Lemberg <[email protected]>
date: Wed May 28 17:51:15 EDT 2008
* src/tools/docmaker/sources.py (SourceBlock::__init__): While looking for markup tags, return immediately as soon a single one is found.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2008-05-28 Werner Lemberg <[email protected]>
+ * src/tools/docmaker/sources.py (SourceBlock::__init__): While
+ looking for markup tags, return immediately as soon a single one is
+ found.
+
+2008-05-28 Werner Lemberg <[email protected]>
+
* src/truetype/ttinterp.c (Ins_MD): The MD instruction also uses
original, unscaled input values. Confirmed by Greg Hitchcock from
Microsoft.
--- a/src/tools/docmaker/sources.py
+++ b/src/tools/docmaker/sources.py
@@ -58,9 +58,9 @@
#
start = r'''
- \s* # any number of whitespace
- /\*{2,}/ # followed by '/' and at least two asterisks then '/'
- \s*$ # eventually followed by whitespace
+ \s* # any number of whitespace
+ /\*{2,}/ # followed by '/' and at least two asterisks then '/'
+ \s*$ # probably followed by whitespace
'''
column = r'''
@@ -68,7 +68,7 @@
/\*{1} # followed by '/' and precisely one asterisk
([^*].*) # followed by anything (group 1)
\*{1}/ # followed by one asterisk and a '/'
- \s*$ # eventually followed by whitespace
+ \s*$ # probably followed by whitespace
'''
re_source_block_format1 = SourceBlockFormat( 1, start, column, start )
@@ -89,18 +89,18 @@
start = r'''
\s* # any number of whitespace
/\*{2,} # followed by '/' and at least two asterisks
- \s*$ # eventually followed by whitespace
+ \s*$ # probably followed by whitespace
'''
column = r'''
- \s* # any number of whitespace
- \*{1}(?!/) # followed by precisely one asterisk not followed by `/'
- (.*) # then anything (group1)
+ \s* # any number of whitespace
+ \*{1}(?!/) # followed by precisely one asterisk not followed by `/'
+ (.*) # then anything (group1)
'''
end = r'''
- \s* # any number of whitespace
- \*+/ # followed by at least one asterisk, then '/'
+ \s* # any number of whitespace
+ \*+/ # followed by at least one asterisk, then '/'
'''
re_source_block_format2 = SourceBlockFormat( 2, start, column, end )
@@ -228,7 +228,7 @@
for tag in re_markup_tags:
if tag.match( l ):
self.content = lines
- return
+ return
def location( self ):
return "(" + self.filename + ":" + repr( self.lineno ) + ")"
@@ -282,8 +282,7 @@
self.format = None
def parse_file( self, filename ):
- """parse a C source file, and adds its blocks to the processor's list"""
-
+ """parse a C source file, and add its blocks to the processor's list"""
self.reset()
self.filename = filename
@@ -321,17 +320,17 @@
self.add_block_lines()
def process_normal_line( self, line ):
- """process a normal line and check if it's the start of a new block"""
+ """process a normal line and check whether it is the start of a new block"""
for f in re_source_block_formats:
- if f.start.match( line ):
- self.add_block_lines()
- self.format = f
- self.lineno = fileinput.filelineno()
+ if f.start.match( line ):
+ self.add_block_lines()
+ self.format = f
+ self.lineno = fileinput.filelineno()
self.lines.append( line )
def add_block_lines( self ):
- """add the current accumulated lines, and create a new block"""
+ """add the current accumulated lines and create a new block"""
if self.lines != []:
block = SourceBlock( self, self.filename, self.lineno, self.lines )