diff --git a/src/components/Code.astro b/src/components/Code.astro index 4e7ed07..709f5e9 100644 --- a/src/components/Code.astro +++ b/src/components/Code.astro @@ -1,10 +1,11 @@ --- import { native_highlighter } from "../lexer/highlighter"; +import type { HighlightLevel } from "../lexer/types"; import CodeError from "./docs/CodeError.astro"; -const { thpcode, no_warnings } = Astro.props; +const { thpcode, no_warnings, level } = Astro.props; -const [native_html, error_type, error_message] = await native_highlighter(thpcode); +const [native_html, error_type, error_message] = await native_highlighter(thpcode, level as HighlightLevel); ---
): string {
-    let outLines: Array = [];
-
-    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}`, - ); - } else { - lineArray.push(token.v); - } - } - lineArray.push("
"); - - outLines.push(lineArray.join("")); - } - - return outLines.join("\n"); -} - -const codeHtml = highlightCode(leftTrimDedent(code)); -let instructionSet: Array>; -try { - instructionSet = parse_str(steps); -} catch (e) { - console.error(Astro.url); - throw e; -} - -const serialized_inst = JSON.stringify(instructionSet); +import Code from "./Code.astro"; +const { code } = Astro.props; +// TODO: Delete this component, replace with Code --- -
- thp code -
-
-
-
stdout
-
-
-
-
-
-
state
-
- -
-
-
-
- - -
-
- - + diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 9e51092..8b9c34a 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -30,12 +30,6 @@ const { showSidebarButton = true } = Astro.props; > Learn -