Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111053 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80097 invoked from network); 16 Jul 2020 20:19:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Jul 2020 20:19:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AD0E8180539 for ; Thu, 16 Jul 2020 12:12:58 -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-Virus: No X-Envelope-From: Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 ; Thu, 16 Jul 2020 12:12:58 -0700 (PDT) Received: by mail-lj1-f173.google.com with SMTP id e8so9599815ljb.0 for ; Thu, 16 Jul 2020 12:12:58 -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 :cc; bh=SlazD9tXPP1yfLoMuhCV2njEJ6lLH0xO0nE5+Gh8qnc=; b=Taf9yMc+1ta5GC+Qdt74TwMAlNCWkd81rER0sKmEWgH5PydgC3L5EwijgbPE8d3kw/ VFDGnAXociFFz9Jhj63zdGIF3Zz8J1bdsgFCEaeAGK0kVwQ0WpJGPGIcKyG8+3PXk58n erV17mZ49bhqVGeIz3yJzNkDicqZjpRpcorIUaCt/rAMYBzQpYMvqB39FLojDzzba1ah N5raU3RURgRlQOBVyDOa625F6hsq010SAhOUl7c2+AaIS8jCih+4l9SicZ4V3jWpy40N Y62DNTKfzAWRT/Ixyf9dqPDTJpoMbYNhMobmldSImxuHEKv1EDbB3VoxGBAyTKyms/Ir o0QA== 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:cc; bh=SlazD9tXPP1yfLoMuhCV2njEJ6lLH0xO0nE5+Gh8qnc=; b=atuxrH5SoF6psPEl3Tq5HmtJfMu4+vppbiGOYyJM4Cws2FRRPSs+uGILwLl25sia9q ss1AzA5DBiR6rlGxL4GA8Way1F/nW4CVEzvS67qGnaZUgWC/gAgB5TmkdevDj/HWbdrt fUhB29C9di4QzpHPkH3QdlydeKyi0nN2vExkrPskkG37BboiNBfGbZliM2dFuDgyRwlf tI0JAS3ZdShuycI+74a+bgVQtFtHUT+7EbCzsxioDOKwchIamdUpK8bpTtH1vVSnAzHy Sewir0CZWQ8Ud16is+bfaKoeA13Oj4rbZX4dRPwR4Cb4JUyGXHoxUT36qksPNqG89NHL B8vQ== X-Gm-Message-State: AOAM533VA4T/8JyuBP7xVxM8yo8anLDUmpyUNhtgnQns8GaAXljn4i3f ibYk4ZhOoqa/0NZwnuVll2SZxSBwYnQERAiClSw= X-Google-Smtp-Source: ABdhPJwrJ8wIGq0DeemhyPV1eHHPUqCGqRGfHrY/FBTGbjEjcw2fYi/fwci10JLYL7QdvAYEW68C6uR+E3aOMfNqG4E= X-Received: by 2002:a2e:850b:: with SMTP id j11mr3009882lji.30.1594926775891; Thu, 16 Jul 2020 12:12:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 16 Jul 2020 21:12:39 +0200 Message-ID: To: Theodore Brown Cc: tyson andre , PHP internals Content-Type: multipart/alternative; boundary="000000000000eb7b5905aa93d3d4" Subject: Re: [PHP-DEV] Re: [RFC] Treat namespaced names as single token, relax reserved keyword restrictions From: nikita.ppv@gmail.com (Nikita Popov) --000000000000eb7b5905aa93d3d4 Content-Type: text/plain; charset="UTF-8" On Thu, Jul 16, 2020 at 3:00 PM Theodore Brown wrote: > On Thu, July 16 2020 at 3:04 AM Nikita Popov wrote: > > > While I don't think anyone had plans to mix whitespace, this is > > indicative of a larger issue. While I'm one of the people who voted > > for @@ as my first choice before, I wouldn't do so now (even with > > this RFC accepted). This issue made me realize that there is more at > > stake here than just "which syntax is prettier?" and choices that > > have a "closing tag" are technically more favorable, especially if > > we consider future extensions of the attribute system that may > > introduce additional ambiguities (e.g., Rust allows placing > > attributes pretty much everywhere in code -- how sure are we that > > there will be no unanticipated ambiguities?) > > Hi Nikita, > > Can you think of an example that would cause an ambiguity even when > namespaced names are treated as tokens? As I understand it, there > can't be an ambiguity, since there would always be an attribute token > followed by a class name token. It should be possible to put this > anywhere it makes sense without ambiguities. > Yes, there should not be any ambiguities at present. This is more of a vague unease when it comes to future language extensions. To give an example: Let's say that in the future, we allow annotations on statements, and introduce generics using the ClassName{T} syntax (it's unlikely we'd actually do that, even though this is the "least ambiguous" generics syntax). Now, if attributes are just classes, it would stand to reason that you can use something like @@OfType{int} as an attribute. If we combine these two language changes, we get @@FooBar { SomethingComplexHere } where SomethignComplexHere could be interpreted both as a type or an expression. This does not cause a "true" ambiguity, but it does add an infinite lookahead parser requirement, because we will only know how to interpret this at the }. It could be an attribute with a generic parameter, or it could be a non-generic attribute on a code block. Of course, it is more likely than not, that we will not encounter any issues of that nature. Nikita --000000000000eb7b5905aa93d3d4--