Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111606 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93269 invoked from network); 18 Aug 2020 08:27:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Aug 2020 08:27:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 39A09180089 for ; Tue, 18 Aug 2020 00:29:00 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 ; Tue, 18 Aug 2020 00:28:59 -0700 (PDT) Received: by mail-wm1-f52.google.com with SMTP id k8so16003028wma.2 for ; Tue, 18 Aug 2020 00:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seld-be.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=FxWfQ6/Yq87DUVfDveQRnASGOSK0CeXKO/T1ryR9XLY=; b=0ovnEFCAMM9VOXooIEcT1gb+gDyapynAqAI+rnerTz2s2lI/WE0DCCBHmb1gtLYWgV ZuPuv3Fc+N2xtUZs5RknZZLcpcAXO8LkAJB5+0affUkKvBH5rAR4m+NJ15uKocuNbccz jDKKeUQ+bgamPmE1wE2EePyCBl8K7PWo/eNYABnqjkbq6PbipdyJB4UMHsPcCC5BxndP gRECTQgfzec8/QCXcVYE1USergNrNQvX1qnoEXegkc8fp/r5DBO9d4LkfZFV5dErbBA5 4363mdYqIxLBN36T9uQu74Zp6PDCRtHCH2senMLdlWDAvAv5PlGV3Y13UI4+exQFo7+E yzWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=FxWfQ6/Yq87DUVfDveQRnASGOSK0CeXKO/T1ryR9XLY=; b=gB4PuD7AXLpCTioCf3o7wNUuCQYRy1snjA1Q+dCa9nwCdhFT9RbcAiuojLd7d9yLXg HvSCHmp1lc5XtQGZEbjiZ8npXnrOfZHppk1Pure1wPaGrWM2aCNwE2nj9VPUy6yQ3lo+ WAMrzWBNSkMofwFwhyJlQ8SpqTyasUELgOLRhnN5N5NI5HBnXsh387EIpU1cHJZEZ34N WleEj2JXZcSGYD244xslmpm2KkV4NjrSy4cBpeP8fcRlO17A+mIuGch8Z/5R1mJDz4G7 6fZiz9UvDAA5VWdQakRrMjDgcHdEY2E8ygYtP8ywqBGHVWpWeqarzZEyI7/OmxmA9CCY VgeA== X-Gm-Message-State: AOAM530v9ErEPvI6OAD6sszV9ScfQ4OkQWFV4YAZvQBrsNwa6MKnV9t+ iJZO4tgPefo1bulH38kQvu8Oy5JpnkPYZw== X-Google-Smtp-Source: ABdhPJx6ydmrpO9T3M8HHwqivvju+Zw/KjedCab5ew9Oz9ZJ0/NxiHrQvhsr4ewx12gi1qWAkZfuow== X-Received: by 2002:a1c:a54e:: with SMTP id o75mr18687843wme.181.1597735737000; Tue, 18 Aug 2020 00:28:57 -0700 (PDT) Received: from [192.168.1.220] ([212.51.156.18]) by smtp.gmail.com with ESMTPSA id b11sm30283306wrq.32.2020.08.18.00.28.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Aug 2020 00:28:56 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <3420326b-9853-2d65-3ba5-dcecec785dec@seld.be> Date: Tue, 18 Aug 2020 09:28:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2 From: j.boggiano@seld.be (Jordi Boggiano) Hi Benjamin, >> ## Easier machine parsing? >> >> The RFC shows a list of different ways that attributes with the `@@` >> syntax can end, and claims "This makes programmatic token based >> scanning for attribute syntax without a closing delimiter such as `@@` >> unnecessarily complicated." >> >> But I've worked with userland token stream scanners myself, and it's >> not difficult to skip `T_WHITESPACE` and `T_COMMENT` tokens. Once you do >> that, parsing an attribute is as simple as finding any `T_ATTRIBUTE` >> token followed by the name token, then checking for an optional >> argument list. If there's not an argument list, that's then end of >> the attribute, otherwise the end is the end of the argument list. >> >> With the `@[]` and `#[]` syntaxes, a userland token parser is actually >> *more* complex due to grouping. It not only has to do the same things >> listed above, but it also has to check whether there are multiple >> comma-separated attributes between the start/end delimiters (making >> sure not to confuse a comma-separated attribute with a comma-separated >> argument, or the end of an array argument with the attribute end >> delimiter). >> >> So I don't understand how the RFC can claim that attributes without >> an end symbol "introduce additional complexity" for machines, when if >> anything the opposite is true. >> >> (And don't get me started about the extra difficulty for token stream >> scanners with the `<<>>` syntax which has no `T_ATTRIBUTE` token). I noticed you did not answer this point at all, I know there are lots of emails to reply to but IMO this is quite an important dismissal of one of the few technical arguments made for grouping, and also something I tried to hint at on Twitter back on Sunday.. Reading the RFC again now, IMO the whole "Machine Scanning for End of Attribute Declaration" section should be removed. From the points left, only "Potential Future Benefits of Enclosed Delimiter Syntax" is technically valid but really dependent on what we see as interesting future use cases. The rest is rather subjective and thus not really worth discussing, it'll be up to everyone's preference. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be