Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YueScript as an additional scripting language #2743

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Format yue.cpp
  • Loading branch information
Kaleidosium committed Jan 21, 2025
commit b5c0e806658e5c7678e2dda10f419d2bfb5e9f4d
90 changes: 45 additions & 45 deletions src/api/yue.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extern "C" {
extern "C"
{
#include "core/core.h"
#include "luaapi.h"
}
Expand Down Expand Up @@ -137,7 +138,8 @@ static const tic_outline_item* getYueOutline(const char* code, s32* size)
if (end > start)
{
tic_outline_item* new_items = (tic_outline_item*)realloc(items, (*size + 1) * Size);
if (new_items) {
if (new_items)
{
items = new_items;
items[*size].pos = start;
items[*size].size = (s32)(end - start + 1);
Expand All @@ -163,48 +165,46 @@ static const u8 MarkRom[] =
};

extern "C" TIC_EXPORT const tic_script EXPORT_SCRIPT(Yue) = {
21, // id
"yue", // name
".yue", // fileExtension
"--", // projectComment
21, // id
"yue", // name
".yue", // fileExtension
"--", // projectComment
{
initYuescript, // init
luaapi_close, // close
luaapi_tick, // tick
luaapi_boot, // boot
{ // callback
luaapi_scn, // scanline
luaapi_bdr, // border
luaapi_menu // menu
}
},
getYueOutline, // getOutline
evalYuescript, // eval
"--[[", // blockCommentStart
"]]", // blockCommentEnd
nullptr, // blockCommentStart2
nullptr, // blockCommentEnd2
nullptr, // blockStringStart
nullptr, // blockStringEnd
nullptr, // stdStringStartEnd
"--", // singleComment
nullptr, // blockEnd
YueKeywords, // keywords
COUNT_OF(YueKeywords), // keywordsCount
nullptr, // lang_isalnum
false, // useStructuredEdition
false, // useBinarySection
0, // api_keywordsCount
nullptr, // api_keywords
{ // demo
DemoRom,
sizeof DemoRom,
nullptr
},
{ // mark
MarkRom,
sizeof MarkRom,
"yuemark.tic"
},
nullptr // demos
initYuescript, // init
luaapi_close, // close
luaapi_tick, // tick
luaapi_boot, // boot
{
// callback
luaapi_scn, // scanline
luaapi_bdr, // border
luaapi_menu // menu
}},
getYueOutline, // getOutline
evalYuescript, // eval
"--[[", // blockCommentStart
"]]", // blockCommentEnd
nullptr, // blockCommentStart2
nullptr, // blockCommentEnd2
nullptr, // blockStringStart
nullptr, // blockStringEnd
nullptr, // stdStringStartEnd
"--", // singleComment
nullptr, // blockEnd
YueKeywords, // keywords
COUNT_OF(YueKeywords), // keywordsCount
nullptr, // lang_isalnum
false, // useStructuredEdition
false, // useBinarySection
0, // api_keywordsCount
nullptr, // api_keywords
{ // demo
DemoRom,
sizeof DemoRom,
nullptr},
{// mark
MarkRom,
sizeof MarkRom,
"yuemark.tic"},
nullptr // demos
};
Loading