OSDN Git Service

Fix ltj-{compat,inputbuf}.lua.
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 29 Apr 2012 10:49:48 +0000 (19:49 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 29 Apr 2012 10:49:48 +0000 (19:49 +0900)
Note that I didn't recompile the manual.

doc/luatexja.dtx
src/ltj-compat.lua
src/ltj-inputbuf.lua

index 3fd84e1..6782759 100644 (file)
@@ -3857,10 +3857,11 @@ Considering these situations, handling of an end-of-line in \LuaTeX-ja are as fo
 \begin{quote}
 A character U+FFFFF (its category code is set to 14~(comment) by
 \LuaTeX-ja) is appended to an input line, \emph{before \LuaTeX\ actually
-process it}, if and only if the following two conditions are satisfied:
+process it}, if and only if the following three conditions are satisfied:
 \begin{enumerate}
 \item The category code of the character $\langle${return}$\rangle$
       (whose character code is 13) is 5~(end-of-line).
+\item The category code of U+FFFFF itself is 14~(comment).
 \item The input line matches the following `regular expression':
 \[
   (\text{any char})^*(\textbf{JAchar})
 
 \begin{quote}
 各入力行に対し,\textbf{その入力行が読まれる前の内部状態で}
-以下の2条件が満たされている場合,\LuaTeX-jaはU+FFFFF番の文字
+以下の3条件が満たされている場合,\LuaTeX-jaはU+FFFFF番の文字
 \footnote{この文字はコメント文字として扱われるように\LuaTeX-ja内部で設定をしている.}
 を末尾に追加する.よって,その場合に改行は空白とは見做されないこととなる.
 \begin{enumerate}
 \item 改行文字(文字コード13番)のカテゴリーコードが5~(end-of-line)である.
+\item U+FFFFFのカテゴリーコードが14~(comment)である.
 \item 入力行は次の「正規表現」にマッチしている:
 \[
   (\text{any char})^*(\textbf{JAchar})
index c21e261..d72cce3 100644 (file)
@@ -37,7 +37,7 @@ end
 -- \kuten: 面区点 (それぞれで16進2桁を使用)=> Unicode 符号位置
 function from_kuten(i)
    if not i then i=0 end
-   tex.write(tostring(luatexja.jisx0208.table_jisx0208_uptex[i]) or '0')
+   tex.write(tostring(luatexja.jisx0208.table_jisx0208_uptex[i] or 0))
 end
 
 -- \euc: EUC-JP による符号位置 => Unicode 符号位置
index 4f7c875..512e4d1 100644 (file)
@@ -27,7 +27,8 @@ function add_comment(buffer)
       local c = utf.byte(buffer, i)
       local ct = tex.getcatcode(c)
       local ctl = tex.getcatcode(13) -- endline character
-      if ((ct==11) or (ct==12)) and (ctl==5) then
+      local ctc = tex.getcatcode(0xFFFFF) -- new comment character
+      if ((ct==11) or (ct==12)) and (ctl==5) and (ctc==14) then
         local p =  node_new(id_glyph)
         p.char = c
         if ltjc.is_ucs_in_japanese_char(p) then