def keepOriginalText(s, startLoc, t):
 try:
  endloc = getTokensEndLoc()
 except ParseException:
  raise ParseFatalException, 'incorrect usage of keepOriginalText - may only be called as a parse action'
 del t[:]
 t += ParseResults(s[startLoc:endloc])
 return t

def keepOriginalText ( s , startLoc , t ) : try : endloc = getTokensEndLoc ( ) except ParseException : raise ParseFatalException , 'incorrect usage of keepOriginalText - may only be called as a parse action' del t [ : ] t += ParseResults ( s [ startLoc : endloc ] ) return t
helper parse action to preserve original parsed text .