lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Egor Skriptunoff <egor.skriptunoff@gmail.com> 于2020年4月7日周二 下午4:03写道:
>
> On Tue, Apr 7, 2020 at 6:53 AM Xavier Wang wrote:
>>
>> Is there a way to construct a single source
>> file, that's both a valid Lua script and also a valid C
>> source?
>>
>
>
> #define Lua_and_C  /*
>
> print"Lua code is here"
>
> --[=[*/
> #include <stdio.h>
>
> int main()
> {
>    printf("C code is here");
>    return 0;
> }
>
> //]=]
>

YOU MAKE MY DAY!

I already know that Lua will skip the "#!" at the first line, but
don't know Lua also skip "#" as well.

TIL for that.

Thanks!!

-- 
regards,
Xavier Wang.