From 4258503c0e5e473bbddcf119fbf4ffdfa56ef3a8 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 7 Nov 2025 20:50:48 -0800 Subject: [PATCH] shrimp cli wants the prelude too --- bin/shrimp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/shrimp b/bin/shrimp index 5706ab9..dd1bf9a 100755 --- a/bin/shrimp +++ b/bin/shrimp @@ -3,6 +3,7 @@ import { Compiler } from '../src/compiler/compiler' import { colors, globals } from '../src/prelude' import { parser } from '../src/parser/shrimp' +import { setGlobals } from '../src/parser/tokenizer' import { treeToString } from '../src/utils/tree' import { VM, fromValue, bytecodeToString } from 'reefvm' import { readFileSync, writeFileSync, mkdirSync } from 'fs' @@ -25,6 +26,7 @@ async function runFile(filePath: string) { async function compileFile(filePath: string) { try { + setGlobals(Object.keys(globals)) const code = readFileSync(filePath, 'utf-8') const compiler = new Compiler(code) return bytecodeToString(compiler.bytecode) @@ -36,6 +38,7 @@ async function compileFile(filePath: string) { async function parseFile(filePath: string) { try { + setGlobals(Object.keys(globals)) const code = readFileSync(filePath, 'utf-8') const tree = parser.parse(code) return treeToString(tree, code)