anchor.diff:  ff(What,Str) ->
     case ff(Str,ff(What),[1,2]) of
       [Scr,Rest] -> {{tag,""},ws(Rest),{text,Scr}};
  -    [] -> {{text,Str},""}
  +    [] -> {{text,Str},"",eof}
     end.
   
   ff(script)-> "(.*)<(\\s*/\\s*script\\s*>.*)\$";
  
positive.code:          , unit/0
           , wget_parse/1,wget_print/1]).
  
  -define(ws(X),X==$\s ;X==$\r;X==$\n;X==$\t).
  -define(endv(S),?ws(hd(S));hd(S)==$>;hd(S)==$/,hd(tl(S))==$>;hd(S)==$=).
  -define(dq(Z),Z==$").
  -define(sq(Z),Z==$').
  
  sax(Str,Fun,Acc) ->
    try parse({Fun,Acc,[]},tz(nil,Str))
    catch C:R -> err(C,R,Str)
    end.
  
  err(C,R,Str) ->
    case erlang:get_stacktrace() of
      [{M,tz,[State,EStr]}|_] -> {{C,R},M,tz,State,err_pos(Str,EStr)};
      ST -> io:fwrite("~p:~p~n~p~n~p~n",[C,R,ST,Str])
    end.
  
  err_pos(Str1,Str2) -> err_pos(Str1,Str2,20).
  err_pos(Str1,Str2,Sz) ->
    Str = lists:sublist(Str1,length(Str1)-length(Str2)),
    {lists:reverse(lists:sublist(lists:reverse(Str),Sz)),lists:sublist(Str2,Sz)}.
  
  parse(State,{TZ,Str})  -> parse(State,tz(TZ,Str));
  parse({Fun,Acc,Stack}=State,{TZ,Str,Token}) -> 
    case Token of
      eof -> eof(unroll(Stack,{Fun,Acc,[]}));
      _   -> parse(maybe_emit(Token,State),tz(TZ,Str))
    end.
  
  eof({_Fun,Acc,_Stack}) -> Acc.
  
negative.code: 
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %% tokenizer
  tokenize(Str) when is_integer(hd(Str)) ->
    tokenize(tz(nil,Str));
  
  tokenize({TZ,Str}) ->
    tokenize(tz(TZ,Str));
  tokenize({text,Str,Token}) ->
    case ff(text,Str) of
      {{tag,""},EStr,{text,Txt}} -> 
        try [Token,{text,Txt},tokenize({{tag,""},EStr})]
        catch _:_ -> tokenize({text,Txt++"&lt;"++EStr,Token})
        end;
      {{text,Str},"",eof} -> [Token,{eof,{text,Str}}]
    end;
  tokenize({TZ,Str,Token}) ->
    {Token,{TZ,Str}}.
  
  tz(nil,"<"++Str)                        -> {{tag,""},ws(Str)};
  tz(nil,[_|Str])                         -> {nil,Str};
  
  