<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<!-- MHonArc v2.6.10 -->
	<channel>
		<title>dltk-dev</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/maillist.html</link>
		<description>dltk-dev</description>
		<language>en-us</language>
		<pubDate>Tue, 22 May 2012 01:30:08 GMT</pubDate>
		<lastBuildDate>Tue, 22 May 2012 01:30:08 GMT</lastBuildDate>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<generator>MHonArc RSS 2.0 RCFile</generator>
		<managingEditor>webmaster@eclipse.org (Webmaster)</managingEditor>
		<webMaster>webmaster@eclipse.org (Webmaster)</webMaster>
		<image>
			<title>dltk-dev</title>
			<url>http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/eclipse_home_header.jpg</url>
			<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/maillist.html</link>
		</image>
 

	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02197.html</link>
		<description>hello all - &amp;#xA0; just a quick update...&amp;#xA0; i&amp;#39;ve managed to get heredoc scanning working for the simple case of:&amp;#xA0;&amp;#xA0;&amp;#xA0; &amp;lt;&amp;lt;EOF;&amp;#xA0;&amp;#xA0;&amp;#xA0; blah&amp;#xA0;&amp;#xA0;&amp;#xA0; EOF&amp;#xA0; and the slightly more complex case of: &amp;#xA0; &amp;#xA0;#xA0;&amp;#xA0; &amp;lt;&amp;lt;EOF . &amp;quot;foo&amp;quot;;&amp;#xA0;&amp;#xA0;&amp;#xA0; blah&amp;#xA0;&amp;#xA0;0; EOF&amp;#xA0; stacking heredoc, however,&amp;#xA0;;&amp;#xA0; &amp;lt;;THIS, &amp;lt;;TH...</description>
		<content:encoded><![CDATA[hello all - <br><br>&#xA0; just a quick update...<br><br>&#xA0; i&#39;ve managed to get heredoc scanning working for the simple case of:<br><br>&#xA0;&#xA0;&#xA0; &lt;&lt;EOF;<br>&#xA0;&#xA0;&#xA0; blah<br>&#xA0;&#xA0;&#xA0; EOF<br><br>&#xA0; and the slightly more complex case of:<br>

&#xA0; <br>&#xA0;&#xA0;&#xA0; &lt;&lt;EOF . &quot;foo&quot;;<br>&#xA0;&#xA0;&#xA0; blah<br>&#xA0;&#xA0;&#xA0; EOF<br><br>&#xA0; stacking heredoc, however,<br><br>&#xA0;&#xA0;&#xA0; &lt;&lt;THIS, &lt;&lt;THAT<br>&#xA0;&#xA0;&#xA0; this<br>&#xA0;&#xA0;&#xA0; THIS<br>&#xA0;&#xA0;&#xA0; that<br>&#xA0;&#xA0;&#xA0; THAT<br><br>&#xA0; is still giving me some problems. if i can&#39;t figure it out in another day or so, i&#39;ll clean up what i have and submit for a larger audience. <br>


<br>-- <br>-jae<br>
]]></content:encoded>
		<pubDate>Tue, 22 May 2012 01:24:37 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02197.html</guid>
		<author>jgangemi@xxxxxxx (Jae Gangemi)</author>
	</item>


	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02196.html</link>
		<description>&amp;#xA0; yeah - i noticed that if the fContentType matches whatever the default success token is, it will use that rule to continue evaluation.&amp;#xA0; i use a unique partition type for all of my partitions except singe and double quotes, which share the same one. perha...</description>
		<content:encoded><![CDATA[<br>&#xA0; yeah - i noticed that if the fContentType matches whatever the default success token is, it will use that rule to continue evaluation.<br><br>&#xA0; i use a unique partition type for all of my partitions except singe and double quotes, which share the same one. perhaps i should change that though after reading this...<br>
<br>&#xA0; depending on how the final implementation winds up, you will probably need to use separate content types to distinguish between when D has an identifier in it&#39;s heredoc and when it doesn&#39;t.<br><br><div class="gmail_quote">
On Fri, May 18, 2012 at 12:28 PM, Bruno Medeiros <span dir="ltr">&lt;<a href="mailto:bruno.do.medeiros@xxxxxxxxx" target="_blank">bruno.do.medeiros@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>&#xA0; actually, i just went and re-read the wiki page, shouldn&#39;t this be simple for D?<br><br>&#xA0; you&#39;d just need multiple multi-line rules that look something like this (not sure if there is an escape char):<br><br>


&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q(&quot;, &quot;)\n&quot;, token, (char) 0, true);<br>&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q{&quot;, &quot;}\n&quot;, token, (char) 0, true);<br><br>&#xA0; no? <br><div><div><br></div>
</div></blockquote></div><br></div>Actually, there&#39;s another bug here, and it&#39;s a tricky one, so heads up in case you might run to into in similar code on own work: If you use different rules to match the same token, the partitioner can at some times (especially for multi-line rules) try to resume scanning (look only for the end of the partition starting from the middle of it) using a rule different from the one that started the partition. So code like this:<br>

<br>q(<br>blah<br>}<br><br>might be scanned correctly as a partition of that token type, because one rule would start it, but another rule might end the scanning successfully. I mentioned this in more detail in this Eclipse bug:<br>

