Permalink
Browse files

Replaced .sub calls with .match calls to fix ubuntu issue

  • Loading branch information...
1 parent fd058df commit 0eff67782ced3c19168dd747091fe46bdfa035cf Adam Moore committed Sep 8, 2008
Showing with 23 additions and 8 deletions.
  1. +23 −8 bin/yuidoc_parse.py
View
@@ -266,19 +266,27 @@ def isTag(token):
return token.strip()[:1] == "@"
# extracts compound comment blocks .. like {type}
- def compound_sub(match):
- if match.group(4):
- return "", match.group(4) + match.group(5)
- else:
- return match.group(2), (match.group(1) + match.group(3)).strip()
+ # def compound_sub(match):
+ # if match.group(4):
+ # return "", match.group(4) + match.group(5)
+ # else:
+ # return match.group(2), (match.group(1) + match.group(3)).strip()
def parseParams(tokenMap, dict, srctag=const.PARAM, desttag=const.PARAMS):
if srctag in tokenMap:
# params must be an array because they need to stay in order
if not desttag in dict: dict[desttag] = []
for i in tokenMap[srctag]:
try:
- type, description = self.compound_pat.sub(compound_sub, i)
+ # type, description = self.compound_pat.sub(compound_sub, i)
+
+ match = self.compound_pat.match(i)
+
+ if match.group(4):
+ type, description = "", match.group(4) + match.group(5)
+ else:
+ type, description = match.group(2), (match.group(1) + match.group(3)).strip()
+
except:
log.error("\nError, a parameter could not be parsed:\n\n %s\n\n %s\n" %(i, pprint.pformat(tokenMap)))
sys.exit()
@@ -302,7 +310,14 @@ def parseReturn(tokenMap, dict):
if const.RETURN in tokenMap:
ret = tokenMap[const.RETURN][0]
try:
- type, description = self.compound_pat.sub(compound_sub, ret)
+ # type, description = self.compound_pat.sub(compound_sub, ret)
+
+ match = self.compound_pat.match(ret)
+
+ if match.group(4):
+ type, description = "", match.group(4) + match.group(5)
+ else:
+ type, description = match.group(2), (match.group(1) + match.group(3)).strip()
except:
log.error("\nError, a return statement could not be parsed:\n\n %s\n\n %s\n" %(ret, pprint.pformat(tokenMap)))
sys.exit()
@@ -508,7 +523,7 @@ def parseModule(tokenMap):
self.subModName = None
- log.warn("Here");
+ # log.warn("Here");
if self.subModName:
self.data[const.MODULES][self.currentModule][const.SUBDATA][self.subModName][const.NAME] = longName

0 comments on commit 0eff677

Please sign in to comment.