JSTQL-JS-Transform/src/index.ts

31 lines
944 B
TypeScript
Raw Normal View History

//import * as babelparser from "../babel/packages/babel-parser";
import * as babelparser from "@babel/parser";
//import core from "../babel/packages/babel-core";
import { parse_with_plugins } from "./parser/parse";
import {
SelfHostedRecipe,
TransformRecipe,
transform,
} from "./transform/transform";
import { parseJSTQL } from "./langium/langiumRunner";
const path = "test_files/test.js";
const file = Bun.file(path);
const codeFromFile = await file.text();
const main = async () => {
//transform(selfHostedTransformExampleMultiStmt, codeFromFile);
const jstql_file =
2024-05-12 18:06:37 +00:00
"/home/rolfmg/Coding/Master/didactic-chainsaw/dsl_files/pipeline.jstql";
const test_file = Bun.file(jstql_file);
const test_JSTQL = await test_file.text();
2024-05-12 18:06:37 +00:00
let proposals = await parseJSTQL(test_JSTQL);
await Bun.write(
"output_files/output.js",
2024-05-12 18:06:37 +00:00
transform(proposals[0].pairs[0], codeFromFile)
);
2023-12-11 18:38:30 +00:00
};
main();