Menu

#290 Shell script "here documents" need syntax for <<-

pending-remind
nobody
None
3
2012-08-22
2009-09-09
No

(found in 4.3pre17)

Bourne shell "here documents" (<<DELIM ... DELIM) work fine out of the box with jEdit's syntax handling, but the indented version (<<-DELIM ... DELIM) is not recognized for what it is. A simple change to shellscript.xml solves the problem.

<!-- Readins -->
<SPAN_REGEXP HASH_CHAR="&lt;&lt;" TYPE="LITERAL1" DELEGATE="LITERAL">
<BEGIN><![CDATA[<<-?[\p{Space}'"]*([\p{Alnum}_]+)[\p{Space}'"]*]]></BEGIN>
<END AT_LINE_START="TRUE">$1</END>
</SPAN_REGEXP>

The change is altering "<<" in the CDATA to "<<-?".

Discussion

  • Anonymous

    Anonymous - 2009-09-09
    • priority: 5 --> 3
     
  • Anonymous

    Anonymous - 2009-09-10

    Another slight error in the above, but I'm not enough of a syntax highlighter expert to figure it out, is that <END AT_LINE_START="TRUE"> is wrong, at least for bash. What *IS* required is that the closing word be the first non-whitespace on the line, and that nothing (including whitespace) follows it. Just setting AT_LINE_START="FALSE" is a quick hack that works kinda-sorta, but that does some bad stuff if you happen to use the closing word somewhere in your text. A better way to do it would be some kind of pattern that says "<line beginning><optional whitespace>$1" but I can't figure out any way to make that work.

     
  • Alan Ezust

    Alan Ezust - 2012-02-24
    • labels: 102669 -->
    • milestone: 101609 -->
     
  • Alan Ezust

    Alan Ezust - 2012-02-24

    Moving to patches tracker.

     
  • Alan Ezust

    Alan Ezust - 2012-08-22
    • status: open --> open-remind
     
  • Alan Ezust

    Alan Ezust - 2012-08-22

    This is not actually a patch yet. Would you mind making your changes to the current svn trunk of shellscript.xml and generating a patch with "svn patch", attaching it as an attachment to this ticket please?

     
  • Alan Ezust

    Alan Ezust - 2012-08-22

    Also, please attach a sample shellscript file with a here document for testing purposes.

     
  • Alan Ezust

    Alan Ezust - 2012-08-22
    • status: open-remind --> pending-remind
     

Log in to post a comment.