From patchwork Thu Sep 27 05:41:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 187280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 0F5562C00AE for ; Thu, 27 Sep 2012 15:42:13 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1349329334; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=P4zjYHczcCJB7USWOPp8lY83Yl4=; b=roB81gRM12cYYDK Q6pZxApumyX/BqYYRZK0Wt4QIbHP720AsyXqqcngmmm7+DWQXgPfemQZwA9h1dE0 csin4wIF3RGxs+q6qa7nvPSWbc3TpkUh5EEq3pn+MEy21F3oBzmgXNbX333ol4sP ncQiVOI3pv4LVgOQDKvk6xSUQCKc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=IeAA6KADMH3KaD4m/rwU6hugXqvv8kjSE89RVR/tC6W/q6NtBhYbpnMDSQocna KxXrXyzDhUo/4Q+MBVPKTm+G0OELCmErRxtc+XpLCIx7LMQLqBkMMPtVk47niFO2 +yZOT98aZ6O3OxOS2ht1Xn9NnUzrqbakuYFia24zq3xns=; Received: (qmail 19495 invoked by alias); 27 Sep 2012 05:42:09 -0000 Received: (qmail 19215 invoked by uid 22791); 27 Sep 2012 05:42:08 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Sep 2012 05:41:55 +0000 Received: by pbbro12 with SMTP id ro12so3205291pbb.20 for ; Wed, 26 Sep 2012 22:41:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=YmtuWof+PdBv7gG9YuK8J14lLJRIjTX2L3rMjcq2lOw=; b=EST7/8OKnN55DubEaOOsuXaRvFaWzgiNXdAjaYQzl5qKMgrS5c1+eoUdwJsEpgCau0 tdO7ZMN40cfzkESsORR1zmdtq/3Y608xXkhrmP39Zoi0yFPUpEZcHrcNqMkVQlUJNfrY kY4skq/5DgQeklUEjtR2KC13CKb3yXig40rZTEODqxPjiEEiKdoKdk8CU7aGqZuB3L6L Q9HgXvj6l5SMwCqob9OI8Cl4OTLszHFp3WjAE1R4BZuIXJ2Sry3WmeXhUmts/V8AOJDx sZoE8urLPDmNbUcT/fvTANRZWVdGwUJ37McYp7LJhFWPxt+UQzjuiyEnSmrjuNS+zL3N SeOA== Received: by 10.66.78.194 with SMTP id d2mr6758120pax.42.1348724514979; Wed, 26 Sep 2012 22:41:54 -0700 (PDT) Received: by 10.66.78.194 with SMTP id d2mr6758098pax.42.1348724514855; Wed, 26 Sep 2012 22:41:54 -0700 (PDT) Received: from coign.google.com ([172.17.33.142]) by mx.google.com with ESMTPS id l3sm3158823pay.2.2012.09.26.22.41.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 26 Sep 2012 22:41:54 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Better error message for missing comma Date: Wed, 26 Sep 2012 22:41:52 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkFggcHUog3F9bADCdIl5oL/XGYvgt4bo1OyXGtmklYmTy6nWvEDkQ6cI5WEjoFb1RpO/np8X+4v2d6zi46JjkuqwW98n+8+7dlXYJm5hiJ35w9wIhHVdlfEFqUo3c26CU5xJ0igICj9pNVSvyT3GRaW/qMHELWCT1jWXs8FVqD7X0wTvoUwbJ+H46tozdBBUqeXLHL X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch to the Go frontend gives a better error message for a missing comma in a composite literal. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.7 branch. Ian diff -r f47f5449a663 go/parse.cc --- a/go/parse.cc Mon Sep 24 15:20:45 2012 -0700 +++ b/go/parse.cc Wed Sep 26 22:21:36 2012 -0700 @@ -2723,7 +2723,11 @@ } else { - error_at(this->location(), "expected %<,%> or %<}%>"); + if (token->is_op(OPERATOR_SEMICOLON)) + error_at(this->location(), + "need trailing comma before newline in composite literal"); + else + error_at(this->location(), "expected %<,%> or %<}%>"); this->gogo_->mark_locals_used(); int depth = 0;