anchor.diff:  %%	{error,{ErrorPos,?MODULE,What},EndPos}
   
   string(Cs) ->
  -    string(Cs, {1, 1}, ?DEFAULT_TABWIDTH).
  -
  -
  -string(Cs, {Line, Col}) -> string(Cs, {Line, Col}, ?DEFAULT_TABWIDTH).
  -
  -string(Cs, {Line, Col}, TabWidth)
  +    string(Cs, {1, 1}, ?DEFAULT_TABWIDTH, ?DEFAULT_FILEFORMAT).
  +
  +
  +string(Cs, {Line, Col}) -> string(Cs, {Line, Col}, ?DEFAULT_TABWIDTH, ?DEFAULT_FILEFORMAT).
  +
  +string(Cs, {Line, Col}, TabWidth, FileFormat)
       when is_list(Cs), is_integer(Line), is_integer(Col), is_integer(TabWidth) ->
       %     %% Debug replacement line for chopping string into 1-char segments
       %     scan([], [], [], Pos, Cs, []).
  -    scan(Cs, [], [], {Line, Col}, [], [],TabWidth).
  +    scan(Cs, [], [], {Line, Col}, [], [],TabWidth,FileFormat).
   
   
   %% tokens(Continuation, CharList, StartPos) ->
  
positive.code:     $\d;                         %\d = DEL
  escape_char(C) -> C.
  
  scan_number([$., C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth)
      when C >= $0, C =< $9 ->
      scan_fraction(Cs, [C, $. | Stack], Toks, {Line, Col}, State, Errors, TabWidth);
  scan_number([$.] = Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      more(Cs, Stack, Toks, {Line, Col}, State, Errors,TabWidth,fun scan_number/7);
  scan_number([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth)
      when C >= $0, C =< $9 ->
      scan_number(Cs, [C | Stack], Toks, {Line, Col}, State,Errors, TabWidth);
  scan_number([$# | Cs], Stack, Toks, {Line, Col}, State,Errors, TabWidth) ->
      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);
        B ->
  	  scan(Cs, [], Toks, {Line, Col}, State,[{{base, B}, {Line, Col}} | Errors], TabWidth)
      end;
  scan_number([], Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, fun scan_number/7);
  scan_number(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      case catch list_to_integer(reverse(Stack)) of
        N when is_integer(N) ->
  	  scan(Cs, [], [{integer, {Line, Col}, N} | Toks],
  	       {Line, Col + length(Stack)}, State, Errors, TabWidth);
        _ ->
  	  scan(Cs, [], Toks, {Line, Col}, State,
  	       [{{illegal, integer}, {Line, Col}} | Errors], TabWidth)
      end.
  
  scan_based_int([C | Cs], [B | Stack], Toks, {Line, Col}, State, Errors, TabWidth)
      when C >= $0, C =< $9, C < $0 + B ->
      scan_based_int(Cs, [B, C | Stack], Toks, {Line, Col},State, Errors, TabWidth);
  scan_based_int([C | Cs], [B | Stack], Toks, {Line, Col}, State, Errors, TabWidth)
      when C >= $A, B > 10, C < $A + B - 10 ->
      scan_based_int(Cs, [B, C | Stack], Toks, {Line, Col},State, Errors, TabWidth);
  scan_based_int([C | Cs], [B | Stack], Toks, {Line, Col},State, Errors,TabWidth)
      when C >= $a, B > 10, C < $a + B - 10 ->
      scan_based_int(Cs, [B, C | Stack], Toks, {Line, Col}, State, Errors, TabWidth);
  scan_based_int([], Stack, Toks, {Line, Col}, State,Errors, TabWidth) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth,fun scan_based_int/7);
  scan_based_int(Cs, [B | Stack], Toks, {Line, Col},State, Errors, TabWidth) ->
       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);
        _ ->
  	  scan(Cs, [], Toks, {Line, Col}, State,
  	       [{{illegal, integer}, {Line, Col}} | Errors], TabWidth)
      end.
  
  scan_fraction([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth)
      when C >= $0, C =< $9 ->
      scan_fraction(Cs, [C | Stack], Toks, {Line, Col}, State, Errors, TabWidth);
  scan_fraction([$e | Cs], Stack, Toks, {Line, Col},State, Errors, TabWidth) ->
      scan_exponent_sign(Cs, [$E | Stack], Toks, {Line, Col},State, Errors, TabWidth);
  scan_fraction([$E | Cs], Stack, Toks, {Line, Col},State, Errors, TabWidth) ->
      scan_exponent_sign(Cs, [$E | Stack], Toks, {Line, Col},State, Errors, TabWidth);
  scan_fraction([], Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, fun scan_fraction/7);
  scan_fraction(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      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);
        _ ->
  	  scan(Cs, [], Toks, {Line, Col}, State,
  	       [{{illegal, float}, {Line, Col}} | Errors], TabWidth)
      end.
  
  scan_exponent_sign([$+ | Cs], Stack, Toks, {Line, Col},State, Errors, TabWidth) ->
      scan_exponent(Cs, [$+ | Stack], Toks, {Line, Col}, State, Errors, TabWidth);
  scan_exponent_sign([$- | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      scan_exponent(Cs, [$- | Stack], Toks, {Line, Col}, State, Errors, TabWidth);
  scan_exponent_sign([], Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      more([], Stack, Toks, {Line, Col}, State, Errors, TabWidth, fun scan_exponent_sign/7);
  scan_exponent_sign(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      scan_exponent(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth).
  
  scan_exponent([C | Cs], Stack, Toks, {Line, Col}, State,Errors, TabWidth)
      when C >= $0, C =< $9 ->
      scan_exponent(Cs, [C | Stack], Toks, {Line, Col}, State, Errors, TabWidth);
  scan_exponent([], Stack, Toks, {Line, Col}, State,Errors, TabWidth) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, fun scan_exponent/7);
  scan_exponent(Cs, Stack, Toks, {Line, Col}, State,Errors, TabWidth) ->
      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);
        _ ->
  	  scan(Cs, [], Toks, {Line, Col}, State,
  	       [{{illegal, float}, {Line, Col}} | Errors], TabWidth)
      end.
  
  scan_comment([$\n | Cs], Stack, Toks, {Line, _Col},State, Errors, TabWidth) ->
      scan(Cs, Stack, Toks, {Line + 1, 1}, State, Errors, TabWidth);
  scan_comment([_ | Cs], Stack, Toks, {Line, Col}, State,Errors, TabWidth) ->
      scan_comment(Cs, Stack, Toks, {Line, Col + 1}, State,Errors, TabWidth);
  scan_comment([], Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth,fun scan_comment/7);
  scan_comment(Eof, _Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      done(Eof, Errors, Toks, {Line, Col}, State, TabWidth).
  
  scan_dot([$% | _] = Cs, _Stack, Toks, {Line, Col},State, Errors, TabWidth) ->
      done(Cs, Errors, [{dot, {Line, Col}} | Toks], {Line, Col + 1}, State, TabWidth);
  scan_dot([$\r | Cs], _Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      case Cs of 
  	[$\n|Cs1] ->
  	    done(Cs1, Errors, [{dot, {Line, Col}} | Toks],{Line + 1, 1}, State, TabWidth);
  	_ -> 
  	    done(Cs, Errors, [{dot, {Line, Col}} | Toks],{Line + 1, 1}, State, TabWidth)
      end;	
  scan_dot([$\n | Cs], _Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      done(Cs, Errors, [{dot, {Line, Col}} | Toks],{Line + 1, 1}, State, TabWidth);
  scan_dot([C | Cs], _Stack, Toks, {Line, Col}, State,Errors, TabWidth)
    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);
  scan_dot([C | Cs], _Stack, Toks, {Line, Col}, State,Errors,TabWidth)
      when C >= $\200, C =< $\240 -> 
      done(Cs, Errors, [{dot, {Line, Col}} | Toks],{Line, Col + 2}, State, TabWidth);
  scan_dot([], Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, fun scan_dot/7);
  scan_dot(eof, _Stack, Toks, {Line, Col}, State,	 Errors, TabWidth) ->
      done(eof, Errors, [{dot, {Line, Col}} | Toks],{Line, Col}, State, TabWidth);
  scan_dot(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth) ->
      scan(Cs, Stack, [{'.', {Line, Col}} | Toks], {Line, Col + 1}, State, Errors, TabWidth).
  
  %% reserved_word(Atom) -> Bool
  %%   return 'true' if Atom is an Erlang reserved word, else 'false'.
  
negative.code: name_char($@) -> true;
  name_char(_) -> false.
  
  scan_char([$\\ | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      sub_scan_escape(Cs, [fun scan_char_escape/8 | Stack], Toks, {Line, Col}, State, Errors, TabWidth,FileFormat);
  scan_char([$\n | Cs], Stack, Toks, {Line, Col}, State,  Errors, TabWidth,FileFormat) ->
      scan(Cs, Stack, [{char, {Line, Col}, $\n} | Toks], {Line + 1, Col}, State, Errors, TabWidth,FileFormat);
  scan_char([], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors, TabWidth, FileFormat, fun scan_char/8);
  scan_char(Cs, Stack, Toks, {Line, Col}, State,Errors, TabWidth,FileFormat) ->
      scan_char_escape(Cs, Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat).
  
  scan_char_escape([nl | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      scan(Cs, Stack, [{char, {Line, Col}, $\n} | Toks], {Line + 1, 1}, State, Errors, TabWidth,FileFormat);
  scan_char_escape([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      scan(Cs, Stack, [{char, {Line, Col}, C} | Toks],{Line, Col + 1}, State, Errors, TabWidth,FileFormat);
  scan_char_escape(Eof, _Stack, _Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      done(Eof, [{char, {Line, Col}} | Errors], [], {Line, Col + 1}, State, TabWidth,FileFormat).
  
  scan_string([$" | Cs], Stack, Toks, {Line, Col}, State,  Errors, TabWidth, FileFormat) ->
      [StartPos, $" | S] = reverse(Stack),
      scan(Cs, [], [{string, StartPos, S} | Toks],{Line, Col+1}, State, Errors, TabWidth,FileFormat);
  
  scan_string([$\r | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      case FileFormat of 
  	mac -> scan_string(Cs, [$\r | Stack], Toks, {Line + 1, 1},
  			   State, Errors, TabWidth,FileFormat);
  	_ -> scan_string(Cs, [$\r | Stack], Toks, {Line, Col+1},
  			 State, Errors, TabWidth,FileFormat)
      end;
  scan_string([$\n | Cs], Stack, Toks, {Line, _Col}, State,  Errors, TabWidth,FileFormat) ->
      scan_string(Cs, [$\n | Stack], Toks, {Line + 1, 1}, State, Errors, TabWidth,FileFormat);
  scan_string([$\\ | Cs], Stack, Toks, {Line, Col}, State,  Errors, TabWidth,FileFormat) ->
      sub_scan_escape(Cs, [fun scan_string_escape/8 | Stack], Toks, {Line, Col+1}, State, Errors, TabWidth,FileFormat);
  scan_string([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) 
     when C==$\t ->
      scan_string(Cs, [C | Stack], Toks, {Line, Col+TabWidth}, State,Errors, TabWidth,FileFormat);
  scan_string([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      scan_string(Cs, [C | Stack], Toks, {Line, Col+1}, State,Errors, TabWidth,FileFormat);
  scan_string([], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors, TabWidth, FileFormat, fun scan_string/8);
  scan_string(Eof, Stack, _Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      [StartPos, $" | S] = reverse(Stack),
      SS = string:substr(S, 1, 16),
      done(Eof, [{{string, $", SS}, StartPos} | Errors], [],
  	 {Line, Col}, State, TabWidth,FileFormat).
  
  scan_string_escape([nl | Cs], Stack, Toks, {Line, _Col}, State, Errors, TabWidth,FileFormat) ->
      scan_string(Cs, [$\n | Stack], Toks, {Line + 1, 1}, State, Errors, TabWidth,FileFormat);
  scan_string_escape([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      scan_string(Cs, [C, $\\| Stack], Toks, {Line, Col+1}, State, Errors, TabWidth,FileFormat);
  scan_string_escape(Eof, Stack, _Toks, {Line, Col},State, Errors, TabWidth,FileFormat) ->
      [StartPos, $" | S] = reverse(Stack),
      SS = string:substr(S, 1, 16),
      done(Eof, [{{string, $", SS}, StartPos} | Errors], [],
  	 {Line, Col + length(S) + 2}, State, TabWidth,FileFormat).
  
  scan_qatom([$' | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      [StartPos, $' | S] = reverse(Stack),
      case catch list_to_atom(S) of
        A when is_atom(A) ->
  	  scan(Cs, [], [{atom, StartPos, A} | Toks],{Line, Col + 1}, State, Errors, TabWidth,FileFormat);
        _ ->
  	  scan(Cs, [], Toks, {Line, Col}, State,[{{illegal, atom}, StartPos} | Errors], TabWidth,FileFormat)
      end;
  scan_qatom([$\r|Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      case FileFormat of 
  	mac -> scan_qatom(Cs,[$\r|Stack], Toks, {Line+1, 1}, State, Errors, TabWidth,FileFormat);
  	_ -> scan_qatom(Cs,[$\r|Stack], Toks, {Line, Col+1}, State, Errors, TabWidth,FileFormat)
      end;
  scan_qatom([$\n | Cs], Stack, Toks, {Line, _Col}, State, Errors, TabWidth,FileFormat) ->
      scan_qatom(Cs, [$\n | Stack], Toks, {Line + 1, 1},State, Errors, TabWidth,FileFormat);
  scan_qatom([$\\ | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      sub_scan_escape([$\\|Cs], [fun scan_qatom_escape/8 | Stack], Toks, {Line, Col+1}, State, Errors, TabWidth,FileFormat);
  scan_qatom([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat)
    when C==$\t ->
      scan_qatom(Cs, [C | Stack], Toks, {Line, Col+TabWidth}, State,  Errors, TabWidth,FileFormat);
  scan_qatom([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      scan_qatom(Cs, [C | Stack], Toks, {Line, Col+1}, State,  Errors, TabWidth,FileFormat);
  scan_qatom([], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      more([], Stack, Toks, {Line, Col}, State, Errors,TabWidth, FileFormat, fun scan_qatom/8);
  scan_qatom(Eof, Stack, _Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      [StartPos, $' | S] = reverse(Stack),
      SS = string:substr(S, 1, 16),
      done(Eof, [{{string, $', SS}, StartPos} | Errors], [],{Line, Col}, State, TabWidth,FileFormat).
  
  scan_qatom_escape([nl | Cs], Stack, Toks, {Line, _Col}, State, Errors, TabWidth,FileFormat) ->
      scan_qatom(Cs, [$\n | Stack], Toks, {Line + 1, 1}, State, Errors, TabWidth,FileFormat);
  scan_qatom_escape([C | Cs], Stack, Toks, {Line, Col}, State, Errors, TabWidth,FileFormat) ->
      scan_qatom(Cs, [C | Stack], Toks, {Line, Col+1}, State, Errors, TabWidth,FileFormat);
  scan_qatom_escape(Eof, Stack, _Toks, {Line, Col}, State,Errors, TabWidth,FileFormat) ->
      [StartPos, $' | S] = reverse(Stack),
      SS = string:substr(S, 1, 16),
      done(Eof, [{{string, $', SS}, StartPos} | Errors], [],
  	 {Line, Col}, State, TabWidth,FileFormat).
  
  %% Scan for a character escape sequence, in character literal or string.
  %% A string is a syntactical sugar list (e.g "abc")
  