[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Dltk-dev] heredoc scanner help
- From: Jae Gangemi <jgangemi@xxxxxxxxx>
- Date: Wed, 16 May 2012 13:13:15 -0400
- Delivered-to: email@example.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=SdFC4EzzTUKi/87nqKx2eKXhJoJZuYdbsjk5UnudxIk=; b=pcwcGhCF3b7hje9p3dVlucW1LcrQYw6AEV/th9LrtSOM6LGzxEvnsjrAcAaxY9wNMY BNtVJz2iziInblZ+lylfrIBbkpqsevquUZuYiHfxohQK2cARtkVfY+K5ea9fFmqU/K3x uO53eIW0ZMSoGbOoclx81KkGd7VyXrYwdLYQhgWSgzz1YO/CpnrZkHunk9gPNOI7s/ck PxVq+1Cg/+NLxcXEFbjRh7+gF6/eG2dHKdvKJgGgKb4GzPevdTGSrbstGSk0foJEWiRP 46V/JChoBxPPCfeX/mjmLxgOPXjMopzls90Ekl3+lO9DclKMlUSCoII6qkxVb5UAbucQ 49yw==
i think you should be able to handle that case using a pattern rule, you just need to account for the "<<" not being on the delimiter, which may require you to subclass the rule to handle that.
On Wed, May 16, 2012 at 1:06 PM, Bruno Medeiros <bruno.do.medeiros@xxxxxxxxx>
hello all -
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 'colored'
i can'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:
$x = <<EOF . "blah";
should be treated differently from the rest of the statement.
i'm guessing that i'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??
if there's a better idea/approach, please let me know. i checked the ruby plugin for ideas since it supports heredoc, but it doesn't look like anyone's tackled this there either.
dltk-dev mailing list
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 = <<EOF
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 (http://en.wikipedia.org/wiki/Here_document#D ), there is no way to continue a statement/_expression_ right after the initial delimiter/tag, like Perl and Ruby support.
It seems this simpler case can be implemented by just creating a new PatternRule, no need to change the RuleBasedPartitionScanner.
dltk-dev mailing list