Error I don't know how to fix

Heres my code:

#pragma strict

var text : GUIText;

var object : GameObject;

var diamond : Sprite;

var circle : Sprite;

var triangle : Sprite;

var square : Sprite;

var number : int;

var spriteRenderer; 

var target : Timer;

var AcceptInput : boolean = true;

static var score : int = 0;

static var guiScore : GUIText;


function Start () {

spriteRenderer = object.GetComponent(SpriteRenderer);

number = Random.Range(1,4);

if(number == 1) {

spriteRenderer.sprite = diamond;

}

else if(number == 2) {

spriteRenderer.sprite = circle;

}

else if (number == 3) {

spriteRenderer.sprite = triangle;

}

else {

spriteRenderer.sprite = square;

}
}


function Update () {

if(Input.GetMouseButtonDown(0)) {

if(AcceptInput) {

AcceptInput = false;

text.enabled = false;

target.enabled = true;

Debug.Log("Clicked");

if(object.GetComponent(SpriteRenderer).sprite == diamond) {

score += 1;

guiScore.text = "Score: " + score;

StartCoroutine("YieldTestEnumerator");

spriteRenderer = object.GetComponent(SpriteRenderer);

number = Random.Range(1,4);

if(number == 1) {

spriteRenderer.sprite = diamond;

}

else if(number == 2) {

spriteRenderer.sprite = circle;

}

else if (number == 3) {

spriteRenderer.sprite = triangle;

}

else {

spriteRenderer.sprite = square;

}

}

if(object.GetComponent(SpriteRenderer).sprite == circle) {

Debug.Log("Wrong Answer!");

Application.LoadLevel("GameOver");

}

if(object.GetComponent(SpriteRenderer).sprite == triangle) {

Debug.Log("Wrong Answer!");

Application.LoadLevel("GameOver");

}

if(object.GetComponent(SpriteRenderer).sprite == square) {

Debug.Log("Wrong Answer!");

Application.LoadLevel("GameOver");

}

if(Input.GetMouseButtonUp(0)) {
AcceptInput = true;
}
}
}

function YieldTestEnumerator () {
yield WaitforSeconds (0.5);
}

but it gives the following errors:

Assets/Scripts/GAME/buttons/Diamond.js(142,10): BCE0044: expecting (, found 'YieldTestEnumerator'.
 
Assets/Scripts/GAME/buttons/Diamond.js(142,32): UCE0001: ';' expected. Insert a  semicolon at the end.
 
Assets/Scripts/GAME/buttons/Diamond.js(145,1): BCE0044: expecting }, found ''.

But I don’t find anything wrong with this last bit:

function YieldTestEnumerator () {
yield WaitforSeconds (0.5);
}

All of the errors seem to be in that area. Do you have any ideas?

You need to close your Update loop.

You need to put a closing bracket before the function YieldTestEnumerator () {

So it would become:

if(Input.GetMouseButtonUp(0)) {
    AcceptInput = true;
}
}
}
}