Commit 590344cde09f6b9645e98c5bbe6e5960c34449f1

Werner Lemberg 2012-08-29T09:16:56

[docmaker] Allow `-' in tags and identifiers. * src/tools/docmaker/content.py (re_identifier), src/tools/docmaker/sources.py (re_markup_tag1, re_markup_tag2, re_crossref): Add `-' in patterns.

diff --git a/ChangeLog b/ChangeLog
index bb715df..3941683 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-08-29  Werner Lemberg  <wl@gnu.org>
+
+	[docmaker] Allow `-' in tags and identifiers.
+
+	* src/tools/docmaker/content.py (re_identifier),
+	src/tools/docmaker/sources.py (re_markup_tag1, re_markup_tag2,
+	re_crossref): Add `-' in patterns.
+
 2012-08-27  Werner Lemberg  <wl@gnu.org>
 
 	[FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
diff --git a/src/tools/docmaker/content.py b/src/tools/docmaker/content.py
index b398955..26087f7 100644
--- a/src/tools/docmaker/content.py
+++ b/src/tools/docmaker/content.py
@@ -1,4 +1,4 @@
-#  Content (c) 2002, 2004, 2006, 2007, 2008, 2009
+#  Content (c) 2002, 2004, 2006-2009, 2012
 #    David Turner <david@freetype.org>
 #
 #  This file contains routines used to parse the content of documentation
@@ -32,7 +32,7 @@ re_code_end   = re.compile( r"(\s*)}\s*$" )
 # this regular expression is used to isolate identifiers from
 # other text
 #
-re_identifier = re.compile( r'(\w*)' )
+re_identifier = re.compile( r'((?:\w|-)*)' )
 
 
 # we collect macros ending in `_H'; while outputting the object data, we use
diff --git a/src/tools/docmaker/sources.py b/src/tools/docmaker/sources.py
index 7b68c07..490ba25 100644
--- a/src/tools/docmaker/sources.py
+++ b/src/tools/docmaker/sources.py
@@ -1,4 +1,4 @@
-#  Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009
+#  Sources (c) 2002-2004, 2006-2009, 2012
 #    David Turner <david@freetype.org>
 #
 #
@@ -120,8 +120,8 @@ re_source_block_formats = [re_source_block_format1, re_source_block_format2]
 #
 # notice how each markup tag _must_ begin a new line
 #
-re_markup_tag1 = re.compile( r'''\s*<(\w*)>''' )  # <xxxx> format
-re_markup_tag2 = re.compile( r'''\s*@(\w*):''' )  # @xxxx: format
+re_markup_tag1 = re.compile( r'''\s*<((?:\w|-)*)>''' )  # <xxxx> format
+re_markup_tag2 = re.compile( r'''\s*@((?:\w|-)*):''' )  # @xxxx: format
 
 #
 # the list of supported markup tags, we could add new ones relatively
@@ -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|-)*)(.*)' )
 
 #
 # used to detect italic and bold styles in paragraph text