Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110766 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20739 invoked from network); 29 Jun 2020 09:41:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jun 2020 09:41:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2714B1804C2 for ; Mon, 29 Jun 2020 01:30: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, WEIRD_QUOTING 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-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 01:30:11 -0700 (PDT) Received: by mail-io1-f45.google.com with SMTP id q8so16234172iow.7 for ; Mon, 29 Jun 2020 01:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=94IkAB5q8J57HV0lK322Es7Hh6m2VwJkPxNZ5as3mao=; b=RP2er387xyhnr9WB+T5WHnOs2JMEr9KEvymvuzG9kwiegkRQWLfLhC+9RovSPGAX6n bxFs6bksIxDc0hboAJDrHUEBlJWzgSlTgSn1F3J6euTx3Xd6yir6r/AWpCaYT5PvRtvp 0osdOkF2mNCwf6Li1dWApfOoZPXuBF9rekQZtQNrfL0WVBrMvIiVr1mLxH6v+QvOJzvC uKgpu3+a6XSxayrz25V7VvdONoMe9I2O+fh3OmONOE90mRH/kadZoQwo/dXk8e5piiDg 5Zc66U0ikw5nWcKFFjYKoUUWw0F8Zi/IJ9bBBCosAKF0m51QnVHQN9pv/qLag8KUITMJ ecCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=94IkAB5q8J57HV0lK322Es7Hh6m2VwJkPxNZ5as3mao=; b=VRDNopeg91KUMKuoXxH58/xWrWLatZa7BwcmlVfQN6QfxnAF7cMu1jwMOneSaUPQ+1 GIl5gSCfyQbVlD7ztR9bHxoZbNdFDGnfBdYHwFqiR2iOp5IdxRMcZkpTN3woEEG2rtI3 YiOb40IByQTEXEQ8l/dbhOVFYjxgjMOKUdVahKeK17ISwJ5yRUnnNS6YRE4bJR+pW4rz tLWGxeKLdOBICIxzdLRurHhBleOSMHejGgeZARaZyHQYAWujUavj45uezwhu56W0wKEA B9CsU2ZjCPVqsfmFFY77bJruwRHDjBXIrgeKqgwZ78m6hGvRCae3cbQd0iAfhahJPJ7A F4MQ== X-Gm-Message-State: AOAM532eLeNhpCdv6zN1QFAFv3cGnKOjjkwad+pwwDW5EaxWtiN5aEo1 8kKMAqj+jQtl1miSUxff8PepHU9CTNNQFNafEw6VVO6w X-Google-Smtp-Source: ABdhPJw6GAZ+8HofZkTwp1RORKdaHIbgLYlXpybEXXgbNuQUYnmcUqmAt2vOqmkedajHUaatAj5Kg58Mr7X8hnFltAY= X-Received: by 2002:a02:1a08:: with SMTP id 8mr16067841jai.124.1593419408209; Mon, 29 Jun 2020 01:30:08 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 29 Jun 2020 09:29:56 +0100 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="000000000000cdfa8305a934ddc6" Subject: Re: [PHP-DEV] Improving output of syntax errors From: rowan.collins@gmail.com (Rowan Tommins) --000000000000cdfa8305a934ddc6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Claude, On Mon, 29 Jun 2020 at 07:27, Claude Pache wrote: > > > > As a special-case, quoted strings show the string's *content* in double > quotes, e.g. 'unexpected quoted string "foo" ...' rather than 'unexpected > quoted string ""foo"" ...' or 'unexpected quoted string "'foo'" ...'. > > For me, in this case, you have dropped the wrong pair of quotes. That is, > I prefer to see the quotes used in the source text (=E2=80=9Cunexpected s= tring > 'foo' ...=E2=80=9D or =E2=80=9Cunexpected string "foo" ...=E2=80=9D), ove= r the quotes that make > error messages consistent with other error messages. This is because I li= ke > to have hints that help me to visually identify the offending string in t= he > source text when it is of length 0 or 1, but on other hand I don=E2=80=99= t care > about consistency across error messages. > 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. 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. I can re-visit that part if you feel strongly, though. Regards, --=20 Rowan Tommins [IMSoP] --000000000000cdfa8305a934ddc6--