title: Google Apps Script: strange "Missing ; before statement." error
body: <p>I'm writing a simple script to scrap some reporting numbers. I'm getting the error message "Missing ; before statement.", which doesn't seem to be an accurate description of the issue at hand. </p>
  
  <p>I've tried omitting pieces of the code but the error message seems fairly stochastic. I'm suspecting some issue with some of the classes I'm using, but I'm out of ideas. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>function getStats() {
    var stats = {'id': '',
                 'impressions': 0,
                 'clicks': 0,
                 'conversions': 0,
                 'cpa': 0,
                 'cost': 0},
        campaignIterator = AdWordsApp.campaigns().get(),
        campaign,
        campaignstats;
  
    Logger.log('Fetching stats for last 7 days.');
  
    while (campaignIterator.hasNext()) {
      var campaign = campaignIterator.next();
      var campaignstats = campaign.getStatsFor('LAST_7_DAYS');
      var stats['impressions'] = stats['impressions'] + campaignstats.getImpressions();
      var stats['clicks'] = stats['clicks'] + campaignstats.getClicks();
      var stats['conversions'] = stats['conversions'] + campaignstats.getConversions();
      var stats['cost'] = stats['cost'] + campaignstats.getCost();
    }
  
    var stats['cpa'] = stats['cost']/stats['conversion'];
  }
  
  function main() {
    getStats();
  }
  </code></pre>
  
  <p>Thanks for any help!</p>