MCPcopy Create free account
hub / github.com/LambdaNote/support-ts-tapl / parseSelf

Function parseSelf

book/tiny-ts-parser.ts:1247–1285  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

1245}
1246
1247export function parseSelf(code: string): TermForSelf {
1248 return subsetSystem(
1249 parse(code),
1250 ["Boolean", "Number", "String", "Option", "Array", "Record", "Func", "Object", "TaggedUnion", "Rec", "TypeVar"],
1251 [
1252 "true",
1253 "false",
1254 "not",
1255 "compare",
1256 "if",
1257 "number",
1258 "add",
1259 "string",
1260 "var",
1261 "func",
1262 "call",
1263 "seq",
1264 "const",
1265 "assign",
1266 "for",
1267 "forOf",
1268 "arrayNew",
1269 "arrayExt",
1270 "recordNew",
1271 "recordCopy",
1272 "recordExt",
1273 "recordIn",
1274 "member",
1275 "objectNew",
1276 "objectGet",
1277 "taggedUnionNew",
1278 "taggedUnionExt",
1279 "taggedUnionGet",
1280 "recFunc",
1281 "undefined",
1282 ],
1283 true,
1284 );
1285}
1286
1287// ---
1288// Helper functions

Callers

nothing calls this directly

Calls 2

subsetSystemFunction · 0.70
parseFunction · 0.70

Tested by

no test coverage detected