Modified code from the help file on $Pre:

    $PreRead =.

    SetAttributes[saveinputs, HoldAll];
    inputs = {};
    saveinputs[new_] := (inputs = {inputs, HoldForm[new]}; new);
    $PreRead = saveinputs;

Evaluating:

    <>

then

    Flatten[inputs]
    
    {<>,8.,RowBox[{Flatten,[,inputs,]}]}

If you look at the Cell Expression for the 8. it is actually a TagBox

    TagBox["8.`", HoldForm]

Why does a syntax error cause this?

Example where this causes a problem in code:

    $PreRead =.

    SetAttributes[saveinputs, HoldAll];
    inputs = {};
    saveinputs[new_] := (inputs = {inputs, HoldForm[new]};
      If[Unevaluated[new],
       new,
       new);
    $PreRead = saveinputs;

When evaluating pretty much anything you get:

    ToExpression::esntx: Could not parse 8.` as Mathematica input.

If the test clause of the if statement in the above code does not depend on new then it runs fine.

    $PreRead =.

    SetAttributes[saveinputs, HoldAll];
    inputs = {};
    saveinputs[new_] := (inputs = {inputs, HoldForm[new]};
      If[True,
       new,
       new);
    $PreRead = saveinputs;

The above works fine.

How am I changing new in the test clause to cause this to fail?