summaryrefslogtreecommitdiff
path: root/mod/tex/context/third/rst/rst_parser.lua
diff options
context:
space:
mode:
Diffstat (limited to 'mod/tex/context/third/rst/rst_parser.lua')
-rw-r--r--mod/tex/context/third/rst/rst_parser.lua30
1 files changed, 16 insertions, 14 deletions
diff --git a/mod/tex/context/third/rst/rst_parser.lua b/mod/tex/context/third/rst/rst_parser.lua
index 1f3a257..0a94f05 100644
--- a/mod/tex/context/third/rst/rst_parser.lua
+++ b/mod/tex/context/third/rst/rst_parser.lua
@@ -23,18 +23,18 @@ local rst = thirddata.rst
local helpers = thirddata.rst_helpers
local optional_setups = thirddata.rst_setups
-rst.strip_BOM = false
-rst.expandtab = false
+rst.strip_BOM = true
+rst.expandtab = true
rst.shiftwidth = 4
rst.crlf = true
helpers.rst_debug = false
-local iowrite = io.write
-local fmt = string.format
-local stringlen = string.len
-local stringstrip = string.strip
-local utf = unicode.utf8
-local utflen = utf.len
+local iowrite = io.write
+local stringformat = string.format
+local stringlen = string.len
+local stringstrip = string.strip
+local utf = unicode.utf8
+local utflen = utf.len
local warn
do
@@ -44,7 +44,7 @@ do
ndebug = ndebug + 1
local slen = #str + 3
--str = "*["..str.."]"
- str = fmt("*[%4d][%s]", ndebug, str)
+ str = stringformat("*[%4d][%s]", ndebug, str)
for i,j in ipairs({...}) do
if 80 - i * 8 - slen < 0 then
local indent = ""
@@ -53,15 +53,17 @@ do
end
str = str .. "\n" .. indent
end
- str = str .. fmt(" |%6s", stringstrip(tostring(j)))
+ str = str .. stringformat(" |%6s", stringstrip(tostring(j)))
end
iowrite(str .. " |\n")
return 0
end
end
-local C, Cb, Cc, Cg, Cmt, Cp, Cs, Ct
- = lpeg.C, lpeg.Cb, lpeg.Cc, lpeg.Cg, lpeg.Cmt, lpeg.Cp, lpeg.Cs, lpeg.Ct
+local C, Cb, Cc, Cg,
+ Cmt, Cp, Cs, Ct
+ = lpeg.C, lpeg.Cb, lpeg.Cc, lpeg.Cg,
+ lpeg.Cmt, lpeg.Cp, lpeg.Cs, lpeg.Ct
local P, R, S, V, match
= lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.match
@@ -1510,7 +1512,7 @@ function thirddata.rst.do_rst_inclusion (iname, fname)
local setups = get_setups(true)
local incnr = #rst_incsetups + 1
- local tmp_file = tex.jobname .. fmt("–rst_inclusion-%d.tex.tmp", incnr)
+ local tmp_file = tex.jobname .. stringformat("–rst_inclusion-%d.tex.tmp", incnr)
if processed then
processed = strip_comments:match(processed)
@@ -1532,7 +1534,7 @@ function thirddata.rst.get_rst_inclusion (iname)
if rst_inclusions[iname] then
context.input(rst_inclusions[iname])
else
- context(fmt("{\\bf File for inclusion “%s” not found.}\par ", iname))
+ context(stringformat("{\\bf File for inclusion “%s” not found.}\par ", iname))
end
end