<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=346723" target="_blank">https://bugs.eclipse.org/bugs/show_bug.cgi?id=346723</a><span class="HOEnZb"><font color="#888888"><br><br><br>-- <br>Bruno Medeiros<br>
</font></span><br>_______________________________________________<br>
dltk-dev mailing list<br>
<a href="mailto:dltk-dev@xxxxxxxxxxx">dltk-dev@xxxxxxxxxxx</a><br>
<a href="https://dev.eclipse.org/mailman/listinfo/dltk-dev" target="_blank">https://dev.eclipse.org/mailman/listinfo/dltk-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-jae<br>
]]></content:encoded>
		<pubDate>Fri, 18 May 2012 16:42:54 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02196.html</guid>
		<author>jgangemi@xxxxxxx (Jae Gangemi)</author>
	</item>
	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02195.html</link>
		<description>On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi &amp;lt;jgangemi@xxxxxxxxx&amp;gt; wrote:Actually, there&amp;#39;s another bug here, and it&amp;#39;s a tricky one, so heads up in case you might run to into in similar code on own work: If you use different rules to match the same token, th...</description>
		<content:encoded><![CDATA[<br><br><div class="gmail_quote">On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>&#xA0; actually, i just went and re-read the wiki page, shouldn&#39;t this be simple for D?<br><br>&#xA0; you&#39;d just need multiple multi-line rules that look something like this (not sure if there is an escape char):<br><br>

&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q(&quot;, &quot;)\n&quot;, token, (char) 0, true);<br>&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q{&quot;, &quot;}\n&quot;, token, (char) 0, true);<br><br>&#xA0; no? <br><div class="HOEnZb"><div class="h5"><br></div>
</div></blockquote></div><br>Actually, there&#39;s another bug here, and it&#39;s a tricky one, so heads up in case you might run to into in similar code on own work: If you use different rules to match the same token, the partitioner can at some times (especially for multi-line rules) try to resume scanning (look only for the end of the partition starting from the middle of it) using a rule different from the one that started the partition. So code like this:<br>
<br>q(<br>blah<br>}<br><br>might be scanned correctly as a partition of that token type, because one rule would start it, but another rule might end the scanning successfully. I mentioned this in more detail in this Eclipse bug:<br>
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=346723">https://bugs.eclipse.org/bugs/show_bug.cgi?id=346723</a><br><br><br>-- <br>Bruno Medeiros<br>
]]></content:encoded>
		<pubDate>Fri, 18 May 2012 16:28:11 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02195.html</guid>
		<author>bruno.do.medeiros@xxxxxxx (Bruno Medeiros)</author>
	</item>
	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02194.html</link>
		<description> That should be correct to: &amp;#xA0; new MultiLineRule(&amp;quot;q\&amp;quot;(&amp;quot;, &amp;quot;)\&amp;quot;&amp;quot;, token, (char) 0, true); but anyways: yes and no, that would work for the heredoc with &amp;quot;a delimiter character (any of () &amp;lt;&amp;gt; {} or []) &amp;quot; which is the first case as shown in the wiki, but it would...</description>
		<content:encoded><![CDATA[hello all -<br><br>&#xA0; after a bunch of trial and error (mostly error), i think i&#39;ve come up w/ a solution for this, but i wanted to see if anyone saw any major potential issues.<br><br>&#xA0; bruno: after messing around with this, the fact that D also supports an identifier means i believe you will also have to leverage this. <br>


<br>&#xA0; i was successfully able to create a heredoc partition on an initial document open by overriding the &#39;nextToken()&#39; method in my subclass of the RuleBasedPartitionScanner. the heredoc rule i created returned a HereDocToken sub-class (although i believe this is no longer necessary) to indicate to the partition scanner that the start of heredoc was seen and it would need to buffer tokens until the terminator was seen. it builds the buffer, tracking the offsets of the created tokens. when the tokens are removed from the buffer, the offsets maintained by the scanner are adjusted the partition offsets are correct.<br>

<br>&#xA0; i discovered that if i went to insert characters before the start of the heredoc (&lt;&lt;), the partitioning would get all messed up b/c the partition scanner would abort processing once it saw the initial HereDocToken b/c it matched a prior token - this is line 372 of the FastPartitionScanner that i mentioned 50 emails ago :) - i resolved this by overriding <br>

<br>&#xA0;&#xA0;&#xA0; setPartialRange(IDocument, int, int, String int)<br><br>&#xA0; to clear the token buffer before it starts any processing, which seems to have addressed that problem.<br>&#xA0; <br>&#xA0; this is all fine and good and it alleviated my need to track and kind of state, until i made edits to the body of the heredoc...<br>

<br>&#xA0; when heredoc rule would resume, but b/c it has no idea where it should terminate, the partition gets calculated incorrectly. a similar situation occurs when edits are made after the terminator (details aren&#39;t necessary here).<br>

<br>&#xA0; so - it appears that i&#39;m back to the original problem of needing to track information about the heredoc, namely what is its terminator and what is its ending offset in the document.<br><br>&#xA0; after giving this some thought, i had the idea to tack this information on the end of the content type string that is returned by the getData() call on the token object. initially this didn&#39;t work b/c the partition type was no longer recognized, but after i overrode:<br>

<br>&#xA0;&#xA0;&#xA0; FastPartitioner.isSupportedContentType(String)<br>&#xA0;&#xA0;&#xA0; ScriptPresentationReconciler.getDamager(String)<br>&#xA0; &#xA0; ScriptPresentationReconciler.getRepairer(String)<br><br>&#xA0; to strip off the delimiter, the partitioning and coloring started working again.<br>

<br>&#xA0; the first big question is, does anyone see anything wrong w/ tracking the terminator and offset via the data that is returned from the call to getData()? this does not seem to affect anything as long as that information is stripped off before anything else uses it and the above methods are the only ones i&#39;ve encountered that do. <br>
<br>&#xA0; it just occurred to me that it might be possible to just track that 
information inside the partition scanner for the life of the document 
but that might be difficult.<br>
<br>&#xA0; the other question is there anything wrong w/ requiring an explicit HereDocRule subclass to be set (or provided by) the partition scanner instead of it being defined in the list of rules?<br><br>&#xA0; 1) i don&#39;t want to cut and past the implementation of RuleBasedPartitionScanner.nextToken() just b/c i need to change the way this line of code works:<br>

<br>&#xA0;&#xA0;&#xA0; if (fContentType.equals(token.getData())) {<br><br>&#xA0; that line of code will always fail b/c the &#39;success&#39; token returned from the heredoc rule will never contain and terminator/offset information and i felt rather then do that cut and paste, the scanner can just do an explicit check against the heredoc rule before falling back to cycling through the list.<br>

<br>&#xA0; 2) if a resume is occurring, the rule will need to be told what the terminator/offset are so it can scan properly.<br><br>&#xA0;&#xA0; thoughts?<br><br><div class="gmail_quote">On Wed, May 16, 2012 at 9:20 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>&#xA0; ha! i think i figured out the answer :)<br><br>&#xA0; the easiest thing to do will be to just build a token buffer if/when heredoc is encountered and then resume normal scanning once it&#39;s empty.<br><br>&#xA0; i&#39;ll report back once i try this out.<div>


<div><br>
<br><div class="gmail_quote">On Wed, May 16, 2012 at 8:53 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<br>&#xA0; actually, on further thought, i want this to be in its own partition b/c then i can assign a specific &#39;color&#39; scanner to it that offers me more flexibility/options.<br><br>&#xA0; it&#39;d be nice if there were a way pull offsets out of the ModuleDeclaration to supplement rule based parsing...is that even possible?<div>



<div><br>
<br><br><div class="gmail_quote">On Wed, May 16, 2012 at 8:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




&#xA0;<br>&#xA0; started looking into this and have a very basic implementation kind of working, but i&#39;ve hit the first snag and wanted to see what others thought on how to over come it...<br><br>&#xA0; i&#39;ve taken the route of trying to heredoc be it&#39;s own partition, so this:<br>





<br>&#xA0; &lt;&lt;EOF<br>&#xA0; EOF<br>&#xA0; <br>&#xA0; yields this document structure:<br><br>partition type: __perl_heredoc, offset: 0, length: 5<br>---------------------------<br>&lt;&lt;EOF<br>---------------------------<br>partition type: __dftl_partition_content_type, offset: 5, length: 1<br>





---------------------------<br>---------------------------<br>partition type: __perl_heredoc, offset: 6, length: 3<br>---------------------------<br>EOF<br>---------------------------<br><br>&#xA0; in order to do this, i start tracking that i&#39;ve seen a heredoc token in my partition scanner and once i see that the next character is going to be a newline, the scanner will start consuming each line until it sees the terminator, at which point it ends the partition and resets the state.<br>





<br>&#xA0; the problem that i am having is this, if i add a newline to the document before the start of &lt;&lt;EOF, i hit this block of code starting at line 371 in the FastPartioner<br><br>&#xA0;&#xA0;&#xA0; // if position already exists and we have scanned at least the<br>





&#xA0;&#xA0;&#xA0; // area covered by the event, we are done<br>&#xA0;&#xA0;&#xA0; if (fDocument.containsPosition(fPositionCategory, start, length)) {<br>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if (lastScannedPosition &gt;= e.getOffset() + newLength)<br>&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; return createRegion();<br>





&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; ++ first;<br>&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; } else {<br><br>&#xA0; and the scanning stops and my partition scanner is left thinking that the next time &#39;nextToken()&#39; is invoked, it&#39;s in heredoc mode.<br><br>&#xA0; i really don&#39;t want to have to make a copy of the FastPartitioner just to add some way to &#39;reset&#39; my partition scanner, so what other options exist?<br>





<br>&#xA0; is creating a partition for this just the wrong way to go? eventually i&#39;d like to be able to offer a folding option for heredoc, but i believe i could also accomplish that by having it represented in the AST.<br>





<br>&#xA0; i haven&#39;t tried going through the code scanner yet to see if it&#39;s possible that way - but i am worried that i will encounter the same &#39;state&#39; problem i saw with the partition scanner - but perhaps not.<br>





<br>&#xA0; either way - if anyone has anything to contribute, i&#39;d love to here it! :)<div><div><br><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 2:28 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>&#xA0; in the 2nd case you&#39;re going to have to write your own rule, but that still should be much simpler to handle b/c the &#39;;&#39; appears on the terminator line, not after the heredoc start.<br>





<br>&#xA0; your rule would have to check for q&quot; followed by some character and if it saw a char after the &quot;, read in all the chars up until the new line, save that as your terminator, and keep reading lines until you hit the terminator.<br>






<br>&#xA0; sub-classing the pattern/multi-line rule to do this should get you want you want.<br><br><div class="gmail_quote"><div><div>On Wed, May 16, 2012 at 2:21 PM, Bruno Medeiros <span dir="ltr">&lt;<a href="mailto:bruno.do.medeiros@xxxxxxxxx" target="_blank">bruno.do.medeiros@xxxxxxxxx</a>&gt;</span> wrote:<br>






</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>&#xA0; actually, i just went and re-read the wiki page, shouldn&#39;t this be simple for D?<br><br>&#xA0; you&#39;d just need multiple multi-line rules that look something like this (not sure if there is an escape char):<br><br>








&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q(&quot;, &quot;)\n&quot;, token, (char) 0, true);<br>&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q{&quot;, &quot;}\n&quot;, token, (char) 0, true);<br><br>&#xA0; no? <br><div><div><br clear="all">
</div></div></blockquote></div><br></div>That should be correct to:<br>
&#xA0; new MultiLineRule(&quot;q\&quot;(&quot;, &quot;)\&quot;&quot;, token, (char) 0, true);<br>
but anyways: yes and no, that would work for the heredoc with <i>&quot;a delimiter character (any of () &lt;&gt; {} or []) &quot; </i>which is the first case as shown in the wiki, but it wouldn&#39;t work for the second case with a delimiter identifier string:<br>








