From 3dbaf18f481bce2f7d7a79e38469fd9ec32450e9 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 8 Nov 2005 01:30:39 +0000 Subject: Patch from Kein-Hong Man allows here docs with double quoted delimiters and ! as a delimiter. --- src/LexBash.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/LexBash.cxx b/src/LexBash.cxx index 64c9bad2a..903d793bb 100644 --- a/src/LexBash.cxx +++ b/src/LexBash.cxx @@ -445,7 +445,7 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, HereDoc.Quoted = false; HereDoc.DelimiterLength = 0; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; - if (chNext == '\'') { // a quoted here-doc delimiter (' only) + if (chNext == '\'' || chNext == '\"') { // a quoted here-doc delimiter (' or ") i++; ch = chNext; chNext = chNext2; @@ -454,8 +454,9 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, HereDoc.Indent = true; HereDoc.State = 0; } else if (isalpha(chNext) || chNext == '_' || chNext == '\\' - || chNext == '-' || chNext == '+') { + || chNext == '-' || chNext == '+' || chNext == '!') { // an unquoted here-doc delimiter, no special handling + // TODO check what exactly bash considers part of the delim } else if (chNext == '<') { // HERE string <<< i++; ch = chNext; @@ -489,7 +490,7 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; } } else { // an unquoted here-doc delimiter - if (isalnum(ch) || ch == '_' || ch == '-' || ch == '+') { + if (isalnum(ch) || ch == '_' || ch == '-' || ch == '+' || ch == '!') { HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; } else if (ch == '\\') { -- cgit v1.2.3