Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110767 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38537 invoked from network); 29 Jun 2020 10:53:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jun 2020 10:53:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5C69A1804C2 for ; Mon, 29 Jun 2020 02:42:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 29 Jun 2020 02:42:11 -0700 (PDT) Received: by mail-ed1-f48.google.com with SMTP id b15so12247742edy.7 for ; Mon, 29 Jun 2020 02:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=GTakpnCIjZWAMkHccCAF7VNBN0vTkvvdzaQiRT5/liA=; b=UKCV0r+ZNmy7iRJmVxrnZh8ylC8ZxIqk2Vx5P5CQKrfOW8K74exBgQvshnu8SDB99Q LzgYQ6wVY7aAm+Qz46pDNoLaRd3XXwzuos6lBs1f9sc213uwfgVoXoL5/yXQ5kECx98+ se79SnDbB65f5CcSfWWOq14pTmga5g3Dxa24/Ov7t5Eg8RhFkBfJu3WgUQ1oB3Gl/Are gcGNcPlGP3+ofdoHYKr/GnFC0wJOOSI3imPIw+ir34LoKof8ICYYmDCtAHTc8fyybqD0 MdP7hyDsr2h/1RPQa6QMg1D3ef6lFKtYq6Gee3XIFTxdjog/mJFLWnbidiwNSEBCXLqw XWjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=GTakpnCIjZWAMkHccCAF7VNBN0vTkvvdzaQiRT5/liA=; b=nhZhOHwq/vV/aS3wAIgTn6VX36BogYjMgDpxnijYYYoWqdMo/4AeyOxDMO1R7BTfRg agXlefMEjRe5s1wp24X6XO/c4YA2VoDZIFk6xZPBOewLhQnb7rN+oE82fSFy+C1jndMh pe3INymt/dN3gS5Sj3/Yzg3R9Ban8hlX/xkeFHgCAmfGUy9rsCV8kPoCPtHnThKlsfl2 IJxzga0dTMhNtssxosoM6QXH/TCG1xpW0IZdtzKv6abe3/x4FMGBtbYnYRXsuBawgk2T JmKhZquQaOdD+e3ajBvQPm/HKJe6eQupASAhEUvJuLQH5/51/ObLDIkbrPlZZBMlyP8T OHMQ== X-Gm-Message-State: AOAM532PURmr6U0Q2zjUPModcDqD6lYWs1eGv9eR2Fh0HOaRmhBgcJGD 206au6JTCvoH1C5OZKXtKQA= X-Google-Smtp-Source: ABdhPJz5XcBFbSr5ki7JS7ccmWTZei1uJd8GHzt32GSJFom9zZIFG6xh66COHVfY5i5p+KclO/JwnA== X-Received: by 2002:aa7:cd50:: with SMTP id v16mr10140603edw.252.1593423729916; Mon, 29 Jun 2020 02:42:09 -0700 (PDT) Received: from claude.fritz.box ([185.129.54.56]) by smtp.gmail.com with ESMTPSA id rv16sm15807418ejb.60.2020.06.29.02.42.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 02:42:08 -0700 (PDT) Message-ID: <0915B96B-DFF1-4F24-993B-350D36EB9A74@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_B70BDCD1-E63A-46AF-A1B1-1054ECCEB4B2" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Date: Mon, 29 Jun 2020 11:42:07 +0200 In-Reply-To: Cc: PHP Internals To: Rowan Tommins References: X-Mailer: Apple Mail (2.3608.80.23.2.2) Subject: Re: [PHP-DEV] Improving output of syntax errors From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_B70BDCD1-E63A-46AF-A1B1-1054ECCEB4B2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 29 juin 2020 =C3=A0 10:29, Rowan Tommins = a =C3=A9crit : >=20 >=20 > I did actually have strings matching the quote marks used in an = earlier > version of the patch, but dropped it partly to simplify the = implementation > - because it sometimes truncates strings, it can't just use the real > quotes, but has to strip and re-add them. >=20 > The consistency should aid anyone trying to parse the error message, = since > the pattern /unexpected ([^"]+) "(.*?)"/ will always give you a token = name > (even if just 'token') and its content. >=20 > I can re-visit that part if you feel strongly, though. At this point, I don=E2=80=99t feel strongly, because currently, when I = see =E2=80=9Cunexpected '''' (T_CONSTANT_ENCAPSED_STRING)=E2=80=9D, my automatism is not looking for a string with specific quote style = (which is not evident by looking at four consecutive quotes), but for a = missing or misplaced punctuation mark, because, by experience, it is = most of the time the root cause of an error message containing that = specific token name. Another way to give the programmer the appropriate information, is = replacing =E2=80=9Cquoted string=E2=80=9D with =E2=80=9Csingle-quoted = string=E2=80=9D and =E2=80=9Cdouble-quoted string=E2=80=9D. And while I am thinking about it: a case that tends to cause divergent = squint is: unexpected '"', which you changed into: unexpected token """. = In that specific case, it would be nice if it the common name of the = offending token was spelt out, something like: unexpected double = quotation mark. =E2=80=94Claude= --Apple-Mail=_B70BDCD1-E63A-46AF-A1B1-1054ECCEB4B2--