diff --git a/engines/befunge93/README.md b/languages/befunge93/README.md similarity index 100% rename from engines/befunge93/README.md rename to languages/befunge93/README.md diff --git a/engines/befunge93/constants.ts b/languages/befunge93/constants.ts similarity index 100% rename from engines/befunge93/constants.ts rename to languages/befunge93/constants.ts diff --git a/engines/befunge93/engine.ts b/languages/befunge93/engine.ts similarity index 100% rename from engines/befunge93/engine.ts rename to languages/befunge93/engine.ts diff --git a/engines/befunge93/index.ts b/languages/befunge93/index.ts similarity index 100% rename from engines/befunge93/index.ts rename to languages/befunge93/index.ts diff --git a/engines/befunge93/input-stream.ts b/languages/befunge93/input-stream.ts similarity index 100% rename from engines/befunge93/input-stream.ts rename to languages/befunge93/input-stream.ts diff --git a/engines/befunge93/renderer.tsx b/languages/befunge93/renderer.tsx similarity index 100% rename from engines/befunge93/renderer.tsx rename to languages/befunge93/renderer.tsx diff --git a/engines/befunge93/runtime.ts b/languages/befunge93/runtime.ts similarity index 100% rename from engines/befunge93/runtime.ts rename to languages/befunge93/runtime.ts diff --git a/engines/befunge93/tests/index.test.ts b/languages/befunge93/tests/index.test.ts similarity index 100% rename from engines/befunge93/tests/index.test.ts rename to languages/befunge93/tests/index.test.ts diff --git a/engines/befunge93/tests/samples/cat.txt b/languages/befunge93/tests/samples/cat.txt similarity index 100% rename from engines/befunge93/tests/samples/cat.txt rename to languages/befunge93/tests/samples/cat.txt diff --git a/engines/befunge93/tests/samples/dna.txt b/languages/befunge93/tests/samples/dna.txt similarity index 100% rename from engines/befunge93/tests/samples/dna.txt rename to languages/befunge93/tests/samples/dna.txt diff --git a/engines/befunge93/tests/samples/factorial.txt b/languages/befunge93/tests/samples/factorial.txt similarity index 100% rename from engines/befunge93/tests/samples/factorial.txt rename to languages/befunge93/tests/samples/factorial.txt diff --git a/engines/befunge93/tests/samples/helloworld.txt b/languages/befunge93/tests/samples/helloworld.txt similarity index 100% rename from engines/befunge93/tests/samples/helloworld.txt rename to languages/befunge93/tests/samples/helloworld.txt diff --git a/engines/befunge93/tests/samples/prime-sieve.txt b/languages/befunge93/tests/samples/prime-sieve.txt similarity index 100% rename from engines/befunge93/tests/samples/prime-sieve.txt rename to languages/befunge93/tests/samples/prime-sieve.txt diff --git a/engines/befunge93/tests/samples/quine1.txt b/languages/befunge93/tests/samples/quine1.txt similarity index 100% rename from engines/befunge93/tests/samples/quine1.txt rename to languages/befunge93/tests/samples/quine1.txt diff --git a/engines/befunge93/tests/samples/quine2.txt b/languages/befunge93/tests/samples/quine2.txt similarity index 100% rename from engines/befunge93/tests/samples/quine2.txt rename to languages/befunge93/tests/samples/quine2.txt diff --git a/engines/befunge93/tests/samples/quine3.txt b/languages/befunge93/tests/samples/quine3.txt similarity index 100% rename from engines/befunge93/tests/samples/quine3.txt rename to languages/befunge93/tests/samples/quine3.txt diff --git a/engines/brainfuck/README.md b/languages/brainfuck/README.md similarity index 100% rename from engines/brainfuck/README.md rename to languages/brainfuck/README.md diff --git a/engines/brainfuck/common.ts b/languages/brainfuck/common.ts similarity index 100% rename from engines/brainfuck/common.ts rename to languages/brainfuck/common.ts diff --git a/engines/brainfuck/engine.ts b/languages/brainfuck/engine.ts similarity index 100% rename from engines/brainfuck/engine.ts rename to languages/brainfuck/engine.ts diff --git a/engines/brainfuck/index.ts b/languages/brainfuck/index.ts similarity index 100% rename from engines/brainfuck/index.ts rename to languages/brainfuck/index.ts diff --git a/engines/brainfuck/renderer.tsx b/languages/brainfuck/renderer.tsx similarity index 100% rename from engines/brainfuck/renderer.tsx rename to languages/brainfuck/renderer.tsx diff --git a/engines/brainfuck/runtime.ts b/languages/brainfuck/runtime.ts similarity index 100% rename from engines/brainfuck/runtime.ts rename to languages/brainfuck/runtime.ts diff --git a/engines/brainfuck/tests/cat.txt b/languages/brainfuck/tests/cat.txt similarity index 100% rename from engines/brainfuck/tests/cat.txt rename to languages/brainfuck/tests/cat.txt diff --git a/engines/brainfuck/tests/cellsize.txt b/languages/brainfuck/tests/cellsize.txt similarity index 100% rename from engines/brainfuck/tests/cellsize.txt rename to languages/brainfuck/tests/cellsize.txt diff --git a/engines/brainfuck/tests/helloworld-subzero.txt b/languages/brainfuck/tests/helloworld-subzero.txt similarity index 100% rename from engines/brainfuck/tests/helloworld-subzero.txt rename to languages/brainfuck/tests/helloworld-subzero.txt diff --git a/engines/brainfuck/tests/helloworld.txt b/languages/brainfuck/tests/helloworld.txt similarity index 100% rename from engines/brainfuck/tests/helloworld.txt rename to languages/brainfuck/tests/helloworld.txt diff --git a/engines/brainfuck/tests/index.test.ts b/languages/brainfuck/tests/index.test.ts similarity index 100% rename from engines/brainfuck/tests/index.test.ts rename to languages/brainfuck/tests/index.test.ts diff --git a/engines/chef/README.md b/languages/chef/README.md similarity index 100% rename from engines/chef/README.md rename to languages/chef/README.md diff --git a/engines/chef/constants.ts b/languages/chef/constants.ts similarity index 100% rename from engines/chef/constants.ts rename to languages/chef/constants.ts diff --git a/engines/chef/engine.ts b/languages/chef/engine.ts similarity index 100% rename from engines/chef/engine.ts rename to languages/chef/engine.ts diff --git a/engines/chef/index.ts b/languages/chef/index.ts similarity index 100% rename from engines/chef/index.ts rename to languages/chef/index.ts diff --git a/engines/chef/parser/constants.ts b/languages/chef/parser/constants.ts similarity index 100% rename from engines/chef/parser/constants.ts rename to languages/chef/parser/constants.ts diff --git a/engines/chef/parser/core.ts b/languages/chef/parser/core.ts similarity index 100% rename from engines/chef/parser/core.ts rename to languages/chef/parser/core.ts diff --git a/engines/chef/parser/index.ts b/languages/chef/parser/index.ts similarity index 100% rename from engines/chef/parser/index.ts rename to languages/chef/parser/index.ts diff --git a/engines/chef/parser/regex.ts b/languages/chef/parser/regex.ts similarity index 100% rename from engines/chef/parser/regex.ts rename to languages/chef/parser/regex.ts diff --git a/engines/chef/renderer/bowl-dish-columns.tsx b/languages/chef/renderer/bowl-dish-columns.tsx similarity index 100% rename from engines/chef/renderer/bowl-dish-columns.tsx rename to languages/chef/renderer/bowl-dish-columns.tsx diff --git a/engines/chef/renderer/index.tsx b/languages/chef/renderer/index.tsx similarity index 100% rename from engines/chef/renderer/index.tsx rename to languages/chef/renderer/index.tsx diff --git a/engines/chef/renderer/ingredients-pane.tsx b/languages/chef/renderer/ingredients-pane.tsx similarity index 100% rename from engines/chef/renderer/ingredients-pane.tsx rename to languages/chef/renderer/ingredients-pane.tsx diff --git a/engines/chef/renderer/kitchen-display.tsx b/languages/chef/renderer/kitchen-display.tsx similarity index 100% rename from engines/chef/renderer/kitchen-display.tsx rename to languages/chef/renderer/kitchen-display.tsx diff --git a/engines/chef/renderer/utils.tsx b/languages/chef/renderer/utils.tsx similarity index 100% rename from engines/chef/renderer/utils.tsx rename to languages/chef/renderer/utils.tsx diff --git a/engines/chef/runtime/index.ts b/languages/chef/runtime/index.ts similarity index 100% rename from engines/chef/runtime/index.ts rename to languages/chef/runtime/index.ts diff --git a/engines/chef/runtime/input-stream.ts b/languages/chef/runtime/input-stream.ts similarity index 100% rename from engines/chef/runtime/input-stream.ts rename to languages/chef/runtime/input-stream.ts diff --git a/engines/chef/runtime/kitchen.ts b/languages/chef/runtime/kitchen.ts similarity index 100% rename from engines/chef/runtime/kitchen.ts rename to languages/chef/runtime/kitchen.ts diff --git a/engines/chef/tests/index.test.ts b/languages/chef/tests/index.test.ts similarity index 100% rename from engines/chef/tests/index.test.ts rename to languages/chef/tests/index.test.ts diff --git a/engines/chef/tests/parser-core.test.ts b/languages/chef/tests/parser-core.test.ts similarity index 100% rename from engines/chef/tests/parser-core.test.ts rename to languages/chef/tests/parser-core.test.ts diff --git a/engines/chef/tests/parser-index.test.ts b/languages/chef/tests/parser-index.test.ts similarity index 100% rename from engines/chef/tests/parser-index.test.ts rename to languages/chef/tests/parser-index.test.ts diff --git a/engines/chef/tests/samples/fibonacci-fromage.txt b/languages/chef/tests/samples/fibonacci-fromage.txt similarity index 100% rename from engines/chef/tests/samples/fibonacci-fromage.txt rename to languages/chef/tests/samples/fibonacci-fromage.txt diff --git a/engines/chef/tests/samples/hello-world-cake.txt b/languages/chef/tests/samples/hello-world-cake.txt similarity index 100% rename from engines/chef/tests/samples/hello-world-cake.txt rename to languages/chef/tests/samples/hello-world-cake.txt diff --git a/engines/chef/tests/samples/hello-world-souffle.txt b/languages/chef/tests/samples/hello-world-souffle.txt similarity index 100% rename from engines/chef/tests/samples/hello-world-souffle.txt rename to languages/chef/tests/samples/hello-world-souffle.txt diff --git a/engines/chef/types.ts b/languages/chef/types.ts similarity index 100% rename from engines/chef/types.ts rename to languages/chef/types.ts diff --git a/engines/deadfish/README.md b/languages/deadfish/README.md similarity index 100% rename from engines/deadfish/README.md rename to languages/deadfish/README.md diff --git a/engines/deadfish/constants.ts b/languages/deadfish/constants.ts similarity index 100% rename from engines/deadfish/constants.ts rename to languages/deadfish/constants.ts diff --git a/engines/deadfish/engine.ts b/languages/deadfish/engine.ts similarity index 100% rename from engines/deadfish/engine.ts rename to languages/deadfish/engine.ts diff --git a/engines/deadfish/index.ts b/languages/deadfish/index.ts similarity index 100% rename from engines/deadfish/index.ts rename to languages/deadfish/index.ts diff --git a/engines/deadfish/renderer.tsx b/languages/deadfish/renderer.tsx similarity index 100% rename from engines/deadfish/renderer.tsx rename to languages/deadfish/renderer.tsx diff --git a/engines/deadfish/runtime.ts b/languages/deadfish/runtime.ts similarity index 100% rename from engines/deadfish/runtime.ts rename to languages/deadfish/runtime.ts diff --git a/engines/deadfish/tests/288.txt b/languages/deadfish/tests/288.txt similarity index 100% rename from engines/deadfish/tests/288.txt rename to languages/deadfish/tests/288.txt diff --git a/engines/deadfish/tests/helloworld.txt b/languages/deadfish/tests/helloworld.txt similarity index 100% rename from engines/deadfish/tests/helloworld.txt rename to languages/deadfish/tests/helloworld.txt diff --git a/engines/deadfish/tests/index.test.ts b/languages/deadfish/tests/index.test.ts similarity index 100% rename from engines/deadfish/tests/index.test.ts rename to languages/deadfish/tests/index.test.ts diff --git a/engines/deadfish/tests/zero1.txt b/languages/deadfish/tests/zero1.txt similarity index 100% rename from engines/deadfish/tests/zero1.txt rename to languages/deadfish/tests/zero1.txt diff --git a/engines/deadfish/tests/zero2.txt b/languages/deadfish/tests/zero2.txt similarity index 100% rename from engines/deadfish/tests/zero2.txt rename to languages/deadfish/tests/zero2.txt diff --git a/engines/engine-utils.ts b/languages/engine-utils.ts similarity index 100% rename from engines/engine-utils.ts rename to languages/engine-utils.ts diff --git a/engines/execution-controller.ts b/languages/execution-controller.ts similarity index 100% rename from engines/execution-controller.ts rename to languages/execution-controller.ts diff --git a/engines/setup-worker.ts b/languages/setup-worker.ts similarity index 100% rename from engines/setup-worker.ts rename to languages/setup-worker.ts diff --git a/engines/test-utils.ts b/languages/test-utils.ts similarity index 100% rename from engines/test-utils.ts rename to languages/test-utils.ts diff --git a/engines/types.ts b/languages/types.ts similarity index 100% rename from engines/types.ts rename to languages/types.ts diff --git a/engines/worker-constants.ts b/languages/worker-constants.ts similarity index 100% rename from engines/worker-constants.ts rename to languages/worker-constants.ts diff --git a/engines/worker-errors.ts b/languages/worker-errors.ts similarity index 100% rename from engines/worker-errors.ts rename to languages/worker-errors.ts diff --git a/pages/ide/befunge93.tsx b/pages/ide/befunge93.tsx index 4ce0335..f5d97eb 100644 --- a/pages/ide/befunge93.tsx +++ b/pages/ide/befunge93.tsx @@ -3,7 +3,7 @@ import { NextPage } from "next"; import Head from "next/head"; import { Mainframe } from "../../ui/Mainframe"; import { Header } from "../../ui/header"; -import LangProvider from "../../engines/befunge93"; +import LangProvider from "../../languages/befunge93"; const LANG_ID = "befunge93"; const LANG_NAME = "Befunge-93"; diff --git a/pages/ide/brainfuck.tsx b/pages/ide/brainfuck.tsx index 6206606..c46e927 100644 --- a/pages/ide/brainfuck.tsx +++ b/pages/ide/brainfuck.tsx @@ -3,7 +3,7 @@ import { NextPage } from "next"; import Head from "next/head"; import { Mainframe } from "../../ui/Mainframe"; import { Header } from "../../ui/header"; -import LangProvider from "../../engines/brainfuck"; +import LangProvider from "../../languages/brainfuck"; const LANG_ID = "brainfuck"; const LANG_NAME = "Brainfuck"; diff --git a/pages/ide/chef.tsx b/pages/ide/chef.tsx index 592dc10..99aaea8 100644 --- a/pages/ide/chef.tsx +++ b/pages/ide/chef.tsx @@ -3,7 +3,7 @@ import { NextPage } from "next"; import Head from "next/head"; import { Mainframe } from "../../ui/Mainframe"; import { Header } from "../../ui/header"; -import LangProvider from "../../engines/chef"; +import LangProvider from "../../languages/chef"; const LANG_ID = "chef"; const LANG_NAME = "Chef"; diff --git a/pages/ide/deadfish.tsx b/pages/ide/deadfish.tsx index 836220d..2230125 100644 --- a/pages/ide/deadfish.tsx +++ b/pages/ide/deadfish.tsx @@ -3,7 +3,7 @@ import { NextPage } from "next"; import Head from "next/head"; import { Mainframe } from "../../ui/Mainframe"; import { Header } from "../../ui/header"; -import LangProvider from "../../engines/deadfish"; +import LangProvider from "../../languages/deadfish"; const LANG_ID = "deadfish"; const LANG_NAME = "Deadfish"; diff --git a/scripts/add-new-language.js b/scripts/add-new-language.js index 48e7d88..e81a53a 100644 --- a/scripts/add-new-language.js +++ b/scripts/add-new-language.js @@ -14,7 +14,7 @@ if (!langId || !langName) { } // Check if language provider directory already exists -const dir = path.resolve(__dirname, "../engines/", langId); +const dir = path.resolve(__dirname, "../languages/", langId); if (fs.existsSync(dir)) { console.log(`Language ID '${langId}' already exists.`); process.exit(0); diff --git a/ui/Mainframe.tsx b/ui/Mainframe.tsx index 31681b4..73b9b46 100644 --- a/ui/Mainframe.tsx +++ b/ui/Mainframe.tsx @@ -3,11 +3,11 @@ import { CodeEditor, CodeEditorRef } from "../ui/code-editor"; import { InputEditor, InputEditorRef } from "../ui/input-editor"; import { MainLayout } from "../ui/MainLayout"; import { useExecController } from "../ui/use-exec-controller"; -import { LanguageProvider, StepExecutionResult } from "../engines/types"; +import { LanguageProvider, StepExecutionResult } from "../languages/types"; import { OutputViewer, OutputViewerRef } from "../ui/output-viewer"; import { ExecutionControls } from "./execution-controls"; import { RendererRef, RendererWrapper } from "./renderer-wrapper"; -import { WorkerRuntimeError } from "../engines/worker-errors"; +import { WorkerRuntimeError } from "../languages/worker-errors"; type Props = { langName: string; diff --git a/ui/code-editor/index.tsx b/ui/code-editor/index.tsx index ef4ed66..379613f 100644 --- a/ui/code-editor/index.tsx +++ b/ui/code-editor/index.tsx @@ -5,7 +5,7 @@ import { DocumentEdit, DocumentRange, MonacoTokensProvider, -} from "../../engines/types"; +} from "../../languages/types"; import { createHighlightRange, createMonacoDocEdit, @@ -16,7 +16,7 @@ import { useEditorBreakpoints } from "./use-editor-breakpoints"; import darkTheme from "./themes/dark.json"; import lightTheme from "./themes/light.json"; import { useDarkMode } from "../providers/dark-mode-provider"; -import { WorkerParseError } from "../../engines/worker-errors"; +import { WorkerParseError } from "../../languages/worker-errors"; import { useCodeValidator } from "./use-code-validator"; /** Keeps track of user's original program and modifications done to it */ diff --git a/ui/code-editor/monaco-utils.ts b/ui/code-editor/monaco-utils.ts index daebfce..e5c598f 100644 --- a/ui/code-editor/monaco-utils.ts +++ b/ui/code-editor/monaco-utils.ts @@ -1,6 +1,6 @@ import monaco from "monaco-editor"; -import { DocumentEdit, DocumentRange } from "../../engines/types"; -import { WorkerParseError } from "../../engines/worker-errors"; +import { DocumentEdit, DocumentRange } from "../../languages/types"; +import { WorkerParseError } from "../../languages/worker-errors"; /** Type alias for an instance of Monaco editor */ export type EditorInstance = monaco.editor.IStandaloneCodeEditor; diff --git a/ui/code-editor/use-code-validator.ts b/ui/code-editor/use-code-validator.ts index ae26704..83db2e3 100644 --- a/ui/code-editor/use-code-validator.ts +++ b/ui/code-editor/use-code-validator.ts @@ -1,5 +1,5 @@ import * as React from "react"; -import { WorkerParseError } from "../../engines/worker-errors"; +import { WorkerParseError } from "../../languages/worker-errors"; import { createValidationMarker, EditorInstance, diff --git a/ui/code-editor/use-editor-lang-config.ts b/ui/code-editor/use-editor-lang-config.ts index 17a1480..efce0c8 100644 --- a/ui/code-editor/use-editor-lang-config.ts +++ b/ui/code-editor/use-editor-lang-config.ts @@ -1,6 +1,6 @@ import React from "react"; import { useMonaco } from "@monaco-editor/react"; -import { MonacoTokensProvider } from "../../engines/types"; +import { MonacoTokensProvider } from "../../languages/types"; type ConfigParams = { languageId: string; diff --git a/ui/output-viewer.tsx b/ui/output-viewer.tsx index c27040e..317ae25 100644 --- a/ui/output-viewer.tsx +++ b/ui/output-viewer.tsx @@ -1,6 +1,9 @@ import React from "react"; import { Colors, Text } from "@blueprintjs/core"; -import { WorkerParseError, WorkerRuntimeError } from "../engines/worker-errors"; +import { + WorkerParseError, + WorkerRuntimeError, +} from "../languages/worker-errors"; /** Format a ParseError for displaying as output */ const formatParseError = (error: WorkerParseError): string => { diff --git a/ui/renderer-wrapper.tsx b/ui/renderer-wrapper.tsx index dee2d3d..ae4b8b5 100644 --- a/ui/renderer-wrapper.tsx +++ b/ui/renderer-wrapper.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { LanguageProvider } from "../engines/types"; +import { LanguageProvider } from "../languages/types"; export interface RendererRef { /** Update runtime state to renderer */ diff --git a/ui/use-exec-controller.ts b/ui/use-exec-controller.ts index c5ceb64..a18739e 100644 --- a/ui/use-exec-controller.ts +++ b/ui/use-exec-controller.ts @@ -1,10 +1,13 @@ import React from "react"; -import { StepExecutionResult } from "../engines/types"; +import { StepExecutionResult } from "../languages/types"; import { WorkerRequestData, WorkerResponseData, -} from "../engines/worker-constants"; -import { WorkerParseError, WorkerRuntimeError } from "../engines/worker-errors"; +} from "../languages/worker-constants"; +import { + WorkerParseError, + WorkerRuntimeError, +} from "../languages/worker-errors"; import { useErrorBoundary } from "./providers/error-boundary-provider"; /** Possible states for the worker to be in */ diff --git a/worker-pack/webpack.common.js b/worker-pack/webpack.common.js index b2a94c4..5c829d7 100644 --- a/worker-pack/webpack.common.js +++ b/worker-pack/webpack.common.js @@ -1,14 +1,14 @@ const path = require("path"); const fs = require("fs"); -const langNames = fs.readdirSync("engines").filter((name) => { - const stats = fs.statSync(`./engines/${name}`); +const langNames = fs.readdirSync("languages").filter((name) => { + const stats = fs.statSync(`./languages/${name}`); return stats.isDirectory(); }); const entryPoints = {}; for (const lang of langNames) { - entryPoints[lang] = `./engines/${lang}/engine.ts`; + entryPoints[lang] = `./languages/${lang}/engine.ts`; } console.log(path.resolve(__dirname, "worker-pack/tsconfig.json"));