From 5eecbd6ef771a54b455d96f4033212062d7c3f8f Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Wed, 29 May 2024 23:00:53 -0300 Subject: Implement cratera bootstrap --- src/cratera/init.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/cratera/init.lua') diff --git a/src/cratera/init.lua b/src/cratera/init.lua index bac3f53..a354d56 100644 --- a/src/cratera/init.lua +++ b/src/cratera/init.lua @@ -16,13 +16,16 @@ along with this program. If not, see . --]] --- This code is highly experimental and not very good - local parser = require "cratera.parser" local luatokens = require "cratera.luatokens" local compiler = require "cratera.compiler" -local LUA_SIGNATURE = string.dump(function() end):sub(1,1) +local LUA_SIGNATURE +if string.dump then + LUA_SIGNATURE = string.dump(function() end):sub(1,1) +else + LUA_SIGNATURE = string.char(27) +end local function cratera_load(reader, ...) if type(reader) == "string" and reader:sub(1,1) == LUA_SIGNATURE then -- cgit 1.4.1