<pre><span>int</span> main<span>(</span><span>)</span> <span>{</span>
    string list <span>=</span> q<span>&quot;IDENT
1. Item One
2. Item Two
3. Item Three
IDENT&quot;</span><span>;</span>
    writef<span>(</span> list <span>)</span><span>;</span>
<span>}</span></pre>
which is more like the Ruby and Perl heredoc.<span><font color="#888888"><br>
<br>-- <br>Bruno Medeiros<br>
</font></span><br></div></div><div>_______________________________________________<br>
dltk-dev mailing list<br>
<a href="mailto:dltk-dev@xxxxxxxxxxx" target="_blank">dltk-dev@xxxxxxxxxxx</a><br>
<a href="https://dev.eclipse.org/mailman/listinfo/dltk-dev" target="_blank">https://dev.eclipse.org/mailman/listinfo/dltk-dev</a><br>
<br></div></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>-jae<br>
]]></content:encoded>
		<pubDate>Fri, 18 May 2012 16:24:53 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02194.html</guid>
		<author>jgangemi@xxxxxxx (Jae Gangemi)</author>
	</item>


	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02193.html</link>
		<description>&amp;#xA0; ha! i think i figured out the answer :)&amp;#xA0; the easiest thing to do will be to just build a token buffer if/when heredoc is encountered and then resume normal scanning once it&amp;#39;s empty.&amp;#xA0; i&amp;#39;ll report back once i try this out. On Wed, May 16, 2012 at 8:53 PM, ...</description>
		<content:encoded><![CDATA[<br>&#xA0; ha! i think i figured out the answer :)<br><br>&#xA0; the easiest thing to do will be to just build a token buffer if/when heredoc is encountered and then resume normal scanning once it&#39;s empty.<br><br>&#xA0; i&#39;ll report back once i try this out.<br>
<br><div class="gmail_quote">On Wed, May 16, 2012 at 8:53 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>&#xA0; actually, on further thought, i want this to be in its own partition b/c then i can assign a specific &#39;color&#39; scanner to it that offers me more flexibility/options.<br><br>&#xA0; it&#39;d be nice if there were a way pull offsets out of the ModuleDeclaration to supplement rule based parsing...is that even possible?<div class="HOEnZb">
<div class="h5"><br>
<br><br><div class="gmail_quote">On Wed, May 16, 2012 at 8:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

&#xA0;<br>&#xA0; started looking into this and have a very basic implementation kind of working, but i&#39;ve hit the first snag and wanted to see what others thought on how to over come it...<br><br>&#xA0; i&#39;ve taken the route of trying to heredoc be it&#39;s own partition, so this:<br>


<br>&#xA0; &lt;&lt;EOF<br>&#xA0; EOF<br>&#xA0; <br>&#xA0; yields this document structure:<br><br>partition type: __perl_heredoc, offset: 0, length: 5<br>---------------------------<br>&lt;&lt;EOF<br>---------------------------<br>partition type: __dftl_partition_content_type, offset: 5, length: 1<br>


---------------------------<br>---------------------------<br>partition type: __perl_heredoc, offset: 6, length: 3<br>---------------------------<br>EOF<br>---------------------------<br><br>&#xA0; in order to do this, i start tracking that i&#39;ve seen a heredoc token in my partition scanner and once i see that the next character is going to be a newline, the scanner will start consuming each line until it sees the terminator, at which point it ends the partition and resets the state.<br>


<br>&#xA0; the problem that i am having is this, if i add a newline to the document before the start of &lt;&lt;EOF, i hit this block of code starting at line 371 in the FastPartioner<br><br>&#xA0;&#xA0;&#xA0; // if position already exists and we have scanned at least the<br>


&#xA0;&#xA0;&#xA0; // area covered by the event, we are done<br>&#xA0;&#xA0;&#xA0; if (fDocument.containsPosition(fPositionCategory, start, length)) {<br>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if (lastScannedPosition &gt;= e.getOffset() + newLength)<br>&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; return createRegion();<br>


&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; ++ first;<br>&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; } else {<br><br>&#xA0; and the scanning stops and my partition scanner is left thinking that the next time &#39;nextToken()&#39; is invoked, it&#39;s in heredoc mode.<br><br>&#xA0; i really don&#39;t want to have to make a copy of the FastPartitioner just to add some way to &#39;reset&#39; my partition scanner, so what other options exist?<br>


<br>&#xA0; is creating a partition for this just the wrong way to go? eventually i&#39;d like to be able to offer a folding option for heredoc, but i believe i could also accomplish that by having it represented in the AST.<br>


<br>&#xA0; i haven&#39;t tried going through the code scanner yet to see if it&#39;s possible that way - but i am worried that i will encounter the same &#39;state&#39; problem i saw with the partition scanner - but perhaps not.<br>


<br>&#xA0; either way - if anyone has anything to contribute, i&#39;d love to here it! :)<div><div><br><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 2:28 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>&#xA0; in the 2nd case you&#39;re going to have to write your own rule, but that still should be much simpler to handle b/c the &#39;;&#39; appears on the terminator line, not after the heredoc start.<br>


<br>&#xA0; your rule would have to check for q&quot; followed by some character and if it saw a char after the &quot;, read in all the chars up until the new line, save that as your terminator, and keep reading lines until you hit the terminator.<br>



<br>&#xA0; sub-classing the pattern/multi-line rule to do this should get you want you want.<br><br><div class="gmail_quote"><div><div>On Wed, May 16, 2012 at 2:21 PM, Bruno Medeiros <span dir="ltr">&lt;<a href="mailto:bruno.do.medeiros@xxxxxxxxx" target="_blank">bruno.do.medeiros@xxxxxxxxx</a>&gt;</span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>&#xA0; actually, i just went and re-read the wiki page, shouldn&#39;t this be simple for D?<br><br>&#xA0; you&#39;d just need multiple multi-line rules that look something like this (not sure if there is an escape char):<br><br>





&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q(&quot;, &quot;)\n&quot;, token, (char) 0, true);<br>&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q{&quot;, &quot;}\n&quot;, token, (char) 0, true);<br><br>&#xA0; no? <br><div><div><br clear="all">
</div></div></blockquote></div><br></div>That should be correct to:<br>
&#xA0; new MultiLineRule(&quot;q\&quot;(&quot;, &quot;)\&quot;&quot;, token, (char) 0, true);<br>
but anyways: yes and no, that would work for the heredoc with <i>&quot;a delimiter character (any of () &lt;&gt; {} or []) &quot; </i>which is the first case as shown in the wiki, but it wouldn&#39;t work for the second case with a delimiter identifier string:<br>





