anchor.diff:  %%
   
   %% String
  -more(Cs, Stack, Toks, {Line, Col}, eos, Errors, _TabWidth, Fun) ->
  +more(Cs, Stack, Toks, {Line, Col}, eos, Errors, _TabWidth, _FileFormat, Fun) ->
       erlang:error(badstate, [Cs, Stack, Toks, {Line, Col}, eos, Errors, Fun]);
   % %% Debug clause for chopping string into 1-char segments
   % more(Cs, Stack, Toks, Pos, [H|T], Errors, Fun) ->
   %     Fun(Cs++[H], Stack, Toks, Pos, T, Errors);
  -more(Cs, Stack, Toks, {Line, Col}, [], Errors, TabWidth, Fun) ->
  -    Fun(Cs ++ eof, Stack, Toks, {Line, Col}, eos, Errors, TabWidth);
  +more(Cs, Stack, Toks, {Line, Col}, [], Errors, TabWidth, FileFormat, Fun) ->
  +    Fun(Cs ++ eof, Stack, Toks, {Line, Col}, eos, Errors, TabWidth,FileFormat);
   %% Stream
  -more(Cs, Stack, Toks, {Line, Col}, eof, Errors, TabWidth, Fun) ->
  -    erlang:error(badstate, [Cs, Stack, Toks, {Line, Col}, eof, Errors, TabWidth, Fun]);
  -more(Cs, Stack, Toks, {Line, Col}, io, Errors, TabWidth, Fun) ->
  -    {more, {Cs, Stack, Toks, {Line, Col}, io, Errors,TabWidth, Fun}}.
  +more(Cs, Stack, Toks, {Line, Col}, eof, Errors, TabWidth, FileFormat, Fun) ->
  +    erlang:error(badstate, [Cs, Stack, Toks, {Line, Col}, eof, Errors, TabWidth, FileFormat, Fun]);
  +more(Cs, Stack, Toks, {Line, Col}, io, Errors, TabWidth, FileFormat, Fun) ->
  +    {more, {Cs, Stack, Toks, {Line, Col}, io, Errors,TabWidth, FileFormat, Fun}}.
   
   %% String
  -done(eof, [], Toks, {Line, Col}, eos, _TabWidth) ->
  +done(eof, [], Toks, {Line, Col}, eos, _TabWidth,_FileFormat) ->
       {ok, reverse(Toks), {Line, Col}};
  -done(eof, Errors, _Toks, {Line, Col}, eos, _TabWidth) ->
  +done(eof, Errors, _Toks, {Line, Col}, eos, _TabWidth,_FileFormat) ->
       {Error, ErrorPos} = lists:last(Errors),
       {error, {ErrorPos, ?MODULE, Error}, {Line, Col}};
  -done(Cs, Errors, Toks, {Line, Col}, eos, TabWidth) ->
  -    scan(Cs, [], Toks, {Line, Col}, eos, Errors, TabWidth);
  +done(Cs, Errors, Toks, {Line, Col}, eos, TabWidth,FileFormat) ->
  +    scan(Cs, [], Toks, {Line, Col}, eos, Errors, TabWidth,FileFormat);
   %% Debug clause for chopping string into 1-char segments
   %% done(Cs, Errors, Toks, Pos, [H|T]) ->
   %%    scan(Cs++[H], [], Toks, Pos, T, Errors);
  -done(Cs, Errors, Toks, {Line, Col}, [], TabWidth) ->
  -    scan(Cs ++ eof, [], Toks, {Line, Col}, eos, Errors, TabWidth);
  +done(Cs, Errors, Toks, {Line, Col}, [], TabWidth,FileFormat) ->
  +    scan(Cs ++ eof, [], Toks, {Line, Col}, eos, Errors, TabWidth,FileFormat);
   %% Stream
  -done(Cs, [], [{dot, _} | _] = Toks, {Line, Col}, io, _TabWidth) ->
  +done(Cs, [], [{dot, _} | _] = Toks, {Line, Col}, io, _TabWidth,_FileFormat) ->
       {done, {ok, reverse(Toks), {Line, Col}}, Cs};
  -done(Cs, [], [_ | _], {Line, Col}, io, _TabWidth) ->
  +done(Cs, [], [_ | _], {Line, Col}, io, _TabWidth,_FileFormat) ->
       {done,
        {error, {{Line, Col}, ?MODULE, scan}, {Line, Col}}, Cs};
  -done(Cs, [], [], {Line, Col}, eof, _TabWidth) ->
  +done(Cs, [], [], {Line, Col}, eof, _TabWidth,_FileFormat) ->
       {done, {eof, {Line, Col}}, Cs};
  -done(Cs, [], [{dot, _} | _] = Toks, {Line, Col}, eof, _TabWidth) ->
  +done(Cs, [], [{dot, _} | _] = Toks, {Line, Col}, eof, _TabWidth,_FileFormat) ->
       {done, {ok, reverse(Toks), {Line, Col}}, Cs};
  -done(Cs, [], _Toks, {Line, Col}, eof, _TabWidth) ->
  +done(Cs, [], _Toks, {Line, Col}, eof, _TabWidth,_FileFormat) ->
       {done,
        {error, {{Line, Col}, ?MODULE, scan}, {Line, Col}}, Cs};
  -done(Cs, Errors, _Toks, {Line, Col}, io, _TabWidth) ->
  +done(Cs, Errors, _Toks, {Line, Col}, io, _TabWidth,_FileFormat) ->
       {Error, ErrorPos} = lists:last(Errors),
       {done, {error, {ErrorPos, ?MODULE, Error}, {Line, Col}},
        Cs};
  -done(Cs, Errors, _Toks, {Line, Col}, eof, _TabWidth) ->
  +done(Cs, Errors, _Toks, {Line, Col}, eof, _TabWidth,_FileFormat) ->
       {Error, ErrorPos} = lists:last(Errors),
       {done, {error, {ErrorPos, ?MODULE, Error}, {Line, Col}},
        Cs}.
  
