@@ -38,15 +38,8 @@ def format(self, tokensource, outfile):
3838 for ttype , value in tokensource :
3939 # This checks if we are at the start of a new action. If we are we should be reading a value or an action and the label and action for the previous one should be set
4040 if len (action )> 0 and (ttype == String or ttype == Keyword or ttype == Comment .Preproc ) :
41- if action == self .checkaction :
42- for key in keywords :
43- if key in self .keyword_dict [action ]["syntax" ] :
44- self .checkaction_keywords .add ( key )
45- else :
46- # This makes sure we find numbered keywords
47- for kkkk in self .keyword_dict [action ]["syntax" ] :
48- if kkkk == "output" or self .keyword_dict [action ]["syntax" ][kkkk ]["multiple" ]== 0 : continue
49- if kkkk in key : self .checkaction_keywords .add ( kkkk )
41+ if action == self .checkaction :
42+ self .storeKeywordsForCheckAction ( keywords )
5043 if notooltips :
5144 # Reset everything for the new action
5245 action , label , keywords , notooltips = "" , "" , [], False
@@ -302,9 +295,8 @@ def format(self, tokensource, outfile):
302295 else :
303296 outfile .write ('<span class="plumedtooltip" style="color:green">' + value .strip () + '<span class="right">' + self .keyword_dict [action ]["description" ] + ' <a href="' + self .keyword_dict [action ]["hyperlink" ] + '" style="color:green">More details</a><i></i></span></span>' )
304297 # Check if there is stuff to output for the last action in the file
305- if action == self .checkaction :
306- for key in keywords :
307- self .checkaction_keywords .add ( key )
298+ if action == self .checkaction :
299+ self .storeKeywordsForCheckAction ( keywords )
308300 if len (label )> 0 and label not in all_labels and label not in self .valuedict .keys () :
309301 all_labels .add ( label )
310302 if action in self .keyword_dict and "output" in self .keyword_dict [action ]["syntax" ] : self .writeValuesData ( outfile , action , label , keywords , self .keyword_dict [action ]["syntax" ]["output" ] )
@@ -354,4 +346,14 @@ def writeValueInfo( self, outfile, label, span_label, valinfo ) :
354346
355347 def getCheckActionKeywords ( self ) :
356348 return self .checkaction_keywords
349+
350+ def storeKeywordsForCheckAction ( self , keywords ) :
351+ for key in keywords :
352+ if key in self .keyword_dict [self .checkaction ]["syntax" ] :
353+ self .checkaction_keywords .add ( key )
354+ else :
355+ # This makes sure we find numbered keywords
356+ for kkkk in self .keyword_dict [self .checkaction ]["syntax" ] :
357+ if kkkk == "output" or self .keyword_dict [self .checkaction ]["syntax" ][kkkk ]["multiple" ]== 0 : continue
358+ if kkkk in key : self .checkaction_keywords .add ( kkkk )
357359
0 commit comments