Correction:
-- works as comments in luacode
% is used to format strings
It's a bit different: code below is ok, and TeX comment is seen "before" lua comment .
Only Hello! is print on pdf
%%%%%%%%%%%%%%%%%%
\def\Foo{%
\startluacode
-- this is a lua comment
%% this is a TeX comment
\stopluacode
}
\starttext
Hello !
\Foo
\stoptext
%%%%%%%%%%%%%%%%%%%
This is wrong
%%%%%%%%%%%%%%%%%%
\starttext
Hello !
\startluacode
-- this is a lua comment
%% this is a TeX comment
\stopluacode
\stoptext
%%%%%%%%%%%%%%%%%%%
! LuaTeX error <main ctx instance>:3: unexpected symbol near '%'.
\@@expanded ... comment
%% this is a TeX comment
}
l.6 \stopluacode
?