diff options
author | marha <marha@users.sourceforge.net> | 2014-06-26 09:53:21 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-06-26 09:53:21 +0200 |
commit | 90137f4c5e30b1c6f9a262e8c853494540dad2d7 (patch) | |
tree | 7da9d06a291a853f0d17b2ee49a2d31d86a5d757 /freetype/src/tools/docmaker/sources.py | |
parent | d47db8d4713de42ccca071c9e8401fc7a213ed49 (diff) | |
parent | fba3b6d1979c1d1ad0d56d46fc2d787f111c07fb (diff) | |
download | vcxsrv-90137f4c5e30b1c6f9a262e8c853494540dad2d7.tar.gz vcxsrv-90137f4c5e30b1c6f9a262e8c853494540dad2d7.tar.bz2 vcxsrv-90137f4c5e30b1c6f9a262e8c853494540dad2d7.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
Updated to freetype 2.5.3
Diffstat (limited to 'freetype/src/tools/docmaker/sources.py')
-rw-r--r-- | freetype/src/tools/docmaker/sources.py | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/freetype/src/tools/docmaker/sources.py b/freetype/src/tools/docmaker/sources.py index 490ba2506..dab834978 100644 --- a/freetype/src/tools/docmaker/sources.py +++ b/freetype/src/tools/docmaker/sources.py @@ -1,4 +1,4 @@ -# Sources (c) 2002-2004, 2006-2009, 2012 +# Sources (c) 2002-2004, 2006-2009, 2012, 2013 # David Turner <david@freetype.org> # # @@ -132,7 +132,7 @@ re_markup_tags = [re_markup_tag1, re_markup_tag2] # # used to detect a cross-reference, after markup tags have been stripped # -re_crossref = re.compile( r'@((?:\w|-)*)(.*)' ) +re_crossref = re.compile( r'@((?:\w|-)*)(.*)' ) # @foo # # used to detect italic and bold styles in paragraph text @@ -141,6 +141,42 @@ re_italic = re.compile( r"_(\w(\w|')*)_(.*)" ) # _italic_ re_bold = re.compile( r"\*(\w(\w|')*)\*(.*)" ) # *bold* # +# this regular expression code to identify an URL has been taken from +# +# http://mail.python.org/pipermail/tutor/2002-September/017228.html +# +# (with slight modifications) +# + +urls = r'(?:https?|telnet|gopher|file|wais|ftp)' +ltrs = r'\w' +gunk = r'/#~:.?+=&%@!\-' +punc = r'.:?\-' +any = "%(ltrs)s%(gunk)s%(punc)s" % { 'ltrs' : ltrs, + 'gunk' : gunk, + 'punc' : punc } +url = r""" + ( + \b # start at word boundary + %(urls)s : # need resource and a colon + [%(any)s] +? # followed by one or more of any valid + # character, but be conservative and + # take only what you need to... + (?= # [look-ahead non-consumptive assertion] + [%(punc)s]* # either 0 or more punctuation + (?: # [non-grouping parentheses] + [^%(any)s] | $ # followed by a non-url char + # or end of the string + ) + ) + ) + """ % {'urls' : urls, + 'any' : any, + 'punc' : punc } + +re_url = re.compile( url, re.VERBOSE | re.MULTILINE ) + +# # used to detect the end of commented source lines # re_source_sep = re.compile( r'\s*/\*\s*\*/' ) |