Dear list,
With following MWE :
%%%
\startluacode
\stopluacode
\appendtoks\ctxlua{userdata.font_switch(\fontid\font)}\to \everyfontswitch
\setupbodyfont[mainfont, 9pt]
\starttext
Foo.
\stoptext
%%%
I get following error (commenting out the \appendtoks line makes the error to disappear) :
token call, syntax: [ctxlua]:1: unexpected symbol near '\'
1 >> \startluacode
2
3 \stopluacode
4
5 \appendtoks\ctxlua{userdata.font_switch(\fontid\font)}\to \everyfontswitch
6
7 \setupbodyfont[mainfont, 9pt]
8
9 \starttext
10
11 Foo.