doc/transforms: avoid lua lexer error in luaxform example

Pygments 2.21 lexes "x < 0 or x > y" in Lua as a Lua 5.4 variable
attribute (e.g. "<const>"), producing an error token on the "0". Sphinx
reports this as a highlighting failure warning, and as the PDF build
treats warnings as errors, "make dist" fails while building the PDF.

Reorder the comparisons so the Lua example is lexed correctly. The logic
of the example is unchanged.
pull/16338/head
Jason Ish 1 month ago committed by Victor Julien
parent 42d6aeada3
commit 35bd603ba3

@ -418,12 +418,12 @@ the buffer.
end
end
local str_len = #input
if offset < 0 or offset > str_len then
if offset < 0 or str_len < offset then
print("offset is out of bounds: " .. offset)
return nil
end
str_len = str_len - offset
if bytes < 0 or bytes > str_len then
if bytes < 0 or str_len < bytes then
print("invalid bytes " .. bytes .. " or bytes > length " .. bytes .. " length " .. str_len)
return nil
end

Loading…
Cancel
Save