<pre><span>int</span> main<span>(</span><span>)</span> <span>{</span>
    string list <span>=</span> q<span>&quot;IDENT
1. Item One
2. Item Two
3. Item Three
IDENT&quot;</span><span>;</span>
    writef<span>(</span> list <span>)</span><span>;</span>
<span>}</span></pre>
which is more like the Ruby and Perl heredoc.<span><font color="#888888"><br>
<br>-- <br>Bruno Medeiros<br>
</font></span><br></div></div><div>_______________________________________________<br>
dltk-dev mailing list<br>
<a href="mailto:dltk-dev@xxxxxxxxxxx" target="_blank">dltk-dev@xxxxxxxxxxx</a><br>
<a href="https://dev.eclipse.org/mailman/listinfo/dltk-dev" target="_blank">https://dev.eclipse.org/mailman/listinfo/dltk-dev</a><br>
<br></div></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>-jae<br>
]]></content:encoded>
		<pubDate>Thu, 17 May 2012 01:20:38 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02193.html</guid>
		<author>jgangemi@xxxxxxx (Jae Gangemi)</author>
	</item>
	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02192.html</link>
		<description>&amp;#xA0; actually, on further thought, i want this to be in its own partition b/c then i can assign a specific &amp;#39;color&amp;#39; scanner to it that offers me more flexibility/options.&amp;#xA0; it&amp;#39;d be nice if there were a way pull offsets out of the ModuleDeclaration to supplement...</description>
		<content:encoded><![CDATA[<br>&#xA0; actually, on further thought, i want this to be in its own partition b/c then i can assign a specific &#39;color&#39; scanner to it that offers me more flexibility/options.<br><br>&#xA0; it&#39;d be nice if there were a way pull offsets out of the ModuleDeclaration to supplement rule based parsing...is that even possible?<br>
<br><br><div class="gmail_quote">On Wed, May 16, 2012 at 8:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&#xA0;<br>&#xA0; started looking into this and have a very basic implementation kind of working, but i&#39;ve hit the first snag and wanted to see what others thought on how to over come it...<br><br>&#xA0; i&#39;ve taken the route of trying to heredoc be it&#39;s own partition, so this:<br>

<br>&#xA0; &lt;&lt;EOF<br>&#xA0; EOF<br>&#xA0; <br>&#xA0; yields this document structure:<br><br>partition type: __perl_heredoc, offset: 0, length: 5<br>---------------------------<br>&lt;&lt;EOF<br>---------------------------<br>partition type: __dftl_partition_content_type, offset: 5, length: 1<br>

---------------------------<br>---------------------------<br>partition type: __perl_heredoc, offset: 6, length: 3<br>---------------------------<br>EOF<br>---------------------------<br><br>&#xA0; in order to do this, i start tracking that i&#39;ve seen a heredoc token in my partition scanner and once i see that the next character is going to be a newline, the scanner will start consuming each line until it sees the terminator, at which point it ends the partition and resets the state.<br>

<br>&#xA0; the problem that i am having is this, if i add a newline to the document before the start of &lt;&lt;EOF, i hit this block of code starting at line 371 in the FastPartioner<br><br>&#xA0;&#xA0;&#xA0; // if position already exists and we have scanned at least the<br>

&#xA0;&#xA0;&#xA0; // area covered by the event, we are done<br>&#xA0;&#xA0;&#xA0; if (fDocument.containsPosition(fPositionCategory, start, length)) {<br>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if (lastScannedPosition &gt;= e.getOffset() + newLength)<br>&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; return createRegion();<br>

&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; ++ first;<br>&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; } else {<br><br>&#xA0; and the scanning stops and my partition scanner is left thinking that the next time &#39;nextToken()&#39; is invoked, it&#39;s in heredoc mode.<br><br>&#xA0; i really don&#39;t want to have to make a copy of the FastPartitioner just to add some way to &#39;reset&#39; my partition scanner, so what other options exist?<br>

<br>&#xA0; is creating a partition for this just the wrong way to go? eventually i&#39;d like to be able to offer a folding option for heredoc, but i believe i could also accomplish that by having it represented in the AST.<br>

<br>&#xA0; i haven&#39;t tried going through the code scanner yet to see if it&#39;s possible that way - but i am worried that i will encounter the same &#39;state&#39; problem i saw with the partition scanner - but perhaps not.<br>

<br>&#xA0; either way - if anyone has anything to contribute, i&#39;d love to here it! :)<div class="HOEnZb"><div class="h5"><br><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 2:28 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>&#xA0; in the 2nd case you&#39;re going to have to write your own rule, but that still should be much simpler to handle b/c the &#39;;&#39; appears on the terminator line, not after the heredoc start.<br>

<br>&#xA0; your rule would have to check for q&quot; followed by some character and if it saw a char after the &quot;, read in all the chars up until the new line, save that as your terminator, and keep reading lines until you hit the terminator.<br>


<br>&#xA0; sub-classing the pattern/multi-line rule to do this should get you want you want.<br><br><div class="gmail_quote"><div><div>On Wed, May 16, 2012 at 2:21 PM, Bruno Medeiros <span dir="ltr">&lt;<a href="mailto:bruno.do.medeiros@xxxxxxxxx" target="_blank">bruno.do.medeiros@xxxxxxxxx</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>&#xA0; actually, i just went and re-read the wiki page, shouldn&#39;t this be simple for D?<br><br>&#xA0; you&#39;d just need multiple multi-line rules that look something like this (not sure if there is an escape char):<br><br>




&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q(&quot;, &quot;)\n&quot;, token, (char) 0, true);<br>&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q{&quot;, &quot;}\n&quot;, token, (char) 0, true);<br><br>&#xA0; no? <br><div><div><br clear="all">
</div></div></blockquote></div><br></div>That should be correct to:<br>
&#xA0; new MultiLineRule(&quot;q\&quot;(&quot;, &quot;)\&quot;&quot;, token, (char) 0, true);<br>
but anyways: yes and no, that would work for the heredoc with <i>&quot;a delimiter character (any of () &lt;&gt; {} or []) &quot; </i>which is the first case as shown in the wiki, but it wouldn&#39;t work for the second case with a delimiter identifier string:<br>




