def parse(s,tokens,wrap=0): global P s = tokenize.clean(s) P=PData(s,tokens); P.init() r = do_module() P = None return r
def encode(fname,s,t): t = Token((1,1),'module','module',[t]) global D s = tokenize.clean(s) D = DState(s,fname) D.begin(True) do(t) D.end() map_tags() out = D.out; D = None return ''.join(out)
def encode(fname,s,t): t = {'from':(1,1),'type':'module','val':'module','items':[t]} global D s = tokenize.clean(s) D = DState(s,fname) D.begin(True) do(t) D.end() map_tags() out = D.out; D = None return ''.join(out)