From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.help Subject: Re: (cperl-mode) Problems with syntax highlighting after __DATA__ ! Date: Fri, 22 Oct 2010 10:57:54 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87aam6nrst.fsf@lifelogs.com> References: <6dc535d1-ce05-449d-a3ff-d062f5e634d1@z28g2000vba.googlegroups.com> <55f6a9f1-fd98-4069-9bf8-8e3e550f36af@30g2000yqm.googlegroups.com> <5e32a127-1e53-4f9d-899f-6c1329a5b589@i5g2000yqe.googlegroups.com> <70e70be1-3110-4136-97a0-dd8d923591de@28g2000yqm.googlegroups.com> <87wrpeqjkb.fsf@lifelogs.com> <496a9e4f-414a-44c2-8f3e-a83071743a5c@a36g2000yqc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291898397 947 80.91.229.12 (9 Dec 2010 12:39:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 12:39:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 13:39:53 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQfmr-0006OD-14 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 13:39:53 +0100 Original-Received: from localhost ([127.0.0.1]:52891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQfmq-0003be-C3 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 07:39:52 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 54 Original-X-Trace: news.albasani.net j4qVCIFmc/7EGrip48MH1V5fW5g36yTnrQKmN5lAcVWC0Sck6HNqu9X8TAn4ueqVWS8wHtotvt/h0UDaoMRkIZg67x4lElLq2Z+2KRqG/RncijNzM99ESlCRgYcKLv4b Original-NNTP-Posting-Date: Fri, 22 Oct 2010 15:57:57 +0000 (UTC) X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Cancel-Lock: sha1:D9YpbmwWzAtYUBos2Omfou7QVD0= sha1:otO2oT3VuRjL9edodnXXMYSmfmI= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Injection-Info: news.albasani.net; logging-data="jRQ69uLaayGMOko+y9t3qtWiQfGvxfMif7RpxO0sxODpRwhSU9dBCoeMAydRPgIzR7khRzsbMpyho7WQccn3zpSvaOkyDUiU3+d/mhp1ICMaNknxQMU+0F6uo2f5MiPh"; mail-complaints-to="abuse@albasani.net" Original-Xref: usenet.stanford.edu gnu.emacs.help:181949 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77037 Archived-At: On Thu, 21 Oct 2010 04:43:43 -0700 (PDT) LanX wrote: >> I think it's not that bad.  __DATA__ is the same content (semantically) >> as a here-file, L> or a POD-section , i.e. natural solution would be comment-face. L> (like most other editors I tested do, just check vim) L> __END__ is practically the same as __DATA__ and Ilya is right those L> sections are terminated only by EOF. Theoretically they are practically the same, but in practice they are not. __DATA__ begins a section that can be used through the DATA filehandle. It's a true here-file without interpolation and has no syntax. __END__ ends the Perl program and any __DATA__ effects. Usually POD will follow but the Perl parser doesn't care (unlike =cut markers, which do matter to the Perl parser). The POD extractor, usually `perldoc', will care. So it's nice to the user to highlight it as POD. On Wed, 20 Oct 2010 19:40:30 +0000 (UTC) Ilya Zakharevich wrote: IZ> On 2010-10-19, Ted Zlatanov wrote: >> I think it's not that bad. __DATA__ is the same content (semantically) >> as a here-file, which perl-mode and cperl-mode can handle. IZ> Are you sure? I think if one would put the same breaks-CPerl content IZ> inside a here-doc, CPerl would slow down as well. AFAIK, here-docs IZ> are still facified; the result is just ignored. Well, you could try it... I will not presume to know the cperl-mode internals, I was just talking about parsing the sections when I said "it's not that bad." IZ> Hmm, on the other hand, if it is syntaxification which is slowed down, IZ> then yes - it should not be a lot of problem to skip stuff after IZ> __DATA__, since CPerl does syntaxification in one pass. Right. Perl won't parse after __DATA__ or __END__ no matter what. >> It always ends with EOF or with another __X__ marker on a new line. IZ> Eh??? AFAIK, it ends with EOF period. IZ> (The code to parse may have some special logic to find your IZ> __X__; but it may look for whatever it wants as well...) There are at least a few CPAN modules that care, e.g. Inline::Files and company. So I think it's nice to highlight every __X__ marker instead of special-casing __DATA__ (__END__ has to be special because it means POD will start, usually). Ted