Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86091 invoked from network); 23 Jun 2011 18:21:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2011 18:21:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=dragoonis@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dragoonis@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: dragoonis@gmail.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:36203] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/00-19628-424830E4 for ; Thu, 23 Jun 2011 14:21:24 -0400 Received: by iym1 with SMTP id 1so2075091iym.29 for ; Thu, 23 Jun 2011 11:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mvItMGMypE+0Jd+yamQqu/dCTv4PVwPKeru8zBqh4wQ=; b=oFIGE4n6GXZgV98QMeD2lE5ttXOWeLB71EvyKAfbbnsB0Noti6RuXE9+G+Gh4Myz/N V9daJLv9m+edH+XG8yqtNMZjrTWWw6REVECAilNPqgJd/vWk7tTC5R8o9o7Atpy9f83S IHcd4zekL3qjxnkRzQDTQuo9k7Lgesnc1hauo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=KQlAU/2YqvUQMrhAmqWa/CQf4odc7DNZgbT2uskEXHXkUPEQ2xHi3r7daeiLfPUi9S +2X7S+6/efuviaM9ocj8WLRc05PJkK5iCej6Rh/5oJMvOnsQNn6VFq93X3ZqxB5R2UQm Ez/r0t0SoCXt9iv6nBKSixS/lwxb/qrkuhIx8= MIME-Version: 1.0 Received: by 10.42.142.136 with SMTP id s8mr2546730icu.209.1308853280372; Thu, 23 Jun 2011 11:21:20 -0700 (PDT) Received: by 10.42.108.70 with HTTP; Thu, 23 Jun 2011 11:21:20 -0700 (PDT) In-Reply-To: <4E0382EC.10309@seld.be> References: <887FE7CFF6F8DE4BB3A9535F53AFD06A492D09D2@il-ex2.zend.net> <4DD2A731.9000400@sugarcrm.com> <4E0382EC.10309@seld.be> Date: Thu, 23 Jun 2011 19:21:20 +0100 Message-ID: To: Jordi Boggiano Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=90e6ba6e8edad6f67604a665265a Subject: Re: [PHP-DEV] Re: [RFC] Improved parser error message From: dragoonis@gmail.com (Paul Dragoonis) --90e6ba6e8edad6f67604a665265a Content-Type: text/plain; charset=ISO-8859-1 On Thu, Jun 23, 2011 at 7:16 PM, Jordi Boggiano wrote: > Thanks for the great work. More should be done on the front of helping > newcomers solve trivial issues imo. > > On 23.06.2011 20:08, Felipe Pena wrote: > > $ sapi/cli/php -r 'class ' > > Current: > > Parse error: syntax error, unexpected $end, expecting T_STRING > > > > Patched: > > Parse error: syntax error, unexpected end of file, expecting > > 'identifier' (T_STRING) > > identifier should not be quoted. The quotes are fine for "expecting '{'" > and "unexpected 'foo'" because those are text literals, but this implies > you were supposed to actually type "class identifier", which is > obviously not the intended message. > > > $ sapi/cli/php -r 'class abc foo' > > Current: > > Parse error: syntax error, unexpected T_STRING, expecting '{' in > > Command line code on line 1 > > > > Patched: > > Parse error: syntax error, unexpected 'foo' (T_STRING), expecting '{' > > in Command line code on line 1 > > > > > > As can be noticed, I added the actual scanned string in the > > "unexpected" part. This might be useful for finding really which makes > > the parser error. (It was a bit tricky though :D) > > Good stuff, maybe "unexpected string 'foo' (T_STRING)" or "unexpected > string (T_STRING) 'foo'" would be more clear, but no big deal really. > > Cheers > > -- > Jordi Boggiano > @seldaek - http://nelm.io/jordi > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Good work Felipe! the $end was very ambiguous :-) --90e6ba6e8edad6f67604a665265a--