having problems when adding this to my code

var dir : Vector3 = Vector3.zero;

i get a parsing error

even using new file

using System;

namespace AssemblyCSharp
{

public class test
{
	public test ()
	{
		var gravity : float = 20.0;
	}
}

}

var speed : float = 10;
var moveThreshold : float = .2;

private var movex : float;
private var iPx : float;

function Update()
{
movex = 0;
iPx = iPhoneInput.acceleration.x;

if (Mathf.Abs(iPx) > moveThreshold)
{
    movex = Mathf.Sign(iPx) * speed;
    transform.Translate(movex,0,0);
}

}

i was trying to add this code for controlling my unity controls