Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91845 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3460 invoked from network); 22 Mar 2016 13:25:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Mar 2016 13:25:40 -0000 X-Host-Fingerprint: 89.177.147.161 ip-89-177-147-161.net.upcbroadband.cz Received: from [89.177.147.161] ([89.177.147.161:21785] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/27-46740-2D741F65 for ; Tue, 22 Mar 2016 08:25:38 -0500 To: internals@lists.php.net Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes References: Date: Tue, 22 Mar 2016 14:25:28 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/1.0 (Win32) X-Posted-By: 89.177.147.161 Subject: Re: [PHP-DEV] RFC about automatic template escaping From: j.tvr@centrum.cz (=?utf-8?Q?Jan_Tvrd=C3=ADk?=) On Tue, 22 Mar 2016 14:01:09 +0100, Craig Duncan wrote: >> >> >> Why do you assume that Latte parser is limited by regexp ability to >> parse >> HTML? > > > Because it is: > https://github.com/nette/latte/blob/19b759b550caaad75ca0dee5f0d85f9ffb59c845/src/Latte/Parser.php#L124 No. That argument would only be valid, if the parser consisted only of a single regexp. When you combine PHP code with PCRE you loose nothing from PHP's turing completeness and it's ability to parse HTML. That being said I'm not claiming that Latte parser is 100 % correct HTML parser (neither is most existing HTML parsers in the world). I'm saying that it could be (to the extend of what's possible to statically analyze, i.e. if editor could highlight the code properly). Regards, Jan Tvrdik