Re: [NTG-context] verb-c
I have a little problem with the module 'verb-c'.
Backslashes in verbatim text seem to disturb colors. ---------------------------------------------------- \usemodule[verb-c] \setupcolors[state=start] \setuptyping[C][color=blue,palet=colorpretty, numbering=line] \starttext Davor \startC #include
int main() { printf("Hallo\n"); } \stopC Danach \stoptext ---------------------------------------------------- Problem:
'Danach' is blue! Last line number has the same color as the quotet String "Hallo ConTeXt\n".
Delete the newline char and all is ok!
How can this be fixed?
puts("Hallo");
nikolai
You can't be serious! Escape-Sequences like \n,\r,\t,\123 or \xef are integral part of the C-language and I have this in many different places in a lot of C-source files. Is there no solution? Why does this happen? Wolfgang
wwl@musensturm.de wrote:
How can this be fixed?
puts("Hallo");
nikolai
You can't be serious!
I thought that was an extremely funny answer :-)
Escape-Sequences like \n,\r,\t,\123 or \xef are integral part of the C-language and I have this in many different places in a lot of C-source files.
Is there no solution? Why does this happen?
It happens because the \n is at the very end of the double quoted string. It is a bug / oversight in the verb-c.tex, but I have no time to fix it right now. I will try to have a look at it in the weekend. Taco
Taco Hoekwater wrote:
wwl@musensturm.de wrote:
How can this be fixed?
puts("Hallo");
nikolai
You can't be serious!
I thought that was an extremely funny answer :-)
Escape-Sequences like \n,\r,\t,\123 or \xef are integral part of the C-language and I have this in many different places in a lot of C-source files.
Is there no solution? Why does this happen?
It happens because the \n is at the very end of the double quoted string. It is a bug / oversight in the verb-c.tex, but I have no time to fix it right now. I will try to have a look at it in the weekend.
can it be that the (here commented) \beginofpretty[\!!prettyeight]% \beginofpretty[\!!prettynine]% pickup is not needed? i guess that it has no matching stop and since colors are grouped ... \gdef\doCtypefiveA#1#2% {\endCtypesix \ifinCcomment \getpretties{#1}{#2}% \else\ifinCsingle \getprettydata{#2}% \ifnum\prettytype=50 \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty%\beginofpretty[\!!prettyeight]% \else\ifnum\prettytype=80 \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty%\beginofpretty[\!!prettyeight]% \else \getpretties{#1}{#2}% \fi\fi \else\ifinCdouble \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty% \beginofpretty[\!!prettynine]% \else \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty \fi\fi\fi} \gdef\doCtypefiveB#1% {\endCtypesix \ifinCcomment \ifcat#1\relax \continueCsinglelinecommenttrue \getpretty{#1}% \else \getpretty{#1}% \fi \else\ifinCsingle \getpretty{#1}% \else\ifinCdouble \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty% \beginofpretty[\!!prettynine]% \else \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty \fi\fi\fi} so: \gdef\doCtypefiveA#1#2% {\endCtypesix \ifinCcomment \getpretties{#1}{#2}% \else\ifinCsingle \getprettydata{#2}% \ifnum\prettytype=50 \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty \else\ifnum\prettytype=80 \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty \else \getpretties{#1}{#2}% \fi\fi \else\ifinCdouble \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty \else \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty \fi\fi\fi} \gdef\doCtypefiveB#1% {\endCtypesix \ifinCcomment \ifcat#1\relax \continueCsinglelinecommenttrue \getpretty{#1}% \else \getpretty{#1}% \fi \else\ifinCsingle \getpretty{#1}% \else\ifinCdouble \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty \else \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty \fi\fi\fi} seems to work ok here ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Taco Hoekwater
-
wwl@musensturm.de