<pre><span>int</span> main<span>(</span><span>)</span> <span>{</span>
    string list <span>=</span> q<span>&quot;IDENT
1. Item One
2. Item Two
3. Item Three
IDENT&quot;</span><span>;</span>
    writef<span>(</span> list <span>)</span><span>;</span>
<span>}</span></pre>
which is more like the Ruby and Perl heredoc.<span><font color="#888888"><br>
<br>-- <br>Bruno Medeiros<br>
</font></span><br></div></div><div>_______________________________________________<br>
dltk-dev mailing list<br>
<a href="mailto:dltk-dev@xxxxxxxxxxx" target="_blank">dltk-dev@xxxxxxxxxxx</a><br>
<a href="https://dev.eclipse.org/mailman/listinfo/dltk-dev" target="_blank">https://dev.eclipse.org/mailman/listinfo/dltk-dev</a><br>
<br></div></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>-jae<br>
]]></content:encoded>
		<pubDate>Thu, 17 May 2012 00:53:14 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02192.html</guid>
		<author>jgangemi@xxxxxxx (Jae Gangemi)</author>
	</item>
	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02191.html</link>
		<description>That should be correct to: &amp;#xA0; new MultiLineRule(&amp;quot;q\&amp;quot;(&amp;quot;, &amp;quot;)\&amp;quot;&amp;quot;, token, (char) 0, true); but anyways: yes and no, that would work for the heredoc with &amp;quot;a delimiter character (any of () &amp;lt;&amp;gt; {} or []) &amp;quot; which is the first case as shown in the wiki, but it wouldn...</description>
		<content:encoded><![CDATA[&#xA0;<br>&#xA0; started looking into this and have a very basic implementation kind of working, but i&#39;ve hit the first snag and wanted to see what others thought on how to over come it...<br><br>&#xA0; i&#39;ve taken the route of trying to heredoc be it&#39;s own partition, so this:<br>
<br>&#xA0; &lt;&lt;EOF<br>&#xA0; EOF<br>&#xA0; <br>&#xA0; yields this document structure:<br><br>partition type: __perl_heredoc, offset: 0, length: 5<br>---------------------------<br>&lt;&lt;EOF<br>---------------------------<br>partition type: __dftl_partition_content_type, offset: 5, length: 1<br>
---------------------------<br>---------------------------<br>partition type: __perl_heredoc, offset: 6, length: 3<br>---------------------------<br>EOF<br>---------------------------<br><br>&#xA0; in order to do this, i start tracking that i&#39;ve seen a heredoc token in my partition scanner and once i see that the next character is going to be a newline, the scanner will start consuming each line until it sees the terminator, at which point it ends the partition and resets the state.<br>
<br>&#xA0; the problem that i am having is this, if i add a newline to the document before the start of &lt;&lt;EOF, i hit this block of code starting at line 371 in the FastPartioner<br><br>&#xA0;&#xA0;&#xA0; // if position already exists and we have scanned at least the<br>
&#xA0;&#xA0;&#xA0; // area covered by the event, we are done<br>&#xA0;&#xA0;&#xA0; if (fDocument.containsPosition(fPositionCategory, start, length)) {<br>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if (lastScannedPosition &gt;= e.getOffset() + newLength)<br>&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; return createRegion();<br>
&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; ++ first;<br>&#xA0;&#xA0;&#xA0; &#xA0;&#xA0;&#xA0; } else {<br><br>&#xA0; and the scanning stops and my partition scanner is left thinking that the next time &#39;nextToken()&#39; is invoked, it&#39;s in heredoc mode.<br><br>&#xA0; i really don&#39;t want to have to make a copy of the FastPartitioner just to add some way to &#39;reset&#39; my partition scanner, so what other options exist?<br>
<br>&#xA0; is creating a partition for this just the wrong way to go? eventually i&#39;d like to be able to offer a folding option for heredoc, but i believe i could also accomplish that by having it represented in the AST.<br>
<br>&#xA0; i haven&#39;t tried going through the code scanner yet to see if it&#39;s possible that way - but i am worried that i will encounter the same &#39;state&#39; problem i saw with the partition scanner - but perhaps not.<br>
<br>&#xA0; either way - if anyone has anything to contribute, i&#39;d love to here it! :)<br><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 2:28 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>&#xA0; in the 2nd case you&#39;re going to have to write your own rule, but that still should be much simpler to handle b/c the &#39;;&#39; appears on the terminator line, not after the heredoc start.<br>
<br>&#xA0; your rule would have to check for q&quot; followed by some character and if it saw a char after the &quot;, read in all the chars up until the new line, save that as your terminator, and keep reading lines until you hit the terminator.<br>

<br>&#xA0; sub-classing the pattern/multi-line rule to do this should get you want you want.<br><br><div class="gmail_quote"><div><div class="h5">On Wed, May 16, 2012 at 2:21 PM, Bruno Medeiros <span dir="ltr">&lt;<a href="mailto:bruno.do.medeiros@xxxxxxxxx" target="_blank">bruno.do.medeiros@xxxxxxxxx</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>&#xA0; actually, i just went and re-read the wiki page, shouldn&#39;t this be simple for D?<br><br>&#xA0; you&#39;d just need multiple multi-line rules that look something like this (not sure if there is an escape char):<br><br>



&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q(&quot;, &quot;)\n&quot;, token, (char) 0, true);<br>&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q{&quot;, &quot;}\n&quot;, token, (char) 0, true);<br><br>&#xA0; no? <br><div><div><br clear="all">
</div></div></blockquote></div><br></div>That should be correct to:<br>
&#xA0; new MultiLineRule(&quot;q\&quot;(&quot;, &quot;)\&quot;&quot;, token, (char) 0, true);<br>
but anyways: yes and no, that would work for the heredoc with <i>&quot;a delimiter character (any of () &lt;&gt; {} or []) &quot; </i>which is the first case as shown in the wiki, but it wouldn&#39;t work for the second case with a delimiter identifier string:<br>



