fix possible nested comment

This commit is contained in:
takase1121 2021-11-06 20:24:17 +08:00
parent acab4e3b26
commit 3982a8b31c
No known key found for this signature in database
GPG Key ID: 60EEFFC68EB3031B
1 changed files with 10 additions and 4 deletions

View File

@ -66,6 +66,9 @@ decl_export() {
uncomment $1 | onelineize | export_sym uncomment $1 | onelineize | export_sym
} }
print_self() {
cat "$0" | sed -e 's#^#// #'
}
generate_header() { generate_header() {
local LUA_PATH="$1" local LUA_PATH="$1"
@ -83,10 +86,10 @@ generate_header() {
echo "In linux, to compile this file, you'd do: 'gcc -o xxxxx.so -shared xxxxx.c'. Simple!" echo "In linux, to compile this file, you'd do: 'gcc -o xxxxx.so -shared xxxxx.c'. Simple!"
echo "Due to the way the API is structured, you *should not* link or include lua libraries." echo "Due to the way the API is structured, you *should not* link or include lua libraries."
echo "This file was automatically generated by the below code. DO NOT MODIFY DIRECTLY." echo "This file was automatically generated by the below code. DO NOT MODIFY DIRECTLY."
echo
echo
cat "$0"
echo "**/" echo "**/"
echo
print_self
echo
echo "#include <stddef.h>" echo "#include <stddef.h>"
decl "$LUA_PATH/lua.h" decl "$LUA_PATH/lua.h"
@ -112,7 +115,10 @@ generate_api_require() {
echo "returns a function pointer with it's corresponding name." echo "returns a function pointer with it's corresponding name."
echo echo
echo "This file is automatically generated. DO NOT MODIFY." echo "This file is automatically generated. DO NOT MODIFY."
echo "*/" echo "**/"
echo
print_self
echo
echo "#include <string.h>" echo "#include <string.h>"
echo "#include <stddef.h>" echo "#include <stddef.h>"
echo '#include "lua.h"' echo '#include "lua.h"'