Skip to content

Commit ee7eed6

Browse files
committed
mark fenv funcs removed
1 parent 24c8d9f commit ee7eed6

1 file changed

Lines changed: 27 additions & 9 deletions

File tree

src/slua/slua-sele-gen.ts

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { stringify } from "@std/yaml";
22
import {
33
buildSluaJson,
4-
SLua,
4+
// SLua,
55
SLuaBaseType,
66
SLuaConstDef,
77
SLuaCustomType,
@@ -14,16 +14,24 @@ import {
1414
SLuaTypeDef,
1515
VarOpType,
1616
} from "./slua-json-gen.ts";
17-
import { isTypeCustom, isTypeFunction, isTypeValue } from "./slua-common.ts";
17+
// import { isTypeCustom, isTypeFunction, isTypeValue } from "./slua-common.ts";
1818
import { StrObj } from "../types.d.ts";
1919
import { LSLDef } from "../xml/xml-lsl-json-gen.ts";
2020

21-
type SeleneDef = SelenePropDef | SeleneFuncDef | SeleneStructDef;
21+
type SeleneDef =
22+
| SelenePropDef
23+
| SeleneFuncDef
24+
| SeleneStructDef
25+
| SeleneRemovedDef;
2226

2327
type SelenePropDef = {
2428
property: "read-only" | "new-fields" | "override-fields" | "full-write";
2529
};
2630

31+
type SeleneRemovedDef = {
32+
removed: true;
33+
};
34+
2735
type SeleneStructDef = {
2836
struct: string;
2937
};
@@ -81,7 +89,17 @@ export async function buildSluaSelene(
8189
const selene: Selene = {
8290
base: "luau",
8391
name: "sl_selene_defs",
84-
globals: {},
92+
globals: {
93+
"getfenv": {
94+
removed: true,
95+
},
96+
"setfenv": {
97+
removed: true,
98+
},
99+
"loadstring": {
100+
removed: true,
101+
},
102+
},
85103
structs: {},
86104
};
87105

@@ -102,13 +120,13 @@ function outputSluaStructs(
102120
const struct: SeleneStruct = {};
103121
for (const fName in cls.funcs) {
104122
const func = cls.funcs[fName];
105-
console.error("=============", fName, "=============");
123+
// console.error("=============", fName, "=============");
106124
const sFunc: SeleneStructFunc = {
107125
method: true,
108126
must_use: func.must_use,
109127
args: buildFuncArgs(func.signatures, types, true),
110128
};
111-
console.error("=============", " ", "=============");
129+
// console.error("=============", " ", "=============");
112130
struct[fName] = sFunc;
113131
}
114132
structs[name] = struct;
@@ -242,9 +260,9 @@ function castVarOpToSelene(
242260
args = [...args, ...castSluaArgTypesToSelene(vtype.type, types)];
243261
}
244262
}
245-
console.error("----------------------------------------");
246-
console.error(args);
247-
console.error("----------------------------------------");
263+
// console.error("----------------------------------------");
264+
// console.error(args);
265+
// console.error("----------------------------------------");
248266

249267
if (isStringArrayArray(args)) {
250268
args = args.flat();

0 commit comments

Comments
 (0)