commit 776cd9145f657d6bd4a3ae0182adadd9f5e0bb87
parent 27d0fba8abf0dafdbceb58530e88d4a313ae6ed4
Author: citbl <citbl@citbl.org>
Date: Sat, 23 May 2026 17:36:33 +1000
wip
Diffstat:
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/mtcl/.gitignore b/mtcl/.gitignore
@@ -1,2 +1,2 @@
.DS_Store
-*.lua~
+*~
diff --git a/mtcl/main.lua b/mtcl/main.lua
@@ -3,8 +3,6 @@
local file = io.open(arg[1], "rb")
local contents = file:read("*all")
-function skip() end
-
function read_ident(start, src)
local word = ""
local a = string.byte("a")
@@ -15,7 +13,11 @@ function read_ident(start, src)
local nine = string.byte("9")
for i = start, #src do
local c = src:sub(i, i):byte()
- if not (c >= a and c <= z) and not (c >= A and c <= Z) and not (c >= zero and c <= nine) then
+ if
+ not (c >= a and c <= z)
+ and not (c >= A and c <= Z)
+ and not (c >= zero and c <= nine)
+ then
break
end
word = word .. string.char(c)
@@ -25,6 +27,7 @@ end
function lex(src)
local i = 1
+ local function skip() end
local whitespacers = {
["\t"] = skip,
["\r"] = skip,
diff --git a/mtcl/makefile b/mtcl/makefile
@@ -1,2 +1,5 @@
+MAKEFLAGS += --silent
+
default:
lua main.lua target.mty
+ stylua --column-width 80 .