From 587c9e0612e5220d02eef7782a24a2fb5d5d02a2 Mon Sep 17 00:00:00 2001 From: Hironori Kitagawa Date: Fri, 21 May 2021 17:25:45 +0900 Subject: [PATCH] ltj-input.buf: removed "require unicode" --- src/ltj-inputbuf.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ltj-inputbuf.lua b/src/ltj-inputbuf.lua index 6423f88..4d57205 100644 --- a/src/ltj-inputbuf.lua +++ b/src/ltj-inputbuf.lua @@ -5,7 +5,6 @@ luatexja.load_module 'base'; local ltjb = luatexja.base luatexja.load_module 'charrange'; local ltjc = luatexja.charrange -require "unicode" local utflen = utf.len local utfbyte = utf.byte local utfchar = utf.char @@ -24,12 +23,11 @@ local start_time_measure, stop_time_measure local function add_comment(buffer) start_time_measure 'inputbuf' local i = utflen(buffer) - while (i>0) and (getcatcode(utfbyte(buffer, i))==1 - or getcatcode(utfbyte(buffer, i))==2) do - i=i-1 + local c = utfbyte(buffer, i) + while (i>0) and (getcatcode(c)==1 or getcatcode(c)==2) do + i=i-1; if (i>0) then c = utfbyte(buffer, i) end; end if i>0 then - local c = utfbyte(buffer, i) if c>=0x80 then local te = tex.endlinechar -- Is the catcode of endline character is 5 (end-of-line)? @@ -46,6 +44,7 @@ local function add_comment(buffer) end end stop_time_measure 'inputbuf' +-- print(">>", buffer) return buffer end -- 2.11.0