Lines Matching refs:f
51 def func_code(f): argument
52 return f.func_code
54 def func_code(f): argument
55 return f.__code__
79 def __init__(self,f): argument
80 self.f = f
82 self.f.write((msg % args) + "\n")
85 self.f.write("WARNING: "+ (msg % args) + "\n")
88 self.f.write("ERROR: " + (msg % args) + "\n")
154 for f in findex:
155 if not f or not f[0]:
156 newfindex.append(f)
158 newfindex.append((getattr(object,f[0].__name__),f[1]))
189 for f in part[1]:
190 if f and f[0]:
191 initialfuncs.append(f)
432 f = t.tb_frame
434 f = f.f_back
436 ldict = f.f_globals.copy()
437 if f.f_globals != f.f_locals:
438 ldict.update(f.f_locals)
451 for f,name in zip(funclist,namelist):
452 if f and f[0]:
453 result.append((name, f[1]))
455 result.append(f)
492 for f,i in lexre.groupindex.items():
493 handle = ldict.get(f,None)
495 lexindexfunc[i] = (handle,toknames[f])
496 lexindexnames[i] = f
498 lexindexnames[i] = f
499 if f.find("ignore_") > 0:
502 lexindexfunc[i] = (None, toknames[f])
653 tsymbols = [f for f in self.ldict if f[:2] == 't_' ]
672 for f in tsymbols:
673 t = self.ldict[f]
674 states, tokname = _statetoken(f,self.stateinfo)
675 self.toknames[f] = tokname
688 self.funcsym[s].append((f,t))
694 self.log.warning("%s contains a literal backslash '\\'",f)
697 self.log.error("Rule '%s' must be defined as a function", f)
701 self.strsym[s].append((f,t))
703 self.log.error("%s not defined as a function or string", f)
707 for f in self.funcsym.values():
708 f.sort(key=lambda x: func_code(x[1]).co_firstlineno)
725 for fname, f in self.funcsym[state]:
726 line = func_code(f).co_firstlineno
727 file = func_code(f).co_filename
731 if isinstance(f, types.MethodType):
735 nargs = func_code(f).co_argcount
737 self.log.error("%s:%d: Rule '%s' has too many arguments",file,line,f.__name__)
742 self.log.error("%s:%d: Rule '%s' requires an argument", file,line,f.__name__)
746 if not f.__doc__:
747 … self.log.error("%s:%d: No regular expression defined for rule '%s'",file,line,f.__name__)
752 c = re.compile("(?P<%s>%s)" % (fname,f.__doc__), re.VERBOSE | self.reflags)
754 …elf.log.error("%s:%d: Regular expression for rule '%s' matches empty string", file,line,f.__name__)
758 … self.log.error("%s:%d: Invalid regular expression for rule '%s'. %s", file,line,f.__name__,e)
759 if '#' in f.__doc__:
760 … self.log.error("%s:%d. Make sure '#' in rule '%s' is escaped with '\\#'",file,line, f.__name__)
795 f = efunc
796 line = func_code(f).co_firstlineno
797 file = func_code(f).co_filename
800 if isinstance(f, types.MethodType):
804 nargs = func_code(f).co_argcount
806 self.log.error("%s:%d: Rule '%s' has too many arguments",file,line,f.__name__)
810 self.log.error("%s:%d: Rule '%s' requires an argument", file,line,f.__name__)
813 for f in self.files:
814 self.validate_file(f)
831 f = open(filename)
832 lines = f.readlines()
833 f.close()
929 for fname, f in linfo.funcsym[state]:
930 line = func_code(f).co_firstlineno
931 file = func_code(f).co_filename
932 regex_list.append("(?P<%s>%s)" % (fname,f.__doc__))
934 debuglog.info("lex: Adding rule %s -> '%s' (state '%s')",fname,f.__doc__, state)
1014 f = open(filename)
1015 data = f.read()
1016 f.close()
1044 def set_doc(f): argument
1046 f.__doc__ = r.__doc__
1048 f.__doc__ = r
1049 return f