<pre><span>int</span> main<span>(</span><span>)</span> <span>{</span>
    string list <span>=</span> q<span>&quot;IDENT
1. Item One
2. Item Two
3. Item Three
IDENT&quot;</span><span>;</span>
    writef<span>(</span> list <span>)</span><span>;</span>
<span>}</span></pre>
which is more like the Ruby and Perl heredoc.<span><font color="#888888"><br>
<br>-- <br>Bruno Medeiros<br>
</font></span><br></div></div><div class="im">_______________________________________________<br>
dltk-dev mailing list<br>
<a href="mailto:dltk-dev@xxxxxxxxxxx" target="_blank">dltk-dev@xxxxxxxxxxx</a><br>
<a href="https://dev.eclipse.org/mailman/listinfo/dltk-dev" target="_blank">https://dev.eclipse.org/mailman/listinfo/dltk-dev</a><br>
<br></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>-jae<br>
]]></content:encoded>
		<pubDate>Thu, 17 May 2012 00:40:14 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02191.html</guid>
		<author>jgangemi@xxxxxxx (Jae Gangemi)</author>
	</item>
	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02190.html</link>
		<description>That should be correct to: &amp;#xA0; new MultiLineRule(&amp;quot;q\&amp;quot;(&amp;quot;, &amp;quot;)\&amp;quot;&amp;quot;, token, (char) 0, true); but anyways: yes and no, that would work for the heredoc with &amp;quot;a delimiter character (any of () &amp;lt;&amp;gt; {} or []) &amp;quot; which is the first case as shown in the wiki, but it wouldn...</description>
		<content:encoded><![CDATA[<br>&#xA0; in the 2nd case you&#39;re going to have to write your own rule, but that still should be much simpler to handle b/c the &#39;;&#39; appears on the terminator line, not after the heredoc start.<br><br>&#xA0; your rule would have to check for q&quot; followed by some character and if it saw a char after the &quot;, read in all the chars up until the new line, save that as your terminator, and keep reading lines until you hit the terminator.<br>
<br>&#xA0; sub-classing the pattern/multi-line rule to do this should get you want you want.<br><br><div class="gmail_quote">On Wed, May 16, 2012 at 2:21 PM, Bruno Medeiros <span dir="ltr">&lt;<a href="mailto:bruno.do.medeiros@xxxxxxxxx" target="_blank">bruno.do.medeiros@xxxxxxxxx</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>&#xA0; actually, i just went and re-read the wiki page, shouldn&#39;t this be simple for D?<br><br>&#xA0; you&#39;d just need multiple multi-line rules that look something like this (not sure if there is an escape char):<br><br>


&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q(&quot;, &quot;)\n&quot;, token, (char) 0, true);<br>&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q{&quot;, &quot;}\n&quot;, token, (char) 0, true);<br><br>&#xA0; no? <br><div><div><br clear="all">
</div></div></blockquote></div><br></div>That should be correct to:<br>
&#xA0; new MultiLineRule(&quot;q\&quot;(&quot;, &quot;)\&quot;&quot;, token, (char) 0, true);<br>
but anyways: yes and no, that would work for the heredoc with <i>&quot;a delimiter character (any of () &lt;&gt; {} or []) &quot; </i>which is the first case as shown in the wiki, but it wouldn&#39;t work for the second case with a delimiter identifier string:<br>


