From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12849 invoked by alias); 2 Jun 2015 17:58:31 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35370 Received: (qmail 6510 invoked from network); 2 Jun 2015 17:58:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=oyiUi6af6mNzIvKY/ZkxtbhfRV1A2R85ZRT3MEZkS6Q=; b=OoD7c7B72OMm08/nTmlnNczYr3NNZ6UxN2vfWsTXxmGKwrmhBPn+UUwGCe+q3CHxZx peQ6gVExscqqSBKj1c2tu1fFYz9xtLmQWmmQ++33LKwQvBRC6NuNjORgv6943UPgc7Sz T8fY/iflnY1z4A83lVbdaz9f1fdEWWjlNqT9piDpXicc00AEdXUQjdIvB0fCdtUm9dcD qPi1l9cjTlxKJiEhW7MmFAkPE+QKcTU43RYsqf1EYaoi9ttgYblOD4CoKFZFr1LEaz0m JMbRbeGbAkrFkjd3s4nBdCXmn3/jVcOczAfHtQLLFRQ59AM+zSu1L6Y5Aht1VVM0oi9x VHug== X-Gm-Message-State: ALoCoQmai1ykyHKaxHioF0wrZBffSyWMoZLEehqtMk4Q0SNBBOzZiFu1kCpCfHIK4eTQOxQOhutY X-Received: by 10.182.128.234 with SMTP id nr10mr172329obb.81.1433267906105; Tue, 02 Jun 2015 10:58:26 -0700 (PDT) From: Bart Schaefer Message-Id: <150602105822.ZM4076@torch.brasslantern.com> Date: Tue, 2 Jun 2015 10:58:22 -0700 In-Reply-To: <556C890E.80506@inlv.org> Comments: In reply to Martijn Dekker "Arith expansion accepts extra closing parenthesis" (Jun 1, 6:32pm) References: <556C890E.80506@inlv.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Arith expansion accepts extra closing parenthesis MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 1, 6:32pm, Martijn Dekker wrote: } Subject: Arith expansion accepts extra closing parenthesis } } I just found some more arithmetic parsing strangeness. zsh 5.0.8 and } 4.3.11 both happily accept and ignore one (1) extra closing parenthesis } } % X='1)' } % echo $((X)) } 1 Easier way to see this: % let "1)" % It appears mathparse() around lines 1566-1568 of math.c consumes one token of lookahead with zzlex() and inadvertently discards it when it turns out to be a close-paren. This is partly because of the pseuedo- precedence assigned to M_OUTPAR "for convenience". I'm not sure what the correct fix is; maybe checkunary() should throw an error on M_OUTPAR?