[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Dltk-dev] heredoc scanner help
- From: Bruno Medeiros <bruno.do.medeiros@xxxxxxxxx>
- Date: Wed, 16 May 2012 18:06:06 +0100
- 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=ELAtmMxOz3yByj96vrB6869ZAiCPx0yg0pluDRgEvww=; b=rgtTI8t/YWRCW4GR0Q+WIB5QmuY13wGBY4AYaYX0YGXliCRfBaATO5+dSCW8u96GiS dJkYQKkHrQuZOZ2WIrrSkTrZX5pUA1VEXgCfhkaXDyJ+F8EFWxXKUv7pgh7e/8rM5cXd teRJdS0TLvmoyCRslwH0/uIaKCOO8LO7U6gC6oaLp4GdGwsu5IHPHvvjRVsFjfx8GcRN WJbRio37X7TFPOFSLDqeUwGUdtyoP1J7eWEcEyrTL1gPJKarrFsxZndyxGtFHqtT6eNg 7TZ78H3BqpdZzskvf6qWcB8dgRYxNGKnItIHPSXoL3AqpkfyhP4LDEXEu267cBezPstq lrew==
On Tue, May 1, 2012 at 8:25 PM, Jae Gangemi <jgangemi@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.