ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: verb-c
       [not found] <mailman.390.1155851396.2039.ntg-context@ntg.nl>
@ 2006-08-18  8:01 ` wwl
  2006-08-18  8:28   ` verb-c Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: wwl @ 2006-08-18  8:01 UTC (permalink / raw)


> > 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 <stdio.h>
> >
> > 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: verb-c
  2006-08-18  8:01 ` verb-c wwl
@ 2006-08-18  8:28   ` Taco Hoekwater
  2006-08-18  8:37     ` verb-c Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2006-08-18  8:28 UTC (permalink / raw)




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: verb-c
  2006-08-18  8:28   ` verb-c Taco Hoekwater
@ 2006-08-18  8:37     ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2006-08-18  8:37 UTC (permalink / raw)


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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-18  8:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.390.1155851396.2039.ntg-context@ntg.nl>
2006-08-18  8:01 ` verb-c wwl
2006-08-18  8:28   ` verb-c Taco Hoekwater
2006-08-18  8:37     ` verb-c Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).