Version: (using KDE KDE 3.4.2) Installed from: Fedora RPMs Compiler: gcc 4.0.0 20050519 (Red Hat 4.0.0-8) OS: Linux Problem: Bash Script highlighting stops working after we use redirection like "<<-word [here-documente] delimiter". Cause (may I dare?): a blank space is lacking in lines 767 to 770 on "bash.xml", after 'String="(<<-'. What I mean is that: 'String="(<<-\s*'(&word;)' should be 'String="(<<- \s*'(&word;)'.
Can you attach a patch for this fix?
Created attachment 14221 [details] A proposed patch to bug 119952: I have tested it in KDE 3.4.2 (Fedora Core 4), and it seams to work fine.
On Thursday 12 January 2006 04:42, Daniel Elias wrote: > Cause (may I dare?): a blank space is lacking in lines 767 to 770 on > "bash.xml", after 'String="(<<-'. What I mean is that: > 'String="(<<-\s*'(&word;)' should be 'String="(<<- > \s*'(&word;)'. If you want to specify '1 or more space characters' instead of '0 or more space characters' use \s+ instead of \s* Is at least one space required? -anders
Thiago / Anders As it is my first time reporting a bug, perhaps I have not made myself clear (or incurred in "excessive summarization"). I apologize. Please refer to the attached diff: diff_bash_xml.xml. (diff /usr/share/apps/katepart/syntax/bash.xml ~/.kde/share/apps/katepart/syntax/bash.xml) Without the inserted spaces, highlighting will stop working after the first line of the following excerpt of bash script. pftp -niv $REMOTE_HOST <<-ftpcmds user $REMOTE_LOGIN $REMOTE_PASSWORD cd $REMOTE_DIR mput $1 bye ftpcmds That is because "highlighter" expects the here document to end with "-ftpcmds" instead of "ftpcmds". (If you do this, highlighting restart working and - obviously - the script stops. Not a big deal...) Thanks for your interest. Thiago Macieira wrote: [bugs.kde.org quoted mail] 767,770c767,770 < <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*"(&word;)")" lookAhead="true" /> < <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*'(&word;)')" lookAhead="true" /> < <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*\\(&word;))" lookAhead="true" /> < <RegExpr attribute="Redirection" context="HereDocINQ" String="(<<-\s*(&word;))" lookAhead="true" /> --- > <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<- \s*"(&word;)")" lookAhead="true" /> > <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<- \s*'(&word;)')" lookAhead="true" /> > <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<- \s*\\(&word;))" lookAhead="true" /> > <RegExpr attribute="Redirection" context="HereDocINQ" String="(<<- \s*(&word;))" lookAhead="true" />
Sorry. I have made a mistake. The bug exists but the proposed solution is not a solution. I've messed it up.
Confirmed that this still exists. Reopening.
Created attachment 14754 [details] Fix for HereDoc syntax highlighting OK. I think I've got it. I tested this against several styles of heredoc. I'll wait a few days before I commit this, to see if anyone can verify that this works for them, and also to make sure none of the Kate developers have objections. This patch applies DIRECTLY to the bash.xml from 3.5.1 tree.
On Saturday 18 February 2006 18:01, Jaison Lee wrote: > I'll wait a few days before I commit this, to see if anyone can verify that > this works for them, and also to make sure none of the Kate developers have > objections. This patch applies DIRECTLY to the bash.xml from 3.5.1 tree. I can't see why the negative lookahead for '-' is necessary if the delimiter word is quoted. So my bet is that only the last line needs to be changed. -anders
> So my bet is that only the last line needs to be changed. Good bet. :) Only the last line appears to be necessary.
SVN commit 511851 by jlee: BUG:119952 Bash <<- format heredoc now highlights correctly. M +1 -1 bash.xml --- trunk/KDE/kdelibs/kate/data/bash.xml #511850:511851 @@ -763,7 +763,7 @@ <RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*"(&word;)")" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*'(&word;)')" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*\\(&word;))" lookAhead="true" /> - <RegExpr attribute="Redirection" context="HereDocNQ" String="(<<\s*(&word;))" lookAhead="true" /> + <RegExpr attribute="Redirection" context="HereDocNQ" String="(<<(?!-)\s*(&word;))" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*"(&word;)")" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*'(&word;)')" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*\\(&word;))" lookAhead="true" />
SVN commit 511853 by jlee: CCBUG:119952 Backported bug fix: Bash <<- format heredoc now highlights correctly. M +1 -1 bash.xml --- branches/KDE/3.5/kdelibs/kate/data/bash.xml #511852:511853 @@ -763,7 +763,7 @@ <RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*"(&word;)")" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*'(&word;)')" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*\\(&word;))" lookAhead="true" /> - <RegExpr attribute="Redirection" context="HereDocNQ" String="(<<\s*(&word;))" lookAhead="true" /> + <RegExpr attribute="Redirection" context="HereDocNQ" String="(<<(?!-)\s*(&word;))" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*"(&word;)")" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*'(&word;)')" lookAhead="true" /> <RegExpr attribute="Redirection" context="HereDocIQ" String="(<<-\s*\\(&word;))" lookAhead="true" />
It works perfectly now. Nice job!
*** Bug 109031 has been marked as a duplicate of this bug. ***