<pre><span>int</span> main<span>(</span><span>)</span> <span>{</span>
    string list <span>=</span> q<span>&quot;IDENT
1. Item One
2. Item Two
3. Item Three
IDENT&quot;</span><span>;</span>
    writef<span>(</span> list <span>)</span><span>;</span>
<span>}</span></pre>
which is more like the Ruby and Perl heredoc.<span class="HOEnZb"><font color="#888888"><br>
<br>-- <br>Bruno Medeiros<br>
</font></span><br>_______________________________________________<br>
dltk-dev mailing list<br>
<a href="mailto:dltk-dev@xxxxxxxxxxx">dltk-dev@xxxxxxxxxxx</a><br>
<a href="https://dev.eclipse.org/mailman/listinfo/dltk-dev" target="_blank">https://dev.eclipse.org/mailman/listinfo/dltk-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-jae<br>
]]></content:encoded>
		<pubDate>Wed, 16 May 2012 18:28:58 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02190.html</guid>
		<author>jgangemi@xxxxxxx (Jae Gangemi)</author>
	</item>
	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02189.html</link>
		<description>On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi &amp;lt;jgangemi@xxxxxxxxx&amp;gt; wrote:That should be correct to: &amp;#xA0; new MultiLineRule(&amp;quot;q\&amp;quot;(&amp;quot;, &amp;quot;)\&amp;quot;&amp;quot;, token, (char) 0, true); but anyways: yes and no, that would work for the heredoc with &amp;quot;a delimiter character (any of () t;...</description>
		<content:encoded><![CDATA[<br><br><div class="gmail_quote">On Wed, May 16, 2012 at 6:40 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>&#xA0; actually, i just went and re-read the wiki page, shouldn&#39;t this be simple for D?<br><br>&#xA0; you&#39;d just need multiple multi-line rules that look something like this (not sure if there is an escape char):<br><br>

&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q(&quot;, &quot;)\n&quot;, token, (char) 0, true);<br>&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q{&quot;, &quot;}\n&quot;, token, (char) 0, true);<br><br>&#xA0; no? <br><div class="HOEnZb"><div class="h5"><br clear="all">
</div></div></blockquote></div><br>That should be correct to:<br>
&#xA0; new MultiLineRule(&quot;q\&quot;(&quot;, &quot;)\&quot;&quot;, token, (char) 0, true);<br>
but anyways: yes and no, that would work for the heredoc with <i>&quot;a delimiter character (any of () &lt;&gt; {} or []) &quot; </i>which is the first case as shown in the wiki, but it wouldn&#39;t work for the second case with a delimiter identifier string:<br>

