luigi scarso wrote:
> The following macro is wrong:
> \def\TestC{%
> \directlua0{%
> \obeyspaces \obeylines

hm, you want to expand this kin dof stuff inside the directlua?

> code =[[
> class Test(object):
>   def __init__(self):
>     self.a=[0,3,81,2,-1]
>     self.b=self.a[:]
>     self.a.sort()
> 
>   def get(self):
>     return self.a,self.b
> ]]
> }}
> 
> ! LuaTeX error [string "luas[0]"]:1: unexpected symbol near '\'.
> \TestC ...def get(self): return self.a,self.b ]] }
> 
> 
> I must preserve spaces and newlines.
> 
> Any idea ?

just use

\startluacode

\stopluacode

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to