positive.code: %% Stack argument: return fun.
  %% Returns the scanned name on the stack, unreversed.
  %%
  sub_scan_name([C | Cs] = Css, Stack, Toks, {Line, Col},State, Errors,TabWidth) ->
      case name_char(C) of
        true ->
  	  sub_scan_name(Cs, [C | Stack], Toks, {Line, Col}, State,Errors, TabWidth);
        false ->
  	  [Fun | Name] = reverse(Stack),
  	  Fun(Css, Name, Toks, {Line, Col}, State, Errors, TabWidth)
      end;
  sub_scan_name([], Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      more([], Stack, Toks, {Line, Col}, State, Errors, TabWidth, fun sub_scan_name/7);
  sub_scan_name(Eof, Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      [Fun | Name] = reverse(Stack),
      Fun(Eof, Name, Toks, {Line, Col}, State, Errors, TabWidth).
  
  name_char(C) when C >= $a, C =< $z -> true;
  name_char(C) when C >= $, C =< $, C /= $ -> true;
  
negative.code:     $\d;                         %\d = DEL
  escape_char(C) -> C.
  
  scan_number([$., C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat)
      when C >= $0, C =< $9 ->
      scan_fraction(Cs, [C, $. | Stack], Toks, {Line, Col}, State, Errors, TabWidth,FileFormat);
  scan_number([$.] = Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      more(Cs, Stack, Toks, {Line, Col}, State, Errors,TabWidth, FileFormat,fun scan_number/8);
  scan_number([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat)
      when C >= $0, C =< $9 ->
      scan_number(Cs, [C | Stack], Toks, {Line, Col}, State,Errors, TabWidth,FileFormat);
  scan_number([$# | Cs], Stack, Toks, {Line, Col}, State,Errors, TabWidth,FileFormat) ->
      case catch list_to_integer(reverse(Stack)) of
        B when is_integer(B), B >= 2, B =< 1 + $Z - $A + 10 ->
  	  scan_based_int(Cs, [B], Toks, {Line, Col}, State,Errors, TabWidth,FileFormat);
        B ->
  	  scan(Cs, [], Toks, {Line, Col}, State,[{{base, B}, {Line, Col}} | Errors], TabWidth,FileFormat)
      end;
  scan_number([], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, FileFormat, fun scan_number/8);
  scan_number(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      case catch list_to_integer(reverse(Stack)) of
        N when is_integer(N) ->
  	    scan(Cs, [], [{integer, {Line, Col}, reverse(Stack)} | Toks],
  	       {Line, Col + length(Stack)}, State, Errors, TabWidth,FileFormat);
        _ ->
  	  scan(Cs, [], Toks, {Line, Col}, State,
  	       [{{illegal, integer}, {Line, Col}} | Errors], TabWidth,FileFormat)
      end.
  
  scan_based_int([C | Cs], [B | Stack], Toks, {Line, Col}, State, Errors, TabWidth,FileFormat)
      when C >= $0, C =< $9, C < $0 + B ->
      scan_based_int(Cs, [B, C | Stack], Toks, {Line, Col},State, Errors, TabWidth,FileFormat);
  scan_based_int([C | Cs], [B | Stack], Toks, {Line, Col}, State, Errors, TabWidth,FileFormat)
      when C >= $A, B > 10, C < $A + B - 10 ->
      scan_based_int(Cs, [B, C | Stack], Toks, {Line, Col},State, Errors, TabWidth,FileFormat);
  scan_based_int([C | Cs], [B | Stack], Toks, {Line, Col},State, Errors,TabWidth,FileFormat)
      when C >= $a, B > 10, C < $a + B - 10 ->
      scan_based_int(Cs, [B, C | Stack], Toks, {Line, Col}, State, Errors, TabWidth,FileFormat);
  scan_based_int([], Stack, Toks, {Line, Col}, State,Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, FileFormat,fun scan_based_int/8);
  scan_based_int(Cs, [B | Stack], Toks, {Line, Col},State, Errors, TabWidth,FileFormat) ->
       case catch erlang:list_to_integer(reverse(Stack), B) of
        N when is_integer(N) ->
  	  scan(Cs, [], [{integer, {Line, Col}, integer_to_list(B)++[$#| reverse(Stack)]} | Toks],   %% "replaced 'N' with 'reverse(Stack)'";
  	       {Line, Col + length(Stack)}, State, Errors, TabWidth,FileFormat);
        _ ->
  	  scan(Cs, [], Toks, {Line, Col}, State,
  	       [{{illegal, integer}, {Line, Col}} | Errors], TabWidth,FileFormat)
      end.
  
  scan_fraction([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat)
      when C >= $0, C =< $9 ->
      scan_fraction(Cs, [C | Stack], Toks, {Line, Col}, State, Errors, TabWidth,FileFormat);
  scan_fraction([$e | Cs], Stack, Toks, {Line, Col},State, Errors, TabWidth,FileFormat) ->
      scan_exponent_sign(Cs, [$E | Stack], Toks, {Line, Col},State, Errors, TabWidth,FileFormat);
  scan_fraction([$E | Cs], Stack, Toks, {Line, Col},State, Errors, TabWidth,FileFormat) ->
      scan_exponent_sign(Cs, [$E | Stack], Toks, {Line, Col},State, Errors, TabWidth,FileFormat);
  scan_fraction([], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, FileFormat, fun scan_fraction/8);
  scan_fraction(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      case catch list_to_float(reverse(Stack)) of
        F when is_float(F) ->
  	  scan(Cs, [], [{float, {Line, Col}, F} | Toks],
  	       {Line, Col + length(Stack)}, State, Errors, TabWidth,FileFormat);
        _ ->
  	  scan(Cs, [], Toks, {Line, Col}, State,
  	       [{{illegal, float}, {Line, Col}} | Errors], TabWidth,FileFormat)
      end.
  
  scan_exponent_sign([$+ | Cs], Stack, Toks, {Line, Col},State, Errors, TabWidth,FileFormat) ->
      scan_exponent(Cs, [$+ | Stack], Toks, {Line, Col}, State, Errors, TabWidth,FileFormat);
  scan_exponent_sign([$- | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      scan_exponent(Cs, [$- | Stack], Toks, {Line, Col}, State, Errors, TabWidth,FileFormat);
  scan_exponent_sign([], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors, TabWidth, FileFormat, fun scan_exponent_sign/8);
  scan_exponent_sign(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      scan_exponent(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat).
  
  scan_exponent([C | Cs], Stack, Toks, {Line, Col}, State,Errors, TabWidth,FileFormat)
      when C >= $0, C =< $9 ->
      scan_exponent(Cs, [C | Stack], Toks, {Line, Col}, State, Errors, TabWidth,FileFormat);
  scan_exponent([], Stack, Toks, {Line, Col}, State,Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, FileFormat, fun scan_exponent/8);
  scan_exponent(Cs, Stack, Toks, {Line, Col}, State,Errors, TabWidth,FileFormat) ->
      case catch list_to_float(reverse(Stack)) of
        F when is_float(F) ->
  	  scan(Cs, [], [{float, {Line, Col}, F} | Toks],
  	       {Line, Col + length(Stack)}, State, Errors, TabWidth,FileFormat);
        _ ->
  	  scan(Cs, [], Toks, {Line, Col}, State,
  	       [{{illegal, float}, {Line, Col}} | Errors], TabWidth,FileFormat)
      end.
  
  scan_comment([$\r| Cs], Stack, Toks, {Line, Col},State, Errors, TabWidth,FileFormat) ->
      case FileFormat of 
  	mac ->
  	    scan(Cs, Stack, Toks, {Line + 1, 1}, State, Errors, TabWidth,FileFormat);
  	_ ->
  	   scan(Cs, Stack, Toks, {Line, Col+1}, State, Errors, TabWidth,FileFormat)
  	end;
  scan_comment([$\n| Cs], Stack, Toks, {Line, _Col},State, Errors, TabWidth,FileFormat) ->
      scan(Cs, Stack, Toks, {Line + 1, 1}, State, Errors, TabWidth,FileFormat);	
  scan_comment([_ | Cs], Stack, Toks, {Line, Col}, State,Errors, TabWidth,FileFormat) ->
      scan_comment(Cs, Stack, Toks, {Line, Col + 1}, State,Errors, TabWidth,FileFormat);
  scan_comment([], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, FileFormat,fun scan_comment/8);
  scan_comment(Eof, _Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      done(Eof, Errors, Toks, {Line, Col}, State, TabWidth,FileFormat).
  
  scan_dot([$% | _] = Cs, _Stack, Toks, {Line, Col},State, Errors, TabWidth,FileFormat) ->
      done(Cs, Errors, [{dot, {Line, Col}} | Toks], {Line, Col + 1}, State, TabWidth,FileFormat);
  scan_dot([$\r | Cs], _Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      case FileFormat of 
  	mac ->
  	    done(Cs, Errors, [{dot, {Line, Col}} | Toks],{Line + 1, 1}, State, TabWidth,FileFormat);
  	_ -> 
  	    done(Cs, Errors, [{dot, {Line, Col}} | Toks],{Line, Col+1}, State, TabWidth,FileFormat)
      end;	
  scan_dot([$\n | Cs], _Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      done(Cs, Errors, [{dot, {Line, Col}} | Toks],{Line + 1, 1}, State, TabWidth,FileFormat);
  scan_dot([C | Cs], _Stack, Toks, {Line, Col}, State,Errors, TabWidth,FileFormat)
    when C >= $\000, C =< $\s ->   %% This is problematic; some characters occupy 2 spaces.
        done(Cs, Errors, [{dot, {Line, Col}} | Toks], {Line, Col + 2}, State, TabWidth,FileFormat);
  scan_dot([C | Cs], _Stack, Toks, {Line, Col}, State,Errors,TabWidth,FileFormat)
      when C >= $\200, C =< $\240 -> 
      done(Cs, Errors, [{dot, {Line, Col}} | Toks],{Line, Col + 2}, State, TabWidth,FileFormat);
  scan_dot([], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, FileFormat, fun scan_dot/8);
  scan_dot(eof, _Stack, Toks, {Line, Col}, State,	 Errors, TabWidth,FileFormat) ->
      done(eof, Errors, [{dot, {Line, Col}} | Toks],{Line, Col}, State, TabWidth,FileFormat);
  scan_dot(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      scan(Cs, Stack, [{'.', {Line, Col}} | Toks], {Line, Col + 1}, State, Errors, TabWidth,FileFormat).
  
  %% reserved_word(Atom) -> Bool
  %%   return 'true' if Atom is an Erlang reserved word, else 'false'.
  