Compiler Error that isn't actually an error??

I am receiving the following error:
Assets/Labyrinth/Script/menupressed.js(17,1): BCE0044: expecting }, found ".

The thing is, there is no quote anywhere near line 17, and also there is no line 17, the script ends on line 16.

Here is the script:

  function OnGUI()
  {
       if (menu)
       {
           GUI.skin = mySkin;
     
           GUI.Box (Rect (10,10,400,1000), "Main Menu");
     
           if (GUI.Button (Rect (85,50,250,30), "Resume game")) {
               menu = false;
           }
     
           if (GUI.Button (Rect (85,50,250,30), "Go to menu")) {
               Application.LoadLevel(0);
           }
       }  

Please help, thanks.

I formatted your code for you using the 101/010 button. In the future please do so yourself when posting code.

Once properly formatted and indented, it is easy to see that your are missing a closing } at the end.

It is actually telling you that it expected a } but found nothing. The error occurs on line 17 because it expects this bracket at the end.

By formatting your script properly the error becomes apparent:

function OnGUI() 
{   
    if (menu) 
    {
        GUI.skin = mySkin;
            
        GUI.Box (Rect (10,10,400,1000), "Main Menu");
             
        if (GUI.Button (Rect (85,50,250,30), "Resume game"))
        {
            menu = false;
        }
             
        if (GUI.Button (Rect (85,50,250,30), "Go to menu")) 
        {
            Application.LoadLevel(0);
        }
    }

The function OnGUI is missing its closing bracket at the end.