Look at the Type
property of a LocalVariableDeclarationSyntax
. In one case it will be a PredefinedTypeSyntax
, and in the other a NamedTypeSyntax
where the name happens to be "var".
Remember, "var" is a contextual keyword, and isn't known to be special in the syntax layer.
Note: I highly recommend installing the SyntaxVisualizer extension that is in the Roslyn SDK zip to see what the parser does with various bits of text.