From 5e8da21d56dc821f27e1c8cded754bbf2594181e Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 10 Oct 2019 11:08:39 +0200 Subject: Code highlighting. In case we have an example like (based on issue #7302): ``` /// @file /// Something template struct one { }; /// The struct single_009 the char struct single_009 : one<' '> { }; /// The struct single_010 the char struct single_039 : one<'\''> { }; /// The struct single_040 the char ( struct single_040 : one<'('> { }; /// The struct single_041 the char ) struct single_041 : one<')'> { }; /// The struct single_042 the char * struct single_042 : one<'*'> { }; struct single_058 : one<':'> { }; /// The struct single_059 the char ; struct single_059 : one<';'> { }; /// The struct single_060 the char < struct single_060 : one<'<'> { }; /// The struct single_061 the char = struct single_061 : one<'='> { }; /// The struct single_062 the char > struct single_062 : one<'>'> { }; /// The struct single_063 the char ? struct single_063 : one<'?'> { }; ``` The result is that in the code section there are no links to the structs 41, 61, 62 as the `(` and `<` block it till the corresponding `)` and `>` is found. Analogous problem for the double quote version. --- src/code.l | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/code.l b/src/code.l index 9428432..35efcd9 100644 --- a/src/code.l +++ b/src/code.l @@ -2357,6 +2357,12 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_code->codify(yytext); g_insideProtocolList=FALSE; } +"\""((\\0[Xx0-9]+)|(\\.)|(.))*"\"" { + g_code->codify(yytext); + } +"'"((\\0[Xx0-9]+)|(\\.)|(.))"'" { + g_code->codify(yytext); + } "<" { g_code->codify(yytext); ++g_sharpCount; -- cgit v0.12 From 3fe10a7eba7d55d2e542f3cd354d5a52701249ef Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 2 Nov 2019 15:53:49 +0100 Subject: Changed implementation to use SkipString/SkipStringS. --- src/code.l | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/code.l b/src/code.l index c596bce..60d6c7e 100644 --- a/src/code.l +++ b/src/code.l @@ -2353,12 +2353,6 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_code->codify(yytext); g_insideProtocolList=FALSE; } -"\""((\\0[Xx0-9]+)|(\\.)|(.))*"\"" { - g_code->codify(yytext); - } -"'"((\\0[Xx0-9]+)|(\\.)|(.))"'" { - g_code->codify(yytext); - } "<" { g_code->codify(yytext); ++g_sharpCount; @@ -2368,6 +2362,16 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" if (--g_sharpCount<=0) BEGIN ( Bases ); } +"\"" { + g_code->codify(yytext); + g_lastStringContext=YY_START; + BEGIN(SkipString); + } +"\'" { + g_code->codify(yytext); + g_lastStringContext=YY_START; + BEGIN(SkipStringS); + } "(" { g_code->codify(yytext); g_sharpCount=1; -- cgit v0.12