Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118670 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 6165 invoked from network); 20 Sep 2022 15:00:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Sep 2022 15:00:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 257BE1804AC for ; Tue, 20 Sep 2022 08:00:34 -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.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE 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-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 20 Sep 2022 08:00:33 -0700 (PDT) Received: by mail-yb1-f169.google.com with SMTP id a67so3799207ybb.3 for ; Tue, 20 Sep 2022 08:00:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=/7sFEfpVF2tbSGGm+D0DI5YJDs5SnwkCaU6aUi2hm/A=; b=fKCq6xRtDBACLxe9LlqVkVUxcTxE++lGJFpcOH7vvq8EYv3rlU54/q6dWmtBxTxDLR GYuf9XN8ilRSkAhemi34dcWDWX2U6d66yTgVkTB7SSBbrjGsxrNA+G5YN0YvOMQc2VSs 2koZZLBAJYI2yTi1E5GfJAhnRbKtc3xHyh1X8eEmfNq2cd5jABO0AYzpeMkHMp/cqIa8 UlfaM1X2Zc2eji9jXtMztVtyD6rJbVvQsf8nCUp5RQJPQRwQrDUI4y3eC1uG8oltvyrE 12HNoNxe9fIFpvBNUJEQcfwjtoO/tSX90TUy+sWEan9eHUDdUM8bq4PHwR3ojNjE2Mqk A87w== X-Gm-Message-State: ACrzQf1Wmbs39j8W8uqlA+nwsANy5MYOIacofvcMlgTzcGhCdTE6dDgf r0M/a2Sm28juwC7crSePGngdk9P657RtgN3+sSxBwA== X-Google-Smtp-Source: AMsMyM51UvU5rsvN7T2/NjrAybfRMiZm62DaHbq59qQEXpDW5yGxf0MfcVDoxcKAyboeMjnYUOTlKsbShYZEgjVJ0zQ= X-Received: by 2002:a05:6902:70f:b0:6af:281e:39ad with SMTP id k15-20020a056902070f00b006af281e39admr20830891ybt.136.1663686033125; Tue, 20 Sep 2022 08:00:33 -0700 (PDT) MIME-Version: 1.0 References: <1835622d2ad.e718af7c86636.4041752759703113661@limesurvey.org> In-Reply-To: Date: Tue, 20 Sep 2022 10:00:22 -0500 Message-ID: To: =?UTF-8?Q?Olle_H=C3=A4rstedt?= Cc: Internals Content-Type: multipart/alternative; boundary="00000000000005c77c05e91d17ea" Subject: Re: [PHP-DEV] One-line heredoc for better syntax highlightning From: pollita@php.net (Sara Golemon) --00000000000005c77c05e91d17ea Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 19 September 2022 15:24:26 BST, "Olle H=C3=A4rstedt" < olle.haerstedt@limesurvey.org> wrote: >Some editors can guess the domain-specific language inside heredoc, e.g. if you do > >$query =3D <<SELECT * FROM foo >MySQL; > >It would be nice if this feature could be used in single lines as well: > >$query =3D << Good news! This feature exists and was introduced by Rasmus **checks notes** about 25 years ago. To use it, you'll want to hold down your shift key, then press the key just to the left of your enter key. This is called a "quote", and you can see it demonstrated here around the word quote. Hope that helps! Seriously though, I know you're looking to help your editor find something to syntax highlight, but this is an editor problem, not a PHP language problem. If your editor can detect SQL in heredoc, then it should be able to improve and find it in interpolated strings. Making the parser more complex for no benefit to the actual language (some detriment, I would argue) is not the fix here. -Sara P.S. - Yes, I'm assuming a US layout, you know where your quote key is. --00000000000005c77c05e91d17ea--