anchor.diff:  -author('mats cronqvist').
   -export([sax/3
            , unit/0,unit/1
  -         , wget_parse/1,wget_print/1]).
  +         , wget_parse/1
  +         , wget_print/1]).
   
   sax(Str,Fun,Acc) ->
     parse(Str,Fun,Acc).
  
positive.code:   case Token of
      {sc,Tag,Attrs}   -> emit({end_tag,Tag},emit({tag,Tag,Attrs},State));
      {open,Tag,Attrs} -> emit({tag,Tag,Attrs},push(Tag,State));
      {close,Tag}      -> try emit({end_tag,Tag},pop(Tag,maybe_unroll(Tag,State)))
                          catch bogus -> State
                          end;
      {comment,Cm}     -> emit({comment,Cm},State);
      {'?',DT}    -> emit({'?',DT},State);
      {'!',DT} -> emit({'!',DT},State);
      {text,<<>>}        -> State;
      {text,Text}      -> emit({text,Text},State)
    end.
  
  emit(Token,{Fun,Acc,Stack}) -> {Fun,Fun(Token,Acc),Stack}.
  
negative.code:      {end_tag,"p"},
       {text,<<"grump">>},
       {tag,"x",[{"x","y"}]},
       {end_tag,"x"}]},
     {"<script>visual+basic = rules;</script>",
      [{tag,"script",[]},
       {text,<<"visual+basic = rules;">>},
       {end_tag,"script"}]}
    ].
  