diff --git a/src/components/CodeEditor.astro b/src/components/CodeEditor.astro index 0874cec..d6c620e 100644 --- a/src/components/CodeEditor.astro +++ b/src/components/CodeEditor.astro @@ -1,11 +1,13 @@ --- import { trimAndDedent } from "./utils"; -const {thpcode} = Astro.props; +const { thpcode } = Astro.props; ---
-
-
{trimAndDedent(thpcode).join("\n")}
-
+
+
{trimAndDedent(thpcode).join("\n")}
+
diff --git a/src/components/InteractiveCode.astro b/src/components/InteractiveCode.astro index 3b62e89..d980a57 100644 --- a/src/components/InteractiveCode.astro +++ b/src/components/InteractiveCode.astro @@ -3,8 +3,7 @@ import { lex } from "../lexer/lexer"; import type { Instruction } from "../thp_machine/machine_parser"; import { parse_str } from "../thp_machine/machine_parser"; import { trimAndDedent } from "./utils"; -const {code, steps} = Astro.props; - +const { code, steps } = Astro.props; function highlightCode(lines: Array): string { let outLines: Array = []; @@ -12,12 +11,14 @@ function highlightCode(lines: Array): string { for (const [idx, line] of lines.entries()) { const tokens = lex(line); const lineArray = [ - `
` + `
`, ]; for (const token of tokens) { if (token.token_type !== "") { - lineArray.push(`${token.v}`); + lineArray.push( + `${token.v}`, + ); } else { lineArray.push(token.v); } @@ -42,7 +43,8 @@ try { const serialized_inst = JSON.stringify(instructionSet); --- -
- thp code -
+ thp code +
stdout
-
+
state
- -