Permalink
Browse files

More tolerant of parse order issues. duplicate module declarations do…

… not result in duplicate submodule/class entries.
  • Loading branch information...
1 parent f95e78e commit 807cccab0cdf5c1021263c9f9ba0069feccceca3 Adam Moore committed Aug 10, 2009
Showing with 44 additions and 18 deletions.
  1. +27 −13 bin/yuidoc_parse.py
  2. +16 −4 test/apidocs.sh
  3. +1 −1 test/event.sh
View
@@ -508,7 +508,9 @@ def parseModule(tokenMap):
subname = tokenMap[SUBMODULE][0]
- target[SUBMODULES].append(subname);
+ if not target[SUBMODULES].count(subname):
+ target[SUBMODULES].append(subname)
+
self.subModName = subname;
target[SUBDATA][subname] = { NAME: self.currentClass }
@@ -524,14 +526,16 @@ def parseModule(tokenMap):
if len(self.deferredModuleFiles) > 0:
for i in self.deferredModuleFiles:
self.data[FILE_MAP][i][MODULE] = self.currentModule
- self.data[MODULES][self.currentModule][FILE_LIST].append(i)
+ if not self.data[MODULES][self.currentModule][FILE_LIST].count(i):
+ self.data[MODULES][self.currentModule][FILE_LIST].append(i)
self.deferredModuleFiles = []
if len(self.deferredModuleClasses) > 0:
for i in self.deferredModuleClasses:
self.data[CLASS_MAP][i][MODULE] = self.currentModule
- self.data[MODULES][self.currentModule][CLASS_LIST].append(i)
+ if not self.data[MODULES][self.currentModule][CLASS_LIST].count(i):
+ self.data[MODULES][self.currentModule][CLASS_LIST].append(i)
self.deferredModuleClasses = []
@@ -549,11 +553,13 @@ def parseModule(tokenMap):
if self.currentModule:
target[MODULE] = self.currentModule
- self.data[MODULES][self.currentModule][FILE_LIST].append(file_name)
+ if not self.data[MODULES][self.currentModule][FILE_LIST].count(file_name):
+ self.data[MODULES][self.currentModule][FILE_LIST].append(file_name)
else:
""" defer the module assignment until we find the token """
log.info('deferred module file: ' + file_name)
- self.deferredModuleFiles.append(file_name);
+ if not self.deferredModuleFiles.count(file_name):
+ self.deferredModuleFiles.append(file_name)
tokenMap.pop(FILE_MARKER)
@@ -569,7 +575,10 @@ def parseModule(tokenMap):
if self.subModName:
# provides a place to link to on the module landing page
- self.data[MODULES][self.currentModule][SUBDATA][self.subModName][NAME] = longName
+ try:
+ self.data[MODULES][self.currentModule][SUBDATA][self.subModName][NAME] = longName
+ except:
+ pass
# this was overwriting the submodule description
# if DESCRIPTION in tokenMap:
@@ -589,23 +598,26 @@ def parseModule(tokenMap):
if currentFor and currentFor != longName: # this is an inner class
if "innerClasses" not in target:
target["innerClasses"] = []
-
- target["innerClasses"].append(currentFor)
+ if not target["innerClasses"].count(currentFor):
+ target["innerClasses"].append(currentFor)
if self.currentModule:
target[MODULE] = self.currentModule
- self.data[MODULES][self.currentModule][CLASS_LIST].append(longName)
+ if not self.data[MODULES][self.currentModule][CLASS_LIST].count(longName):
+ self.data[MODULES][self.currentModule][CLASS_LIST].append(longName)
else:
""" defer the module assignment until we find the token """
log.info('deferred module CLASS: ' + longName)
- self.deferredModuleClasses.append(longName);
+ if not self.deferredModuleClasses.count(longName):
+ self.deferredModuleClasses.append(longName)
if self.currentFile:
target[FILE] = self.currentFile
try:
- self.data[FILE_MAP][self.currentFile][CLASS_LIST].append(longName)
+ if not self.data[FILE_MAP][self.currentFile][CLASS_LIST].count(longName):
+ self.data[FILE_MAP][self.currentFile][CLASS_LIST].append(longName)
except:
pass
@@ -620,7 +632,8 @@ def parseModule(tokenMap):
for i in tokenMap["uses"]:
# shortName, longName = self.getClassName(i, self.currentNamespace)
longName = i
- target["uses"].append(longName)
+ if not target["uses"].count(longName):
+ target["uses"].append(longName)
###############
# if not CLASS_LIST in self.data:
@@ -808,7 +821,8 @@ def get3xAttEvt(eventname, config):
c = self.data[CLASS_MAP][self.currentClass]
if not CONSTRUCTORS in c: c[CONSTRUCTORS] = []
constructor = parseParams(tokenMap, { DESCRIPTION: tokenMap[DESCRIPTION][0] })
- c[CONSTRUCTORS].append(constructor)
+ if not c[CONSTRUCTORS].count(constructor):
+ c[CONSTRUCTORS].append(constructor)
tokenMap.pop(CONSTRUCTOR)
# process the rest of the tags
View
@@ -23,36 +23,48 @@ src=~/src/yui3/src
# $src/queue \
# $src/yui"
#parser_in="$src"
+
parser_in="$src/yui \
$src/anim \
$src/attribute \
$src/base \
+ $src/cache \
$src/classnamemanager \
+ $src/collection \
$src/console \
+ $src/console-filters \
$src/cookie \
+ $src/dataschema \
+ $src/datasource \
+ $src/datatype \
$src/dd \
$src/dom \
$src/dump \
$src/event \
+ $src/event-custom \
+ $src/event-simulate \
+ $src/history \
+ $src/imageloader \
$src/io \
$src/json \
$src/node \
+ $src/node-focusmanager \
$src/node-menunav \
$src/oop \
$src/overlay \
- $src/profiler \
$src/plugin \
+ $src/profiler \
$src/queue \
$src/slider \
$src/stylesheet \
$src/substitute \
+ $src/test \
$src/widget \
$src/widget-position \
$src/widget-position-ext \
$src/widget-stdmod \
- $src/widget-stack \
- $src/test"
-
+ $src/widget-stack"
+
# The location to output the parser data. This output is a file containing a
# json string, and copies of the parsed files.
parser_out=build_tmp/yuidoc_tmp
View
@@ -9,7 +9,7 @@ yuidoc_home=..
src=~/src/yui3/src
-parser_in="$src/yui/js $src/event-custom/js $src/event/js $src/dump/js $src/substitute/js $src/anim/js $src/collection/js"
+parser_in="$src/yui/js $src/event-custom/js $src/event/js $src/dump/js $src/substitute/js $src/anim/js $src/collection/js $src/base/js $src/attribute/js"
# The location to output the parser data. This output is a file containing a
# json string, and copies of the parsed files.

0 comments on commit 807ccca

Please sign in to comment.