From fd3db5c3899daaaefba64479cdf73fcf9c8dbdf3 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 13 Apr 2024 18:02:05 -0500 Subject: Trim util --- read.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'read.lua') diff --git a/read.lua b/read.lua index 666f509..658ad7d 100644 --- a/read.lua +++ b/read.lua @@ -4,7 +4,8 @@ local m = {} local type = require("type") local eof, input_port = type.eof, type.input_port local util = require("util") -local constantly, error, pop = util.constantly, util.error, util.pop +local error, pop = util.error, util.pop +local utf8_char = require("utf8").char local token_separators = "[%s#()\"'`,@;]" @@ -127,7 +128,7 @@ local function consume_string_hexvalue (cs) table.insert(u8ch, c) until c == ";" table.remove(u8ch) -- discard ';' - return utf8.char(tonumber(table.concat(u8ch), 16)), cs + return utf8_char(tonumber(table.concat(u8ch), 16)), cs end local function consume_string (cs) @@ -258,7 +259,7 @@ m.readmacros = { table.insert(Q, m.read(port)) return type.list(Q) end, - comment = constantly(nil), -- throw comments away + comment = function (_,_,_) return nil end, } ---[[ READ ]]--- -- cgit 1.4.1-21-gabe81