<pre class="de1"><span class="kw4">int</span> main<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
    string list <span class="sy0">=</span> q<span class="st0">&quot;IDENT
1. Item One
2. Item Two
3. Item Three
IDENT&quot;</span><span class="sy0">;</span>
    writef<span class="br0">(</span> list <span class="br0">)</span><span class="sy0">;</span>
<span class="br0">}</span></pre>
which is more like the Ruby and Perl heredoc.<br>
<br>-- <br>Bruno Medeiros<br>
]]></content:encoded>
		<pubDate>Wed, 16 May 2012 18:21:02 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02189.html</guid>
		<author>bruno.do.medeiros@xxxxxxx (Bruno Medeiros)</author>
	</item>
	<item>
		<title>Re: [Dltk-dev] heredoc scanner help</title>
		<link>http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02188.html</link>
		<description>Hum, do you know if the simpler case of Heredoc scanner has been solved/implemented somewhere? That is, when there is nothing after the heredoc initial delimiter, like this:$x = &amp;lt;&amp;lt;EOF &amp;#xA0;&amp;#xA0;&amp;#xA0; heredocEOFSuch code would be useful for me as this is an open issue ...</description>
		<content:encoded><![CDATA[<br>&#xA0; actually, i just went and re-read the wiki page, shouldn&#39;t this be simple for D?<br><br>&#xA0; you&#39;d just need multiple multi-line rules that look something like this (not sure if there is an escape char):<br><br>
&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q(&quot;, &quot;)\n&quot;, token, (char) 0, true);<br>&#xA0;&#xA0;&#xA0; new MultiLineRule(&quot;q{&quot;, &quot;}\n&quot;, token, (char) 0, true);<br><br>&#xA0; no? <br><br><div class="gmail_quote">On Wed, May 16, 2012 at 1:13 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>&#xA0; i think you should be able to handle that case using a pattern rule, you just need to account for the &quot;&lt;&lt;&quot; not being on the delimiter, which may require you to subclass the rule to handle that.<div class="HOEnZb">
<div class="h5"><br><br>
<div class="gmail_quote">On Wed, May 16, 2012 at 1:06 PM, Bruno Medeiros <span dir="ltr">&lt;<a href="mailto:bruno.do.medeiros@xxxxxxxxx" target="_blank">bruno.do.medeiros@xxxxxxxxx</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br><br><div class="gmail_quote"><div><div>On Tue, May 1, 2012 at 8:25 PM, Jae Gangemi <span dir="ltr">&lt;<a href="mailto:jgangemi@xxxxxxxxx" target="_blank">jgangemi@xxxxxxxxx</a>&gt;</span> wrote:<br></div></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
hello all -<br><br>&#xA0; i was hoping someone here might have a suggestion on how to approach dealing w/ heredoc in order to create a document partition so it can be &#39;colored&#39;<br><br>&#xA0; i can&#39;t just have a rule that starts the partition as starting as soon as it sees the heredoc, b/c things like this are valid:<br>



<br>&#xA0;&#xA0;&#xA0; $x = &lt;&lt;EOF . &quot;blah&quot;;&#xA0; <br>&#xA0;&#xA0;&#xA0; heredoc<br>&#xA0;&#xA0;&#xA0; EOF<br><br>&#xA0; and the <br>&#xA0; <br>&#xA0;&#xA0;&#xA0; . &quot;blah&quot;;<br><br>&#xA0; should be treated differently from the rest of the statement.<br><br>&#xA0; i&#39;m guessing that i&#39;m going to have to override some portion of the RuleBasedPartitionScanner in order to trace some kind of state that indicates heredoc was seen and all text after the newline up until the terminator should be treated as such??<br>



<br>&#xA0; if there&#39;s a better idea/approach, please let me know. i checked the ruby plugin for ideas since it supports heredoc, but it doesn&#39;t look like anyone&#39;s tackled this there either.<br clear="all"><br>&#xA0; thanks!<span><font color="#888888"><br>



<br>-- <br>-jae<br>
</font></span><br></div></div>_______________________________________________<br>
dltk-dev mailing list<br>
<a href="mailto:dltk-dev@xxxxxxxxxxx" target="_blank">dltk-dev@xxxxxxxxxxx</a><br>
<a href="https://dev.eclipse.org/mailman/listinfo/dltk-dev" target="_blank">https://dev.eclipse.org/mailman/listinfo/dltk-dev</a><br>
<br></blockquote></div><br><br>Hum, do you know if the simpler case of Heredoc scanner has been solved/implemented somewhere? That is, when there is nothing after the heredoc initial delimiter, like this:<br><br>$x = &lt;&lt;EOF<br>


&#xA0;&#xA0;&#xA0; heredoc<br>EOF<br clear="all"><br>Such code would be useful for me as this is an open issue in the D language IDE. D supports heredoc, but only in the simpler form above (<a href="http://en.wikipedia.org/wiki/Here_document#D" target="_blank">http://en.wikipedia.org/wiki/Here_document#D</a> ), there is no way to continue a statement/_expression_ right after the initial delimiter/tag, like Perl and Ruby support.<br>


<br>It seems this simpler case can be implemented by just creating a new PatternRule, no need to change the RuleBasedPartitionScanner.<span><font color="#888888"><br><br>-- <br>Bruno Medeiros<br>
</font></span><br>_______________________________________________<br>
dltk-dev mailing list<br>
<a href="mailto:dltk-dev@xxxxxxxxxxx" target="_blank">dltk-dev@xxxxxxxxxxx</a><br>
<a href="https://dev.eclipse.org/mailman/listinfo/dltk-dev" target="_blank">https://dev.eclipse.org/mailman/listinfo/dltk-dev</a><br>
<br></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>-jae<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>-jae<br>
]]></content:encoded>
		<pubDate>Wed, 16 May 2012 17:40:00 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/dltk-dev/msg02188.html</guid>
		<author>jgangemi@xxxxxxx (Jae Gangemi)</author>
	</item>

 
	</channel>
	</rss>
<!-- MHonArc v2.6.10 -->

