| 1 |
#!/usr/bin/env texlua |
| 2 |
local io, os, string, table, package, require, assert, error, ipairs, type, select, arg = io, os, string, table, package, require, assert, error, ipairs, type, select, arg |
| 3 |
os.type = os.type or "unix" |
| 4 |
if lfs and not package.loaded['lfs'] then package.loaded['lfs'] = lfs end |
| 5 |
if os.type == "windows" then |
| 6 |
package.preload["texrunner.pathutil"] = function(...) |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
local assert = assert |
| 29 |
local select = select |
| 30 |
local string = string |
| 31 |
local string_find = string.find |
| 32 |
local string_sub = string.sub |
| 33 |
local string_match = string.match |
| 34 |
local string_gsub = string.gsub |
| 35 |
local filesys = require "lfs" |
| 36 |
|
| 37 |
local function basename(path) |
| 38 |
local i = 0 |
| 39 |
while true do |
| 40 |
local j = string_find(path, "[\\/]", i + 1) |
| 41 |
if j == nil then |
| 42 |
return string_sub(path, i + 1) |
| 43 |
elseif j == #path then |
| 44 |
return string_sub(path, i + 1, -2) |
| 45 |
end |
| 46 |
i = j |
| 47 |
end |
| 48 |
end |
| 49 |
|
| 50 |
|
| 51 |
local function dirname(path) |
| 52 |
local i = 0 |
| 53 |
while true do |
| 54 |
local j = string_find(path, "[\\/]", i + 1) |
| 55 |
if j == nil then |
| 56 |
if i == 0 then |
| 57 |
|
| 58 |
return "." |
| 59 |
elseif i == 1 then |
| 60 |
|
| 61 |
return string_sub(path, 1, 1) |
| 62 |
else |
| 63 |
|
| 64 |
return string_sub(path, 1, i - 1) |
| 65 |
end |
| 66 |
end |
| 67 |
i = j |
| 68 |
end |
| 69 |
end |
| 70 |
|
| 71 |
|
| 72 |
local function parentdir(path) |
| 73 |
local i = 0 |
| 74 |
while true do |
| 75 |
local j = string_find(path, "[\\/]", i + 1) |
| 76 |
if j == nil then |
| 77 |
if i == 0 then |
| 78 |
|
| 79 |
return "." |
| 80 |
elseif i == 1 then |
| 81 |
|
| 82 |
return string_sub(path, 1, 1) |
| 83 |
else |
| 84 |
|
| 85 |
return string_sub(path, 1, i - 1) |
| 86 |
end |
| 87 |
elseif j == #path then |
| 88 |
|
| 89 |
return string_sub(path, 1, i - 1) |
| 90 |
end |
| 91 |
i = j |
| 92 |
end |
| 93 |
end |
| 94 |
|
| 95 |
|
| 96 |
local function trimext(path) |
| 97 |
return (string_gsub(path, "%.[^\\/%.]*$", "")) |
| 98 |
end |
| 99 |
|
| 100 |
|
| 101 |
local function ext(path) |
| 102 |
return string_match(path, "%.([^\\/%.]*)$") or "" |
| 103 |
end |
| 104 |
|
| 105 |
|
| 106 |
local function replaceext(path, newext) |
| 107 |
local newpath, n = string_gsub(path, "%.([^\\/%.]*)$", function() return "." .. newext end) |
| 108 |
if n == 0 then |
| 109 |
return newpath .. "." .. newext |
| 110 |
else |
| 111 |
return newpath |
| 112 |
end |
| 113 |
end |
| 114 |
|
| 115 |
|
| 116 |
local function joinpath2(x, y) |
| 117 |
local xd = x |
| 118 |
local last = string_sub(x, -1) |
| 119 |
if last ~= "/" and last ~= "\\" then |
| 120 |
xd = x .. "\\" |
| 121 |
end |
| 122 |
if y == "." then |
| 123 |
return xd |
| 124 |
elseif y == ".." then |
| 125 |
return dirname(x) |
| 126 |
else |
| 127 |
if string_match(y, "^%.[\\/]") then |
| 128 |
return xd .. string_sub(y, 3) |
| 129 |
else |
| 130 |
return xd .. y |
| 131 |
end |
| 132 |
end |
| 133 |
end |
| 134 |
|
| 135 |
local function joinpath(...) |
| 136 |
local n = select("#", ...) |
| 137 |
if n == 2 then |
| 138 |
return joinpath2(...) |
| 139 |
elseif n == 0 then |
| 140 |
return "." |
| 141 |
elseif n == 1 then |
| 142 |
return ... |
| 143 |
else |
| 144 |
return joinpath(joinpath2(...), select(3, ...)) |
| 145 |
end |
| 146 |
end |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
local function isabspath(path) |
| 151 |
local init = string_sub(path, 1, 1) |
| 152 |
return init == "\\" or init == "/" or string_match(path, "^%a:[/\\]") |
| 153 |
end |
| 154 |
|
| 155 |
local function abspath(path, cwd) |
| 156 |
if isabspath(path) then |
| 157 |
|
| 158 |
return path |
| 159 |
else |
| 160 |
|
| 161 |
cwd = cwd or filesys.currentdir() |
| 162 |
return joinpath2(cwd, path) |
| 163 |
end |
| 164 |
end |
| 165 |
|
| 166 |
return { |
| 167 |
basename = basename, |
| 168 |
dirname = dirname, |
| 169 |
parentdir = parentdir, |
| 170 |
trimext = trimext, |
| 171 |
ext = ext, |
| 172 |
replaceext = replaceext, |
| 173 |
join = joinpath, |
| 174 |
abspath = abspath, |
| 175 |
} |
| 176 |
end |
| 177 |
else |
| 178 |
package.preload["texrunner.pathutil"] = function(...) |
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
local assert = assert |
| 201 |
local select = select |
| 202 |
local string = string |
| 203 |
local string_find = string.find |
| 204 |
local string_sub = string.sub |
| 205 |
local string_match = string.match |
| 206 |
local string_gsub = string.gsub |
| 207 |
local filesys = require "lfs" |
| 208 |
|
| 209 |
local function basename(path) |
| 210 |
local i = 0 |
| 211 |
while true do |
| 212 |
local j = string_find(path, "/", i + 1, true) |
| 213 |
if j == nil then |
| 214 |
return string_sub(path, i + 1) |
| 215 |
elseif j == #path then |
| 216 |
return string_sub(path, i + 1, -2) |
| 217 |
end |
| 218 |
i = j |
| 219 |
end |
| 220 |
end |
| 221 |
|
| 222 |
|
| 223 |
local function dirname(path) |
| 224 |
local i = 0 |
| 225 |
while true do |
| 226 |
local j = string_find(path, "/", i + 1, true) |
| 227 |
if j == nil then |
| 228 |
if i == 0 then |
| 229 |
|
| 230 |
return "." |
| 231 |
elseif i == 1 then |
| 232 |
|
| 233 |
return "/" |
| 234 |
else |
| 235 |
|
| 236 |
return string_sub(path, 1, i - 1) |
| 237 |
end |
| 238 |
end |
| 239 |
i = j |
| 240 |
end |
| 241 |
end |
| 242 |
|
| 243 |
|
| 244 |
local function parentdir(path) |
| 245 |
local i = 0 |
| 246 |
while true do |
| 247 |
local j = string_find(path, "/", i + 1, true) |
| 248 |
if j == nil then |
| 249 |
if i == 0 then |
| 250 |
|
| 251 |
return "." |
| 252 |
elseif i == 1 then |
| 253 |
|
| 254 |
return "/" |
| 255 |
else |
| 256 |
|
| 257 |
return string_sub(path, 1, i - 1) |
| 258 |
end |
| 259 |
elseif j == #path then |
| 260 |
|
| 261 |
return string_sub(path, 1, i - 1) |
| 262 |
end |
| 263 |
i = j |
| 264 |
end |
| 265 |
end |
| 266 |
|
| 267 |
|
| 268 |
local function trimext(path) |
| 269 |
return (string_gsub(path, "%.[^/%.]*$", "")) |
| 270 |
end |
| 271 |
|
| 272 |
|
| 273 |
local function ext(path) |
| 274 |
return string_match(path, "%.([^/%.]*)$") or "" |
| 275 |
end |
| 276 |
|
| 277 |
|
| 278 |
local function replaceext(path, newext) |
| 279 |
local newpath, n = string_gsub(path, "%.([^/%.]*)$", function() return "." .. newext end) |
| 280 |
if n == 0 then |
| 281 |
return newpath .. "." .. newext |
| 282 |
else |
| 283 |
return newpath |
| 284 |
end |
| 285 |
end |
| 286 |
|
| 287 |
|
| 288 |
local function joinpath2(x, y) |
| 289 |
local xd = x |
| 290 |
if string_sub(x, -1) ~= "/" then |
| 291 |
xd = x .. "/" |
| 292 |
end |
| 293 |
if y == "." then |
| 294 |
return xd |
| 295 |
elseif y == ".." then |
| 296 |
return dirname(x) |
| 297 |
else |
| 298 |
if string_sub(y, 1, 2) == "./" then |
| 299 |
return xd .. string_sub(y, 3) |
| 300 |
else |
| 301 |
return xd .. y |
| 302 |
end |
| 303 |
end |
| 304 |
end |
| 305 |
|
| 306 |
local function joinpath(...) |
| 307 |
local n = select("#", ...) |
| 308 |
if n == 2 then |
| 309 |
return joinpath2(...) |
| 310 |
elseif n == 0 then |
| 311 |
return "." |
| 312 |
elseif n == 1 then |
| 313 |
return ... |
| 314 |
else |
| 315 |
return joinpath(joinpath2(...), select(3, ...)) |
| 316 |
end |
| 317 |
end |
| 318 |
|
| 319 |
|
| 320 |
local function abspath(path, cwd) |
| 321 |
if string_sub(path, 1, 1) == "/" then |
| 322 |
|
| 323 |
return path |
| 324 |
else |
| 325 |
cwd = cwd or filesys.currentdir() |
| 326 |
return joinpath2(cwd, path) |
| 327 |
end |
| 328 |
end |
| 329 |
|
| 330 |
|
| 331 |
return { |
| 332 |
basename = basename, |
| 333 |
dirname = dirname, |
| 334 |
parentdir = parentdir, |
| 335 |
trimext = trimext, |
| 336 |
ext = ext, |
| 337 |
replaceext = replaceext, |
| 338 |
join = joinpath, |
| 339 |
abspath = abspath, |
| 340 |
} |
| 341 |
end |
| 342 |
end |
| 343 |
if os.type == "windows" then |
| 344 |
package.preload["texrunner.shellutil"] = function(...) |
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
local string_gsub = string.gsub |
| 365 |
local os_execute = os.execute |
| 366 |
|
| 367 |
|
| 368 |
local function escape(s) |
| 369 |
return '"' .. string_gsub(string_gsub(s, '(\\*)"', '%1%1\\"'), '(\\+)$', '%1%1') .. '"' |
| 370 |
end |
| 371 |
|
| 372 |
|
| 373 |
local function has_command(name) |
| 374 |
local result = os_execute("where " .. escape(name) .. " > NUL 2>&1") |
| 375 |
|
| 376 |
return result == 0 or result == true |
| 377 |
end |
| 378 |
|
| 379 |
return { |
| 380 |
escape = escape, |
| 381 |
has_command = has_command, |
| 382 |
} |
| 383 |
end |
| 384 |
else |
| 385 |
package.preload["texrunner.shellutil"] = function(...) |
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
local assert = assert |
| 406 |
local string_match = string.match |
| 407 |
local table = table |
| 408 |
local table_insert = table.insert |
| 409 |
local table_concat = table.concat |
| 410 |
local os_execute = os.execute |
| 411 |
|
| 412 |
|
| 413 |
local function escape(s) |
| 414 |
local len = #s |
| 415 |
local result = {} |
| 416 |
local t,i = string_match(s, "^([^']*)()") |
| 417 |
assert(t) |
| 418 |
if t ~= "" then |
| 419 |
table_insert(result, "'") |
| 420 |
table_insert(result, t) |
| 421 |
table_insert(result, "'") |
| 422 |
end |
| 423 |
while i < len do |
| 424 |
t,i = string_match(s, "^('+)()", i) |
| 425 |
assert(t) |
| 426 |
table_insert(result, '"') |
| 427 |
table_insert(result, t) |
| 428 |
table_insert(result, '"') |
| 429 |
t,i = string_match(s, "^([^']*)()", i) |
| 430 |
assert(t) |
| 431 |
if t ~= "" then |
| 432 |
table_insert(result, "'") |
| 433 |
table_insert(result, t) |
| 434 |
table_insert(result, "'") |
| 435 |
end |
| 436 |
end |
| 437 |
return table_concat(result, "") |
| 438 |
end |
| 439 |
|
| 440 |
|
| 441 |
local function has_command(name) |
| 442 |
local result = os_execute("which " .. escape(name) .. " > /dev/null") |
| 443 |
|
| 444 |
return result == 0 or result == true |
| 445 |
end |
| 446 |
|
| 447 |
return { |
| 448 |
escape = escape, |
| 449 |
has_command = has_command, |
| 450 |
} |
| 451 |
end |
| 452 |
end |
| 453 |
package.preload["texrunner.fsutil"] = function(...) |
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
local assert = assert |
| 474 |
local os = os |
| 475 |
local os_execute = os.execute |
| 476 |
local os_remove = os.remove |
| 477 |
local filesys = require "lfs" |
| 478 |
local pathutil = require "texrunner.pathutil" |
| 479 |
local shellutil = require "texrunner.shellutil" |
| 480 |
local escape = shellutil.escape |
| 481 |
|
| 482 |
local copy_command |
| 483 |
if os.type == "windows" then |
| 484 |
function copy_command(from, to) |
| 485 |
|
| 486 |
return "copy " .. escape(from) .. " " .. escape(to) .. " > NUL" |
| 487 |
end |
| 488 |
else |
| 489 |
function copy_command(from, to) |
| 490 |
|
| 491 |
return "cp " .. escape(from) .. " " .. escape(to) |
| 492 |
end |
| 493 |
end |
| 494 |
|
| 495 |
local isfile = filesys.isfile or function(path) |
| 496 |
return filesys.attributes(path, "mode") == "file" |
| 497 |
end |
| 498 |
|
| 499 |
local isdir = filesys.isdir or function(path) |
| 500 |
return filesys.attributes(path, "mode") == "directory" |
| 501 |
end |
| 502 |
|
| 503 |
local function mkdir_rec(path) |
| 504 |
local succ, err = filesys.mkdir(path) |
| 505 |
if not succ then |
| 506 |
succ, err = mkdir_rec(pathutil.parentdir(path)) |
| 507 |
if succ then |
| 508 |
return filesys.mkdir(path) |
| 509 |
end |
| 510 |
end |
| 511 |
return succ, err |
| 512 |
end |
| 513 |
|
| 514 |
local function remove_rec(path) |
| 515 |
if isdir(path) then |
| 516 |
for file in filesys.dir(path) do |
| 517 |
if file ~= "." and file ~= ".." then |
| 518 |
local succ, err = remove_rec(pathutil.join(path, file)) |
| 519 |
if not succ then |
| 520 |
return succ, err |
| 521 |
end |
| 522 |
end |
| 523 |
end |
| 524 |
return filesys.rmdir(path) |
| 525 |
else |
| 526 |
return os_remove(path) |
| 527 |
end |
| 528 |
end |
| 529 |
|
| 530 |
return { |
| 531 |
copy_command = copy_command, |
| 532 |
isfile = isfile, |
| 533 |
isdir = isdir, |
| 534 |
mkdir_rec = mkdir_rec, |
| 535 |
remove_rec = remove_rec, |
| 536 |
} |
| 537 |
end |
| 538 |
package.preload["texrunner.luatexinit"] = function(...) |
| 539 |
local function create_initialization_script(filename, options) |
| 540 |
local initscript = assert(io.open(filename,"w")) |
| 541 |
if type(options.file_line_error) == "boolean" then |
| 542 |
initscript:write(string.format("texconfig.file_line_error = %s\n", options.file_line_error)) |
| 543 |
end |
| 544 |
if type(options.halt_on_error) == "boolean" then |
| 545 |
initscript:write(string.format("texconfig.halt_on_error = %s\n", options.halt_on_error)) |
| 546 |
end |
| 547 |
initscript:write([==[ |
| 548 |
local print = print |
| 549 |
local io_open = io.open |
| 550 |
local io_write = io.write |
| 551 |
local os_execute = os.execute |
| 552 |
local texio_write = texio.write |
| 553 |
local texio_write_nl = texio.write_nl |
| 554 |
]==]) |
| 555 |
|
| 556 |
|
| 557 |
initscript:write(string.format("local output_directory = %q\n", options.output_directory)) |
| 558 |
|
| 559 |
initscript:write(string.format("local jobname = %q\n", options.jobname)) |
| 560 |
initscript:write([==[ |
| 561 |
local luawritelog |
| 562 |
local function openluawritelog() |
| 563 |
if not luawritelog then |
| 564 |
luawritelog = assert(io_open(output_directory .. "/" .. jobname .. ".cluttex-fls", "w")) |
| 565 |
end |
| 566 |
return luawritelog |
| 567 |
end |
| 568 |
io.open = function(fname, mode) |
| 569 |
-- luatexja-ruby |
| 570 |
if mode == "w" and fname == jobname .. ".ltjruby" then |
| 571 |
fname = output_directory .. "/" .. fname |
| 572 |
end |
| 573 |
if type(mode) == "string" and string.find(mode, "w") ~= nil then |
| 574 |
-- write mode |
| 575 |
openluawritelog():write("OUTPUT " .. fname .. "\n") |
| 576 |
end |
| 577 |
return io_open(fname, mode) |
| 578 |
end |
| 579 |
os.execute = function(...) |
| 580 |
texio_write_nl("log", string.format("CLUTTEX_EXEC %s", ...), "") |
| 581 |
return os_execute(...) |
| 582 |
end |
| 583 |
]==]) |
| 584 |
|
| 585 |
|
| 586 |
initscript:write([==[ |
| 587 |
local function start_file_cb(category, filename) |
| 588 |
if category == 1 then -- a normal data file, like a TeX source |
| 589 |
texio_write_nl("log", "("..filename) |
| 590 |
elseif category == 2 then -- a font map coupling font names to resources |
| 591 |
texio_write("log", "{"..filename) |
| 592 |
elseif category == 3 then -- an image file (png, pdf, etc) |
| 593 |
texio_write("<"..filename) |
| 594 |
elseif category == 4 then -- an embedded font subset |
| 595 |
texio_write("<"..filename) |
| 596 |
elseif category == 5 then -- a fully embedded font |
| 597 |
texio_write("<<"..filename) |
| 598 |
else |
| 599 |
print("start_file: unknown category", category, filename) |
| 600 |
end |
| 601 |
end |
| 602 |
callback.register("start_file", start_file_cb) |
| 603 |
local function stop_file_cb(category) |
| 604 |
if category == 1 then |
| 605 |
texio_write("log", ")") |
| 606 |
elseif category == 2 then |
| 607 |
texio_write("log", "}") |
| 608 |
elseif category == 3 then |
| 609 |
texio_write(">") |
| 610 |
elseif category == 4 then |
| 611 |
texio_write(">") |
| 612 |
elseif category == 5 then |
| 613 |
texio_write(">>") |
| 614 |
else |
| 615 |
print("stop_file: unknown category", category) |
| 616 |
end |
| 617 |
end |
| 618 |
callback.register("stop_file", stop_file_cb) |
| 619 |
texio.write = function(...) |
| 620 |
if select("#",...) == 1 then |
| 621 |
-- Suppress luaotfload's message (See src/fontloader/runtime/fontload-reference.lua) |
| 622 |
local s = ... |
| 623 |
if string.match(s, "^%(using cache: ") |
| 624 |
or string.match(s, "^%(using write cache: ") |
| 625 |
or string.match(s, "^%(using read cache: ") |
| 626 |
or string.match(s, "^%(load luc: ") |
| 627 |
or string.match(s, "^%(load cache: ") then |
| 628 |
return texio_write("log", ...) |
| 629 |
end |
| 630 |
end |
| 631 |
return texio_write(...) |
| 632 |
end |
| 633 |
]==]) |
| 634 |
|
| 635 |
|
| 636 |
initscript:write([==[ |
| 637 |
if string.match(arg[0], "^%-%-lua=") then |
| 638 |
local minindex = 0 |
| 639 |
while arg[minindex - 1] ~= nil do |
| 640 |
minindex = minindex - 1 |
| 641 |
end |
| 642 |
local arg2 = {} |
| 643 |
for i = 0, #arg - minindex do |
| 644 |
arg2[i] = arg[i + minindex] |
| 645 |
end |
| 646 |
arg = arg2 |
| 647 |
end |
| 648 |
]==]) |
| 649 |
initscript:close() |
| 650 |
end |
| 651 |
|
| 652 |
return { |
| 653 |
create_initialization_script = create_initialization_script |
| 654 |
} |
| 655 |
end |
| 656 |
package.preload["texrunner.isatty"] = function(...) |
| 657 |
|
| 658 |
|
| 659 |
|
| 660 |
|
| 661 |
|
| 662 |
|
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
|
| 674 |
|
| 675 |
|
| 676 |
if os.type == "unix" then |
| 677 |
|
| 678 |
local succ, M = pcall(function() |
| 679 |
local ffi = require "ffi" |
| 680 |
assert(ffi.os ~= "" and ffi.arch ~= "", "ffi library is stub") |
| 681 |
ffi.cdef[[ |
| 682 |
int isatty(int fd); |
| 683 |
int fileno(void *stream); |
| 684 |
]] |
| 685 |
local isatty = assert(ffi.C.isatty, "isatty not found") |
| 686 |
local fileno = assert(ffi.C.fileno, "fileno not found") |
| 687 |
return { |
| 688 |
isatty = function(file) |
| 689 |
|
| 690 |
return isatty(fileno(file)) ~= 0 |
| 691 |
end |
| 692 |
} |
| 693 |
end) |
| 694 |
if succ then |
| 695 |
if CLUTTEX_VERBOSITY >= 3 then |
| 696 |
io.stderr:write("ClutTeX: isatty found via FFI (Unix)\n") |
| 697 |
end |
| 698 |
return M |
| 699 |
else |
| 700 |
if CLUTTEX_VERBOSITY >= 3 then |
| 701 |
io.stderr:write("ClutTeX: FFI (Unix) not found: ", M, "\n") |
| 702 |
end |
| 703 |
end |
| 704 |
|
| 705 |
|
| 706 |
local succ, M = pcall(function() |
| 707 |
local isatty = require "posix.unistd".isatty |
| 708 |
local fileno = require "posix.stdio".fileno |
| 709 |
return { |
| 710 |
isatty = function(file) |
| 711 |
return isatty(fileno(file)) == 1 |
| 712 |
end, |
| 713 |
} |
| 714 |
end) |
| 715 |
if succ then |
| 716 |
if CLUTTEX_VERBOSITY >= 3 then |
| 717 |
io.stderr:write("ClutTeX: isatty found via luaposix\n") |
| 718 |
end |
| 719 |
return M |
| 720 |
else |
| 721 |
if CLUTTEX_VERBOSITY >= 3 then |
| 722 |
io.stderr:write("ClutTeX: luaposix not found: ", M, "\n") |
| 723 |
end |
| 724 |
end |
| 725 |
|
| 726 |
|
| 727 |
return { |
| 728 |
isatty = function(file) |
| 729 |
local fd |
| 730 |
if file == io.stdin then |
| 731 |
fd = 0 |
| 732 |
elseif file == io.stdout then |
| 733 |
fd = 1 |
| 734 |
elseif file == io.stderr then |
| 735 |
fd = 2 |
| 736 |
else |
| 737 |
return false |
| 738 |
end |
| 739 |
local result = os.execute(string.format("test -t %d", fd)) |
| 740 |
return result == true or result == 0 |
| 741 |
end, |
| 742 |
} |
| 743 |
|
| 744 |
else |
| 745 |
|
| 746 |
local succ, M = pcall(function() |
| 747 |
local ffi = require "ffi" |
| 748 |
local bitlib = assert(bit32 or bit, "Neither bit32 (Lua 5.2) nor bit (LuaJIT) found") |
| 749 |
ffi.cdef[[ |
| 750 |
int _isatty(int fd); |
| 751 |
int _fileno(void *stream); |
| 752 |
void *_get_osfhandle(int fd); // should return intptr_t |
| 753 |
typedef int BOOL; |
| 754 |
typedef uint32_t DWORD; |
| 755 |
typedef int FILE_INFO_BY_HANDLE_CLASS; // ??? |
| 756 |
typedef struct _FILE_NAME_INFO { |
| 757 |
DWORD FileNameLength; |
| 758 |
uint16_t FileName[?]; |
| 759 |
} FILE_NAME_INFO; |
| 760 |
DWORD GetFileType(void *hFile); |
| 761 |
BOOL GetFileInformationByHandleEx(void *hFile, FILE_INFO_BY_HANDLE_CLASS fic, void *fileinfo, DWORD dwBufferSize); |
| 762 |
BOOL GetConsoleMode(void *hConsoleHandle, DWORD* lpMode); |
| 763 |
BOOL SetConsoleMode(void *hConsoleHandle, DWORD dwMode); |
| 764 |
DWORD GetLastError(); |
| 765 |
]] |
| 766 |
local isatty = assert(ffi.C._isatty, "_isatty not found") |
| 767 |
local fileno = assert(ffi.C._fileno, "_fileno not found") |
| 768 |
local get_osfhandle = assert(ffi.C._get_osfhandle, "_get_osfhandle not found") |
| 769 |
local GetFileType = assert(ffi.C.GetFileType, "GetFileType not found") |
| 770 |
local GetFileInformationByHandleEx = assert(ffi.C.GetFileInformationByHandleEx, "GetFileInformationByHandleEx not found") |
| 771 |
local GetConsoleMode = assert(ffi.C.GetConsoleMode, "GetConsoleMode not found") |
| 772 |
local SetConsoleMode = assert(ffi.C.SetConsoleMode, "SetConsoleMode not found") |
| 773 |
local GetLastError = assert(ffi.C.GetLastError, "GetLastError not found") |
| 774 |
local function wide_to_narrow(array, length) |
| 775 |
local t = {} |
| 776 |
for i = 0, length - 1 do |
| 777 |
table.insert(t, string.char(math.min(array[i], 0xff))) |
| 778 |
end |
| 779 |
return table.concat(t, "") |
| 780 |
end |
| 781 |
local function is_mintty(fd) |
| 782 |
local handle = get_osfhandle(fd) |
| 783 |
local filetype = GetFileType(handle) |
| 784 |
if filetype ~= 0x0003 then |
| 785 |
|
| 786 |
if CLUTTEX_VERBOSITY >= 4 then |
| 787 |
io.stderr:write("ClutTeX: is_mintty: not a pipe\n") |
| 788 |
end |
| 789 |
return false |
| 790 |
end |
| 791 |
local nameinfo = ffi.new("FILE_NAME_INFO", 32768) |
| 792 |
local FileNameInfo = 2 |
| 793 |
if GetFileInformationByHandleEx(handle, FileNameInfo, nameinfo, ffi.sizeof("FILE_NAME_INFO", 32768)) ~= 0 then |
| 794 |
local filename = wide_to_narrow(nameinfo.FileName, math.floor(nameinfo.FileNameLength / 2)) |
| 795 |
|
| 796 |
if CLUTTEX_VERBOSITY >= 4 then |
| 797 |
io.stderr:write("ClutTeX: is_mintty: GetFileInformationByHandleEx returned ", filename, "\n") |
| 798 |
end |
| 799 |
local a, b = string.match(filename, "^\\(%w+)%-%x+%-pty%d+%-(%w+)%-master$") |
| 800 |
return (a == "cygwin" or a == "msys") and (b == "from" or b == "to") |
| 801 |
else |
| 802 |
if CLUTTEX_VERBOSITY >= 4 then |
| 803 |
io.stderr:write("ClutTeX: is_mintty: GetFileInformationByHandleEx failed\n") |
| 804 |
end |
| 805 |
return false |
| 806 |
end |
| 807 |
end |
| 808 |
return { |
| 809 |
isatty = function(file) |
| 810 |
|
| 811 |
local fd = fileno(file) |
| 812 |
return isatty(fd) ~= 0 or is_mintty(fd) |
| 813 |
end, |
| 814 |
enable_virtual_terminal = function(file) |
| 815 |
local fd = fileno(file) |
| 816 |
if is_mintty(fd) then |
| 817 |
|
| 818 |
if CLUTTEX_VERBOSITY >= 4 then |
| 819 |
io.stderr:write("ClutTeX: Detected MinTTY\n") |
| 820 |
end |
| 821 |
return true |
| 822 |
elseif isatty(fd) ~= 0 then |
| 823 |
|
| 824 |
if os.getenv("ConEmuANSI") == "ON" or os.getenv("ANSICON") then |
| 825 |
if CLUTTEX_VERBOSITY >= 4 then |
| 826 |
io.stderr:write("ClutTeX: Detected ConEmu or ansicon\n") |
| 827 |
end |
| 828 |
return true |
| 829 |
else |
| 830 |
|
| 831 |
local handle = get_osfhandle(fd) |
| 832 |
local modePtr = ffi.new("DWORD[1]") |
| 833 |
local result = GetConsoleMode(handle, modePtr) |
| 834 |
if result == 0 then |
| 835 |
if CLUTTEX_VERBOSITY >= 3 then |
| 836 |
local err = GetLastError() |
| 837 |
io.stderr:write(string.format("ClutTeX: GetConsoleMode failed (0x%08X)\n", err)) |
| 838 |
end |
| 839 |
return false |
| 840 |
end |
| 841 |
local ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004 |
| 842 |
result = SetConsoleMode(handle, bitlib.bor(modePtr[0], ENABLE_VIRTUAL_TERMINAL_PROCESSING)) |
| 843 |
if result == 0 then |
| 844 |
|
| 845 |
if CLUTTEX_VERBOSITY >= 3 then |
| 846 |
local err = GetLastError() |
| 847 |
|
| 848 |
io.stderr:write(string.format("ClutTeX: SetConsoleMode failed (0x%08X)\n", err)) |
| 849 |
end |
| 850 |
return false |
| 851 |
end |
| 852 |
if CLUTTEX_VERBOSITY >= 4 then |
| 853 |
io.stderr:write("ClutTeX: Detected recent Command Prompt\n") |
| 854 |
end |
| 855 |
return true |
| 856 |
end |
| 857 |
else |
| 858 |
|
| 859 |
return false |
| 860 |
end |
| 861 |
end, |
| 862 |
} |
| 863 |
end) |
| 864 |
if succ then |
| 865 |
if CLUTTEX_VERBOSITY >= 3 then |
| 866 |
io.stderr:write("ClutTeX: isatty found via FFI (Windows)\n") |
| 867 |
end |
| 868 |
return M |
| 869 |
else |
| 870 |
if CLUTTEX_VERBOSITY >= 3 then |
| 871 |
io.stderr:write("ClutTeX: FFI (Windows) not found: ", M, "\n") |
| 872 |
end |
| 873 |
end |
| 874 |
end |
| 875 |
|
| 876 |
return { |
| 877 |
isatty = function(file) |
| 878 |
return false |
| 879 |
end, |
| 880 |
} |
| 881 |
end |
| 882 |
package.preload["texrunner.fswatcher_windows"] = function(...) |
| 883 |
|
| 884 |
|
| 885 |
|
| 886 |
|
| 887 |
|
| 888 |
|
| 889 |
|
| 890 |
|
| 891 |
|
| 892 |
|
| 893 |
|
| 894 |
|
| 895 |
|
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
|
| 900 |
|
| 901 |
|
| 902 |
local ffi = require "ffi" |
| 903 |
local bitlib = assert(bit32 or bit, "Neither bit32 (Lua 5.2) nor bit (LuaJIT) found") |
| 904 |
|
| 905 |
ffi.cdef[[ |
| 906 |
typedef int BOOL; |
| 907 |
typedef unsigned int UINT; |
| 908 |
typedef uint32_t DWORD; |
| 909 |
typedef void *HANDLE; |
| 910 |
typedef uintptr_t ULONG_PTR; |
| 911 |
typedef uint16_t WCHAR; |
| 912 |
typedef struct _OVERLAPPED { |
| 913 |
ULONG_PTR Internal; |
| 914 |
ULONG_PTR InternalHigh; |
| 915 |
union { |
| 916 |
struct { |
| 917 |
DWORD Offset; |
| 918 |
DWORD OffsetHigh; |
| 919 |
}; |
| 920 |
void *Pointer; |
| 921 |
}; |
| 922 |
HANDLE hEvent; |
| 923 |
} OVERLAPPED; |
| 924 |
typedef struct _FILE_NOTIFY_INFORMATION { |
| 925 |
DWORD NextEntryOffset; |
| 926 |
DWORD Action; |
| 927 |
DWORD FileNameLength; |
| 928 |
WCHAR FileName[?]; |
| 929 |
} FILE_NOTIFY_INFORMATION; |
| 930 |
typedef void (__stdcall *LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, OVERLAPPED *lpOverlapped); |
| 931 |
DWORD GetLastError(); |
| 932 |
BOOL CloseHandle(HANDLE hObject); |
| 933 |
HANDLE CreateFileA(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, void *lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); |
| 934 |
HANDLE CreateIoCompletionPort(HANDLE fileHandle, HANDLE existingCompletionPort, ULONG_PTR completionKey, DWORD numberOfConcurrentThreads); |
| 935 |
BOOL ReadDirectoryChangesW(HANDLE hDirectory, void *lpBuffer, DWORD nBufferLength, BOOL bWatchSubtree, DWORD dwNotifyFilter, DWORD *lpBytesReturned, OVERLAPPED *lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpOverlappedCompletionRoutine); |
| 936 |
BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, DWORD *lpNumberOfBytes, ULONG_PTR *lpCompletionKey, OVERLAPPED **lpOverlapped, DWORD dwMilliseconds); |
| 937 |
int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, const char *lpMultiByteStr, int cbMultiByte, WCHAR *lpWideCharStr, int cchWideChar); |
| 938 |
int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, const WCHAR *lpWideCharStr, int cchWideChar, char *lpMultiByteStr, int cbMultiByte, const char *lpDefaultChar, BOOL *lpUsedDefaultChar); |
| 939 |
DWORD GetFullPathNameA(const char *lpFileName, DWORD nBufferLength, char *lpBuffer, char **lpFilePart); |
| 940 |
uint64_t GetTickCount64(); |
| 941 |
]] |
| 942 |
|
| 943 |
|
| 944 |
|
| 945 |
local NULL = ffi.NULL |
| 946 |
|
| 947 |
|
| 948 |
local ERROR_FILE_NOT_FOUND = 0x0002 |
| 949 |
local ERROR_PATH_NOT_FOUND = 0x0003 |
| 950 |
local ERROR_ACCESS_DENIED = 0x0005 |
| 951 |
local ERROR_INVALID_PARAMETER = 0x0057 |
| 952 |
local ERROR_INSUFFICIENT_BUFFER = 0x007A |
| 953 |
local WAIT_TIMEOUT = 0x0102 |
| 954 |
local ERROR_ABANDONED_WAIT_0 = 0x02DF |
| 955 |
local ERROR_NOACCESS = 0x03E6 |
| 956 |
local ERROR_INVALID_FLAGS = 0x03EC |
| 957 |
local ERROR_NOTIFY_ENUM_DIR = 0x03FE |
| 958 |
local ERROR_NO_UNICODE_TRANSLATION = 0x0459 |
| 959 |
local KnownErrors = { |
| 960 |
[ERROR_FILE_NOT_FOUND] = "ERROR_FILE_NOT_FOUND", |
| 961 |
[ERROR_PATH_NOT_FOUND] = "ERROR_PATH_NOT_FOUND", |
| 962 |
[ERROR_ACCESS_DENIED] = "ERROR_ACCESS_DENIED", |
| 963 |
[ERROR_INVALID_PARAMETER] = "ERROR_INVALID_PARAMETER", |
| 964 |
[ERROR_INSUFFICIENT_BUFFER] = "ERROR_INSUFFICIENT_BUFFER", |
| 965 |
[ERROR_ABANDONED_WAIT_0] = "ERROR_ABANDONED_WAIT_0", |
| 966 |
[ERROR_NOACCESS] = "ERROR_NOACCESS", |
| 967 |
[ERROR_INVALID_FLAGS] = "ERROR_INVALID_FLAGS", |
| 968 |
[ERROR_NOTIFY_ENUM_DIR] = "ERROR_NOTIFY_ENUM_DIR", |
| 969 |
[ERROR_NO_UNICODE_TRANSLATION] = "ERROR_NO_UNICODE_TRANSLATION", |
| 970 |
} |
| 971 |
|
| 972 |
|
| 973 |
local FILE_FLAG_BACKUP_SEMANTICS = 0x02000000 |
| 974 |
local FILE_FLAG_OVERLAPPED = 0x40000000 |
| 975 |
local OPEN_EXISTING = 3 |
| 976 |
local FILE_SHARE_READ = 0x00000001 |
| 977 |
local FILE_SHARE_WRITE = 0x00000002 |
| 978 |
local FILE_SHARE_DELETE = 0x00000004 |
| 979 |
local FILE_LIST_DIRECTORY = 0x1 |
| 980 |
local INVALID_HANDLE_VALUE = ffi.cast("void *", -1) |
| 981 |
|
| 982 |
|
| 983 |
local FILE_NOTIFY_CHANGE_FILE_NAME = 0x00000001 |
| 984 |
local FILE_NOTIFY_CHANGE_DIR_NAME = 0x00000002 |
| 985 |
local FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x00000004 |
| 986 |
local FILE_NOTIFY_CHANGE_SIZE = 0x00000008 |
| 987 |
local FILE_NOTIFY_CHANGE_LAST_WRITE = 0x00000010 |
| 988 |
local FILE_NOTIFY_CHANGE_LAST_ACCESS = 0x00000020 |
| 989 |
local FILE_NOTIFY_CHANGE_CREATION = 0x00000040 |
| 990 |
local FILE_NOTIFY_CHANGE_SECURITY = 0x00000100 |
| 991 |
local FILE_ACTION_ADDED = 0x00000001 |
| 992 |
local FILE_ACTION_REMOVED = 0x00000002 |
| 993 |
local FILE_ACTION_MODIFIED = 0x00000003 |
| 994 |
local FILE_ACTION_RENAMED_OLD_NAME = 0x00000004 |
| 995 |
local FILE_ACTION_RENAMED_NEW_NAME = 0x00000005 |
| 996 |
|
| 997 |
|
| 998 |
local CP_ACP = 0 |
| 999 |
local CP_UTF8 = 65001 |
| 1000 |
|
| 1001 |
local C = ffi.C |
| 1002 |
|
| 1003 |
local function format_error(name, lasterror, extra) |
| 1004 |
local errorname = KnownErrors[lasterror] or string.format("error code %d", lasterror) |
| 1005 |
if extra then |
| 1006 |
return string.format("%s failed with %s (0x%04x) [%s]", name, errorname, lasterror, extra) |
| 1007 |
else |
| 1008 |
return string.format("%s failed with %s (0x%04x)", name, errorname, lasterror) |
| 1009 |
end |
| 1010 |
end |
| 1011 |
local function wcs_to_mbs(wstr, wstrlen, codepage) |
| 1012 |
|
| 1013 |
|
| 1014 |
if wstrlen == 0 then |
| 1015 |
return "" |
| 1016 |
end |
| 1017 |
codepage = codepage or CP_ACP |
| 1018 |
local dwFlags = 0 |
| 1019 |
local result = C.WideCharToMultiByte(codepage, dwFlags, wstr, wstrlen, nil, 0, nil, nil) |
| 1020 |
if result <= 0 then |
| 1021 |
|
| 1022 |
local lasterror = C.GetLastError() |
| 1023 |
|
| 1024 |
return nil, format_error("WideCharToMultiByte", lasterror) |
| 1025 |
end |
| 1026 |
local mbsbuf = ffi.new("char[?]", result) |
| 1027 |
result = C.WideCharToMultiByte(codepage, dwFlags, wstr, wstrlen, mbsbuf, result, nil, nil) |
| 1028 |
if result <= 0 then |
| 1029 |
|
| 1030 |
local lasterror = C.GetLastError() |
| 1031 |
|
| 1032 |
return nil, format_error("WideCharToMultiByte", lasterror) |
| 1033 |
end |
| 1034 |
return ffi.string(mbsbuf, result) |
| 1035 |
end |
| 1036 |
local function mbs_to_wcs(str, codepage) |
| 1037 |
|
| 1038 |
if str == "" then |
| 1039 |
return ffi.new("WCHAR[0]") |
| 1040 |
end |
| 1041 |
codepage = codepage or CP_ACP |
| 1042 |
local dwFlags = 0 |
| 1043 |
local result = C.MultiByteToWideChar(codepage, dwFlags, str, #str, nil, 0) |
| 1044 |
if result <= 0 then |
| 1045 |
local lasterror = C.GetLastError() |
| 1046 |
|
| 1047 |
return nil, format_error("MultiByteToWideChar", lasterror) |
| 1048 |
end |
| 1049 |
local wcsbuf = ffi.new("WCHAR[?]", result) |
| 1050 |
result = C.MultiByteToWideChar(codepage, dwFlags, str, #str, wcsbuf, result) |
| 1051 |
if result <= 0 then |
| 1052 |
local lasterror = C.GetLastError() |
| 1053 |
return nil, format_error("MultiByteToWideChar", lasterror) |
| 1054 |
end |
| 1055 |
return wcsbuf, result |
| 1056 |
end |
| 1057 |
|
| 1058 |
|
| 1059 |
local function get_full_path_name(filename) |
| 1060 |
local bufsize = 1024 |
| 1061 |
local buffer |
| 1062 |
local filePartPtr = ffi.new("char*[1]") |
| 1063 |
local result |
| 1064 |
repeat |
| 1065 |
buffer = ffi.new("char[?]", bufsize) |
| 1066 |
result = C.GetFullPathNameA(filename, bufsize, buffer, filePartPtr) |
| 1067 |
if result == 0 then |
| 1068 |
local lasterror = C.GetLastError() |
| 1069 |
return nil, format_error("GetFullPathNameA", lasterror, filename) |
| 1070 |
elseif bufsize < result then |
| 1071 |
|
| 1072 |
bufsize = result |
| 1073 |
end |
| 1074 |
until result < bufsize |
| 1075 |
local fullpath = ffi.string(buffer, result) |
| 1076 |
local filePart = ffi.string(filePartPtr[0]) |
| 1077 |
local dirPart = ffi.string(buffer, ffi.cast("intptr_t", filePartPtr[0]) - ffi.cast("intptr_t", buffer)) |
| 1078 |
return fullpath, filePart, dirPart |
| 1079 |
end |
| 1080 |
|
| 1081 |
|
| 1082 |
|
| 1083 |
|
| 1084 |
|
| 1085 |
|
| 1086 |
|
| 1087 |
local dirwatcher_meta = {} |
| 1088 |
dirwatcher_meta.__index = dirwatcher_meta |
| 1089 |
function dirwatcher_meta:close() |
| 1090 |
if self._rawhandle ~= nil then |
| 1091 |
C.CloseHandle(ffi.gc(self._rawhandle, nil)) |
| 1092 |
self._rawhandle = nil |
| 1093 |
end |
| 1094 |
end |
| 1095 |
local function open_directory(dirname) |
| 1096 |
local dwShareMode = bitlib.bor(FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE) |
| 1097 |
local dwFlagsAndAttributes = bitlib.bor(FILE_FLAG_BACKUP_SEMANTICS, FILE_FLAG_OVERLAPPED) |
| 1098 |
local handle = C.CreateFileA(dirname, FILE_LIST_DIRECTORY, dwShareMode, nil, OPEN_EXISTING, dwFlagsAndAttributes, nil) |
| 1099 |
if handle == INVALID_HANDLE_VALUE then |
| 1100 |
local lasterror = C.GetLastError() |
| 1101 |
print("Failed to open "..dirname) |
| 1102 |
return nil, format_error("CreateFileA", lasterror, dirname) |
| 1103 |
end |
| 1104 |
return setmetatable({ |
| 1105 |
dirname = dirname, |
| 1106 |
_rawhandle = ffi.gc(handle, C.CloseHandle), |
| 1107 |
_overlapped = ffi.new("OVERLAPPED"), |
| 1108 |
_buffer = ffi.new("char[?]", 1024), |
| 1109 |
}, dirwatcher_meta) |
| 1110 |
end |
| 1111 |
function dirwatcher_meta:start_watch(watchSubtree) |
| 1112 |
local dwNotifyFilter = bitlib.bor(FILE_NOTIFY_CHANGE_FILE_NAME, FILE_NOTIFY_CHANGE_DIR_NAME, FILE_NOTIFY_CHANGE_ATTRIBUTES, FILE_NOTIFY_CHANGE_SIZE, FILE_NOTIFY_CHANGE_LAST_WRITE, FILE_NOTIFY_CHANGE_LAST_ACCESS, FILE_NOTIFY_CHANGE_CREATION, FILE_NOTIFY_CHANGE_SECURITY) |
| 1113 |
local buffer = self._buffer |
| 1114 |
local bufferSize = ffi.sizeof(buffer) |
| 1115 |
local result = C.ReadDirectoryChangesW(self._rawhandle, buffer, bufferSize, watchSubtree, dwNotifyFilter, nil, self._overlapped, nil) |
| 1116 |
if result == 0 then |
| 1117 |
local lasterror = C.GetLastError() |
| 1118 |
return nil, format_error("ReadDirectoryChangesW", lasterror, self.dirname) |
| 1119 |
end |
| 1120 |
return true |
| 1121 |
end |
| 1122 |
local ActionTable = { |
| 1123 |
[FILE_ACTION_ADDED] = "added", |
| 1124 |
[FILE_ACTION_REMOVED] = "removed", |
| 1125 |
[FILE_ACTION_MODIFIED] = "modified", |
| 1126 |
[FILE_ACTION_RENAMED_OLD_NAME] = "rename_from", |
| 1127 |
[FILE_ACTION_RENAMED_NEW_NAME] = "rename_to", |
| 1128 |
} |
| 1129 |
function dirwatcher_meta:process(numberOfBytes) |
| 1130 |
|
| 1131 |
local buffer = self._buffer |
| 1132 |
numberOfBytes = math.min(numberOfBytes, ffi.sizeof(buffer)) |
| 1133 |
local ptr = ffi.cast("char *", buffer) |
| 1134 |
local structSize = ffi.sizeof("FILE_NOTIFY_INFORMATION", 1) |
| 1135 |
local t = {} |
| 1136 |
while numberOfBytes >= structSize do |
| 1137 |
local notifyInfo = ffi.cast("FILE_NOTIFY_INFORMATION*", ptr) |
| 1138 |
local nextEntryOffset = notifyInfo.NextEntryOffset |
| 1139 |
local action = notifyInfo.Action |
| 1140 |
local fileNameLength = notifyInfo.FileNameLength |
| 1141 |
local fileName = notifyInfo.FileName |
| 1142 |
local u = { action = ActionTable[action], filename = wcs_to_mbs(fileName, fileNameLength / 2) } |
| 1143 |
table.insert(t, u) |
| 1144 |
if nextEntryOffset == 0 or numberOfBytes <= nextEntryOffset then |
| 1145 |
break |
| 1146 |
end |
| 1147 |
numberOfBytes = numberOfBytes - nextEntryOffset |
| 1148 |
ptr = ptr + nextEntryOffset |
| 1149 |
end |
| 1150 |
return t |
| 1151 |
end |
| 1152 |
|
| 1153 |
|
| 1154 |
|
| 1155 |
|
| 1156 |
|
| 1157 |
|
| 1158 |
|
| 1159 |
|
| 1160 |
|
| 1161 |
|
| 1162 |
|
| 1163 |
|
| 1164 |
|
| 1165 |
|
| 1166 |
local fswatcher_meta = {} |
| 1167 |
fswatcher_meta.__index = fswatcher_meta |
| 1168 |
local function new_watcher() |
| 1169 |
local port = C.CreateIoCompletionPort(INVALID_HANDLE_VALUE, nil, 0, 0) |
| 1170 |
if port == NULL then |
| 1171 |
local lasterror = C.GetLastError() |
| 1172 |
return nil, format_error("CreateIoCompletionPort", lasterror) |
| 1173 |
end |
| 1174 |
return setmetatable({ |
| 1175 |
_rawport = ffi.gc(port, C.CloseHandle), |
| 1176 |
_pending = {}, |
| 1177 |
_directories = {}, |
| 1178 |
}, fswatcher_meta) |
| 1179 |
end |
| 1180 |
local function add_directory(self, dirname) |
| 1181 |
local t = self._directories[dirname] |
| 1182 |
if not t then |
| 1183 |
local dirwatcher, err = open_directory(dirname) |
| 1184 |
if not dirwatcher then |
| 1185 |
return dirwatcher, err |
| 1186 |
end |
| 1187 |
t = { dirwatcher = dirwatcher, dirname = dirname, files = {} } |
| 1188 |
table.insert(self, t) |
| 1189 |
local i = #self |
| 1190 |
local result = C.CreateIoCompletionPort(dirwatcher._rawhandle, self._rawport, i, 0) |
| 1191 |
if result == NULL then |
| 1192 |
local lasterror = C.GetLastError() |
| 1193 |
return nil, format_error("CreateIoCompletionPort", lasterror, dirname) |
| 1194 |
end |
| 1195 |
self._directories[dirname] = t |
| 1196 |
local result, err = dirwatcher:start_watch(false) |
| 1197 |
if not result then |
| 1198 |
return result, err |
| 1199 |
end |
| 1200 |
end |
| 1201 |
return t |
| 1202 |
end |
| 1203 |
function fswatcher_meta:add_file(path, ...) |
| 1204 |
local fullpath, filename, dirname = get_full_path_name(path) |
| 1205 |
local t, err = add_directory(self, dirname) |
| 1206 |
if not t then |
| 1207 |
return t, err |
| 1208 |
end |
| 1209 |
t.files[filename] = path |
| 1210 |
return true |
| 1211 |
end |
| 1212 |
local INFINITE = 0xFFFFFFFF |
| 1213 |
local function get_queued(self, timeout) |
| 1214 |
local startTime = C.GetTickCount64() |
| 1215 |
local timeout_ms |
| 1216 |
if timeout == nil then |
| 1217 |
timeout_ms = INFINITE |
| 1218 |
else |
| 1219 |
timeout_ms = timeout * 1000 |
| 1220 |
end |
| 1221 |
local numberOfBytesPtr = ffi.new("DWORD[1]") |
| 1222 |
local completionKeyPtr = ffi.new("ULONG_PTR[1]") |
| 1223 |
local lpOverlapped = ffi.new("OVERLAPPED*[1]") |
| 1224 |
repeat |
| 1225 |
local result = C.GetQueuedCompletionStatus(self._rawport, numberOfBytesPtr, completionKeyPtr, lpOverlapped, timeout_ms) |
| 1226 |
if result == 0 then |
| 1227 |
local lasterror = C.GetLastError() |
| 1228 |
if lasterror == WAIT_TIMEOUT then |
| 1229 |
return nil, "timeout" |
| 1230 |
else |
| 1231 |
return nil, format_error("GetQueuedCompletionStatus", lasterror) |
| 1232 |
end |
| 1233 |
end |
| 1234 |
local numberOfBytes = numberOfBytesPtr[0] |
| 1235 |
local completionKey = tonumber(completionKeyPtr[0]) |
| 1236 |
local dir_t = assert(self[completionKey], "invalid completion key: " .. tostring(completionKey)) |
| 1237 |
local t = dir_t.dirwatcher:process(numberOfBytes) |
| 1238 |
dir_t.dirwatcher:start_watch(false) |
| 1239 |
local found = false |
| 1240 |
for i,v in ipairs(t) do |
| 1241 |
local path = dir_t.files[v.filename] |
| 1242 |
if path then |
| 1243 |
found = true |
| 1244 |
table.insert(self._pending, {path = path, action = v.action}) |
| 1245 |
end |
| 1246 |
end |
| 1247 |
if found then |
| 1248 |
return true |
| 1249 |
end |
| 1250 |
if timeout_ms ~= INFINITE then |
| 1251 |
local tt = C.GetTickCount64() |
| 1252 |
timeout_ms = timeout_ms - (tt - startTime) |
| 1253 |
startTime = tt |
| 1254 |
end |
| 1255 |
until timeout_ms < 0 |
| 1256 |
return nil, "timeout" |
| 1257 |
end |
| 1258 |
function fswatcher_meta:next(timeout) |
| 1259 |
if #self._pending > 0 then |
| 1260 |
local result = table.remove(self._pending, 1) |
| 1261 |
get_queued(self, 0) |
| 1262 |
return result |
| 1263 |
else |
| 1264 |
local result, err = get_queued(self, timeout) |
| 1265 |
if result == nil then |
| 1266 |
return nil, err |
| 1267 |
end |
| 1268 |
return table.remove(self._pending, 1) |
| 1269 |
end |
| 1270 |
end |
| 1271 |
function fswatcher_meta:close() |
| 1272 |
if self._rawport ~= nil then |
| 1273 |
for i,v in ipairs(self) do |
| 1274 |
v.dirwatcher:close() |
| 1275 |
end |
| 1276 |
C.CloseHandle(ffi.gc(self._rawport, nil)) |
| 1277 |
self._rawport = nil |
| 1278 |
end |
| 1279 |
end |
| 1280 |
|
| 1281 |
|
| 1282 |
|
| 1283 |
|
| 1284 |
|
| 1285 |
|
| 1286 |
|
| 1287 |
|
| 1288 |
|
| 1289 |
|
| 1290 |
|
| 1291 |
|
| 1292 |
|
| 1293 |
|
| 1294 |
|
| 1295 |
return { |
| 1296 |
new = new_watcher, |
| 1297 |
} |
| 1298 |
end |
| 1299 |
local getmetatable = getmetatable |
| 1300 |
local pcall = pcall |
| 1301 |
local setmetatable = setmetatable |
| 1302 |
local math = math |
| 1303 |
local math_type = math.type |
| 1304 |
local math_maxinteger = math.maxinteger |
| 1305 |
local math_mininteger = math.mininteger |
| 1306 |
local math_ult = math.ult |
| 1307 |
local string_char = string.char |
| 1308 |
local string_format = string.format |
| 1309 |
local table_concat = table.concat |
| 1310 |
local function _id(x) |
| 1311 |
return x |
| 1312 |
end |
| 1313 |
local _exn_meta = {} |
| 1314 |
function _exn_meta:__tostring() |
| 1315 |
local traceback = self.traceback |
| 1316 |
if traceback then |
| 1317 |
traceback = "\n" .. traceback |
| 1318 |
else |
| 1319 |
traceback = "" |
| 1320 |
end |
| 1321 |
return string_format("%s: %s%s", self.location or "<no location info>", self.tag[1], traceback) |
| 1322 |
end |
| 1323 |
local _Match_tag = { "Match" } |
| 1324 |
local _Match = setmetatable({ tag = _Match_tag }, _exn_meta) |
| 1325 |
local _Bind_tag = { "Bind" } |
| 1326 |
local _Bind = setmetatable({ tag = _Bind_tag }, _exn_meta) |
| 1327 |
local _Overflow_tag = { "Overflow" } |
| 1328 |
local _Overflow = setmetatable({ tag = _Overflow_tag }, _exn_meta) |
| 1329 |
local _Div_tag = { "Div" } |
| 1330 |
local _Div = setmetatable({ tag = _Div_tag }, _exn_meta) |
| 1331 |
local _Size_tag = { "Size" } |
| 1332 |
local _Size = setmetatable({ tag = _Size_tag }, _exn_meta) |
| 1333 |
local _Subscript_tag = { "Subscript" } |
| 1334 |
local _Subscript = setmetatable({ tag = _Subscript_tag }, _exn_meta) |
| 1335 |
local _Fail_tag = { "Fail" } |
| 1336 |
local function _Fail(message) |
| 1337 |
return setmetatable({ tag = _Fail_tag, payload = message }, _exn_meta) |
| 1338 |
end |
| 1339 |
local _Error_tag = { "Error" } |
| 1340 |
local function _Error(x) |
| 1341 |
return setmetatable({ tag = _Error_tag, payload = x }, _exn_meta) |
| 1342 |
end |
| 1343 |
local function _handle(f) |
| 1344 |
local success, result = pcall(f) |
| 1345 |
if not success and getmetatable(result) ~= _exn_meta then |
| 1346 |
result = _Error(result) |
| 1347 |
end |
| 1348 |
return success, result |
| 1349 |
end |
| 1350 |
local function __exn_instanceof(e, tag) |
| 1351 |
return e.tag == tag |
| 1352 |
end |
| 1353 |
local function _raise(x, location) |
| 1354 |
local e |
| 1355 |
if x.tag == _Error_tag then |
| 1356 |
e = x.payload |
| 1357 |
elseif location ~= nil then |
| 1358 |
local traceback = debug.traceback(nil, 2) |
| 1359 |
e = setmetatable({ tag = x.tag, payload = x.payload, location = location, traceback = traceback }, _exn_meta) |
| 1360 |
else |
| 1361 |
e = x |
| 1362 |
end |
| 1363 |
error(e, 1) |
| 1364 |
end |
| 1365 |
local function _Int_add(x, y) |
| 1366 |
|
| 1367 |
|
| 1368 |
local z = x + y |
| 1369 |
if y > 0 and z < x then |
| 1370 |
_raise(_Overflow, "Int.+") |
| 1371 |
elseif y < 0 and z > x then |
| 1372 |
_raise(_Overflow, "Int.+") |
| 1373 |
else |
| 1374 |
return z |
| 1375 |
end |
| 1376 |
end |
| 1377 |
local function _Int_sub(x, y) |
| 1378 |
|
| 1379 |
|
| 1380 |
local z = x - y |
| 1381 |
if y < 0 and z < x then |
| 1382 |
_raise(_Overflow, "Int.-") |
| 1383 |
elseif y > 0 and x < z then |
| 1384 |
_raise(_Overflow, "Int.-") |
| 1385 |
else |
| 1386 |
return z |
| 1387 |
end |
| 1388 |
end |
| 1389 |
local function _Int_mul(x, y) |
| 1390 |
|
| 1391 |
|
| 1392 |
local z = x * y |
| 1393 |
if (x ~= 0 and z // x ~= y) or (y ~= 0 and z // y ~= x) then |
| 1394 |
_raise(_Overflow, "Int.*") |
| 1395 |
else |
| 1396 |
return z |
| 1397 |
end |
| 1398 |
end |
| 1399 |
local function _Int_div(x, y) |
| 1400 |
|
| 1401 |
|
| 1402 |
if y == 0 then |
| 1403 |
_raise(_Div, "Int.div") |
| 1404 |
elseif x == math_mininteger and y == -1 then |
| 1405 |
_raise(_Overflow, "Int.div") |
| 1406 |
end |
| 1407 |
return x // y |
| 1408 |
end |
| 1409 |
local function _Int_mod(x, y) |
| 1410 |
|
| 1411 |
|
| 1412 |
if y == 0 then |
| 1413 |
_raise(_Div, "Int.mod") |
| 1414 |
end |
| 1415 |
return x % y |
| 1416 |
end |
| 1417 |
local function _Int_negate(x) |
| 1418 |
|
| 1419 |
if x == math_mininteger then |
| 1420 |
_raise(_Overflow, "Int.~") |
| 1421 |
end |
| 1422 |
return - x |
| 1423 |
end |
| 1424 |
local function _Word_div(x, y) |
| 1425 |
|
| 1426 |
|
| 1427 |
if y == 0 then |
| 1428 |
_raise(_Div, "Word.div") |
| 1429 |
elseif y > 0 then |
| 1430 |
if x >= 0 then |
| 1431 |
return x // y |
| 1432 |
else |
| 1433 |
|
| 1434 |
local q = ((x >> 1) // y) << 1 |
| 1435 |
local r = x - q * y |
| 1436 |
if math_ult(r, y) then |
| 1437 |
return q |
| 1438 |
else |
| 1439 |
return q + 1 |
| 1440 |
end |
| 1441 |
end |
| 1442 |
else |
| 1443 |
if math_ult(x, y) then |
| 1444 |
return 0 |
| 1445 |
else |
| 1446 |
return 1 |
| 1447 |
end |
| 1448 |
end |
| 1449 |
end |
| 1450 |
local function _Word_mod(x, y) |
| 1451 |
|
| 1452 |
|
| 1453 |
if y == 0 then |
| 1454 |
_raise(_Div, "Word.mod") |
| 1455 |
elseif y > 0 then |
| 1456 |
if x >= 0 then |
| 1457 |
return x % y |
| 1458 |
else |
| 1459 |
local q = ((x >> 1) // y) << 1 |
| 1460 |
local r = x - q * y |
| 1461 |
if math_ult(r, y) then |
| 1462 |
return r |
| 1463 |
else |
| 1464 |
return r - y |
| 1465 |
end |
| 1466 |
end |
| 1467 |
else |
| 1468 |
if math_ult(x, y) then |
| 1469 |
return x |
| 1470 |
else |
| 1471 |
return x - y |
| 1472 |
end |
| 1473 |
end |
| 1474 |
end |
| 1475 |
local function _list(t) |
| 1476 |
local xs = nil |
| 1477 |
for i = t.n, 1, -1 do |
| 1478 |
xs = { t[i], xs } |
| 1479 |
end |
| 1480 |
return xs |
| 1481 |
end |
| 1482 |
local function _Array_array(n, init) |
| 1483 |
if n < 0 then |
| 1484 |
_raise(_Size, "Array.array") |
| 1485 |
end |
| 1486 |
local t = { n = n } |
| 1487 |
for i = 1, n do |
| 1488 |
t[i] = init |
| 1489 |
end |
| 1490 |
return t |
| 1491 |
end |
| 1492 |
local function _VectorOrArray_fromList(xs) |
| 1493 |
local t = {} |
| 1494 |
local n = 0 |
| 1495 |
while xs ~= nil do |
| 1496 |
n = n + 1 |
| 1497 |
t[n] = xs[1] |
| 1498 |
xs = xs[2] |
| 1499 |
end |
| 1500 |
t.n = n |
| 1501 |
return t |
| 1502 |
end |
| 1503 |
local function _VectorOrArray_tabulate(t) |
| 1504 |
local n, f = t[1], t[2] |
| 1505 |
if n < 0 then |
| 1506 |
_raise(_Size, "(Vector|Array).tabulate") |
| 1507 |
end |
| 1508 |
local t = { n = n } |
| 1509 |
for i = 1, n do |
| 1510 |
t[i] = f(i - 1) |
| 1511 |
end |
| 1512 |
return t |
| 1513 |
end |
| 1514 |
local ref, _COLON_COLON, Chr, Domain, LESS, EQUAL, GREATER, _EXCLAM, _COLON_EQ, NONE, Option, getOpt, app, mapPartial, tmp, revAppend, app1, map, mapPartial1, find, foldl, exists, all, tabulate, sub, update, foldr, length, array, size, str, eq, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9, tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17, tmp18, tmp19, tmp20, tmp21, tmp22, tmp23, TypeError_tag, DEC, quot, rem, compare, tmp24, tmp25, fromManExp, sub1, substring, extract, concat, implode, implodeRev, fields, isPrefix, isSuffix, isAscii, isDigit, isAlphaNum, isHexDigit, isPrint, isSpace, toUpper, toString, scanString |
| 1515 |
do |
| 1516 |
ref = function(x) |
| 1517 |
return {x} |
| 1518 |
end |
| 1519 |
_COLON_COLON = function(a) |
| 1520 |
local x = a[1] |
| 1521 |
return {x, a[2]} |
| 1522 |
end |
| 1523 |
Chr = {tag = {"Chr"}} |
| 1524 |
Domain = {tag = {"Domain"}} |
| 1525 |
LESS = "LESS" |
| 1526 |
EQUAL = "EQUAL" |
| 1527 |
GREATER = "GREATER" |
| 1528 |
_EXCLAM = function(a) |
| 1529 |
return a[1] |
| 1530 |
end |
| 1531 |
_COLON_EQ = function(a) |
| 1532 |
local x = a[1] |
| 1533 |
x[1] = a[2] |
| 1534 |
return nil |
| 1535 |
end |
| 1536 |
NONE = {tag = "NONE"} |
| 1537 |
Option = {tag = {"Option"}} |
| 1538 |
getOpt = function(tmp26, default) |
| 1539 |
if tmp26.tag == "NONE" then |
| 1540 |
return default |
| 1541 |
elseif tmp26.tag == "SOME" then |
| 1542 |
return tmp26.payload |
| 1543 |
else |
| 1544 |
_raise(_Match, "option.sml:19:5") |
| 1545 |
end |
| 1546 |
end |
| 1547 |
app = function(a) |
| 1548 |
return function(a1) |
| 1549 |
if a1.tag == "SOME" then |
| 1550 |
elseif a1.tag == "NONE" then |
| 1551 |
return nil |
| 1552 |
else |
| 1553 |
_raise(_Match, "option.sml:31:5") |
| 1554 |
end |
| 1555 |
do |
| 1556 |
return a(a1.payload) |
| 1557 |
end |
| 1558 |
end |
| 1559 |
end |
| 1560 |
mapPartial = function(a) |
| 1561 |
return function(a1) |
| 1562 |
if a1.tag == "SOME" then |
| 1563 |
elseif a1.tag == "NONE" then |
| 1564 |
return NONE |
| 1565 |
else |
| 1566 |
_raise(_Match, "option.sml:35:5") |
| 1567 |
end |
| 1568 |
do |
| 1569 |
return a(a1.payload) |
| 1570 |
end |
| 1571 |
end |
| 1572 |
end |
| 1573 |
tmp = function(eq1) |
| 1574 |
return function(p) |
| 1575 |
if p[1].tag == "NONE" and p[2].tag == "NONE" then |
| 1576 |
return true |
| 1577 |
else |
| 1578 |
if p[1].tag == "SOME" and p[2].tag == "SOME" then |
| 1579 |
else |
| 1580 |
return false |
| 1581 |
end |
| 1582 |
do |
| 1583 |
return eq1({p[1].payload, p[2].payload}) |
| 1584 |
end |
| 1585 |
end |
| 1586 |
end |
| 1587 |
end |
| 1588 |
revAppend = function(tmp26, ys) |
| 1589 |
local tmp27, tmp28 = tmp26, ys |
| 1590 |
::cont:: |
| 1591 |
do |
| 1592 |
local tmp29, ys1 = tmp27, tmp28 |
| 1593 |
if tmp29 == nil then |
| 1594 |
return ys1 |
| 1595 |
elseif tmp29 ~= nil then |
| 1596 |
local tmp30 = tmp29[1] |
| 1597 |
local tmp31 = tmp29[2] |
| 1598 |
tmp27 = tmp31 |
| 1599 |
tmp28 = {tmp30, ys1} |
| 1600 |
goto cont |
| 1601 |
else |
| 1602 |
_raise(_Match, "list.sml:60:5") |
| 1603 |
end |
| 1604 |
end |
| 1605 |
end |
| 1606 |
app1 = function(a) |
| 1607 |
return function(a1) |
| 1608 |
if a1 == nil then |
| 1609 |
return nil |
| 1610 |
end |
| 1611 |
if a1 ~= nil then |
| 1612 |
else |
| 1613 |
_raise(_Match, "list.sml:64:5") |
| 1614 |
end |
| 1615 |
do |
| 1616 |
local tmp26 = a1[1] |
| 1617 |
local tmp27 = a1[2] |
| 1618 |
a(tmp26) |
| 1619 |
local tmp28 = app1(a) |
| 1620 |
return tmp28(tmp27) |
| 1621 |
end |
| 1622 |
end |
| 1623 |
end |
| 1624 |
map = function(a) |
| 1625 |
return function(a1) |
| 1626 |
if a1 == nil then |
| 1627 |
return nil |
| 1628 |
end |
| 1629 |
if a1 ~= nil then |
| 1630 |
else |
| 1631 |
_raise(_Match, "list.sml:66:5") |
| 1632 |
end |
| 1633 |
do |
| 1634 |
local tmp26 = a1[1] |
| 1635 |
local tmp27 = a1[2] |
| 1636 |
local tmp28 = a(tmp26) |
| 1637 |
local tmp29 = map(a) |
| 1638 |
local tmp30 = tmp29(tmp27) |
| 1639 |
return {tmp28, tmp30} |
| 1640 |
end |
| 1641 |
end |
| 1642 |
end |
| 1643 |
mapPartial1 = function(a) |
| 1644 |
return function(a1) |
| 1645 |
if a1 == nil then |
| 1646 |
return nil |
| 1647 |
end |
| 1648 |
if a1 ~= nil then |
| 1649 |
else |
| 1650 |
_raise(_Match, "list.sml:68:5") |
| 1651 |
end |
| 1652 |
do |
| 1653 |
local tmp26, exp |
| 1654 |
do |
| 1655 |
local tmp27 = a1[1] |
| 1656 |
tmp26 = a1[2] |
| 1657 |
exp = a(tmp27) |
| 1658 |
if exp.tag == "NONE" then |
| 1659 |
else |
| 1660 |
goto else1 |
| 1661 |
end |
| 1662 |
do |
| 1663 |
local tmp28 = mapPartial1(a) |
| 1664 |
return tmp28(tmp26) |
| 1665 |
end |
| 1666 |
end |
| 1667 |
::else1:: |
| 1668 |
if exp.tag == "SOME" then |
| 1669 |
else |
| 1670 |
_raise(_Match, "list.sml:69:30") |
| 1671 |
end |
| 1672 |
do |
| 1673 |
local y = exp.payload |
| 1674 |
local tmp27 = mapPartial1(a) |
| 1675 |
local tmp28 = tmp27(tmp26) |
| 1676 |
return {y, tmp28} |
| 1677 |
end |
| 1678 |
end |
| 1679 |
end |
| 1680 |
end |
| 1681 |
find = function(a) |
| 1682 |
return function(a1) |
| 1683 |
if a1 == nil then |
| 1684 |
return NONE |
| 1685 |
end |
| 1686 |
if a1 ~= nil then |
| 1687 |
else |
| 1688 |
_raise(_Match, "list.sml:72:5") |
| 1689 |
end |
| 1690 |
do |
| 1691 |
local tmp26 = a1[1] |
| 1692 |
local tmp27 = a1[2] |
| 1693 |
local tmp28 = a(tmp26) |
| 1694 |
if tmp28 then |
| 1695 |
return {tag = "SOME", payload = tmp26} |
| 1696 |
end |
| 1697 |
local tmp29 = find(a) |
| 1698 |
return tmp29(tmp27) |
| 1699 |
end |
| 1700 |
end |
| 1701 |
end |
| 1702 |
foldl = function(a) |
| 1703 |
return function(a1) |
| 1704 |
return function(a2) |
| 1705 |
if a2 == nil then |
| 1706 |
return a1 |
| 1707 |
end |
| 1708 |
if a2 ~= nil then |
| 1709 |
else |
| 1710 |
_raise(_Match, "list.sml:91:5") |
| 1711 |
end |
| 1712 |
do |
| 1713 |
local tmp26 = a2[1] |
| 1714 |
local tmp27 = a2[2] |
| 1715 |
local tmp28 = foldl(a) |
| 1716 |
local tmp29 = a({tmp26, a1}) |
| 1717 |
local tmp30 = tmp28(tmp29) |
| 1718 |
return tmp30(tmp27) |
| 1719 |
end |
| 1720 |
end |
| 1721 |
end |
| 1722 |
end |
| 1723 |
exists = function(a) |
| 1724 |
return function(a1) |
| 1725 |
if a1 == nil then |
| 1726 |
return false |
| 1727 |
end |
| 1728 |
if a1 ~= nil then |
| 1729 |
else |
| 1730 |
_raise(_Match, "list.sml:96:5") |
| 1731 |
end |
| 1732 |
do |
| 1733 |
local tmp26 = a1[1] |
| 1734 |
local tmp27 = a1[2] |
| 1735 |
local tmp28 = a(tmp26) |
| 1736 |
if tmp28 then |
| 1737 |
return true |
| 1738 |
end |
| 1739 |
local tmp29 = exists(a) |
| 1740 |
return tmp29(tmp27) |
| 1741 |
end |
| 1742 |
end |
| 1743 |
end |
| 1744 |
all = function(a) |
| 1745 |
return function(a1) |
| 1746 |
if a1 == nil then |
| 1747 |
return true |
| 1748 |
end |
| 1749 |
if a1 ~= nil then |
| 1750 |
else |
| 1751 |
_raise(_Match, "list.sml:98:5") |
| 1752 |
end |
| 1753 |
do |
| 1754 |
local tmp26 = a1[1] |
| 1755 |
local tmp27 = a1[2] |
| 1756 |
local tmp28 = a(tmp26) |
| 1757 |
if tmp28 then |
| 1758 |
else |
| 1759 |
return false |
| 1760 |
end |
| 1761 |
do |
| 1762 |
local tmp29 = all(a) |
| 1763 |
return tmp29(tmp27) |
| 1764 |
end |
| 1765 |
end |
| 1766 |
end |
| 1767 |
end |
| 1768 |
tabulate = function(n, f) |
| 1769 |
if n < 0 then |
| 1770 |
_raise(_Size, "list.sml:101:27") |
| 1771 |
end |
| 1772 |
if n < 10 then |
| 1773 |
else |
| 1774 |
goto else1 |
| 1775 |
end |
| 1776 |
do |
| 1777 |
local function go(a) |
| 1778 |
if a >= n then |
| 1779 |
return nil |
| 1780 |
end |
| 1781 |
local tmp26 = f(a) |
| 1782 |
local tmp27 = go(_Int_add(a, 1)) |
| 1783 |
return {tmp26, tmp27} |
| 1784 |
end |
| 1785 |
return go(0) |
| 1786 |
end |
| 1787 |
::else1:: |
| 1788 |
local tmp26, tmp27 = 0, nil |
| 1789 |
::cont:: |
| 1790 |
do |
| 1791 |
local i, acc = tmp26, tmp27 |
| 1792 |
if i >= n then |
| 1793 |
else |
| 1794 |
goto else2 |
| 1795 |
end |
| 1796 |
do |
| 1797 |
return revAppend(acc, nil) |
| 1798 |
end |
| 1799 |
::else2:: |
| 1800 |
local tmp28 = _Int_add(i, 1) |
| 1801 |
local tmp29 = f(i) |
| 1802 |
tmp26 = tmp28 |
| 1803 |
tmp27 = {tmp29, acc} |
| 1804 |
goto cont |
| 1805 |
end |
| 1806 |
end |
| 1807 |
sub = function(a) |
| 1808 |
local arr = a[1] |
| 1809 |
return arr[a[2] + 1] |
| 1810 |
end |
| 1811 |
update = function(a) |
| 1812 |
local arr = a[1] |
| 1813 |
local i = a[2] |
| 1814 |
arr[i + 1] = a[3] |
| 1815 |
return nil |
| 1816 |
end |
| 1817 |
foldr = function(a, a1) |
| 1818 |
return function(a2) |
| 1819 |
local tmp26, tmp27, tmp28, tmp29 = a, a1, a2, _Int_sub(a2.n, 1) |
| 1820 |
::cont:: |
| 1821 |
do |
| 1822 |
local f, acc, vec, i = tmp26, tmp27, tmp28, tmp29 |
| 1823 |
if i < 0 then |
| 1824 |
return acc |
| 1825 |
end |
| 1826 |
local tmp30 = f({vec[i + 1], acc}) |
| 1827 |
tmp26 = f |
| 1828 |
tmp27 = tmp30 |
| 1829 |
tmp28 = vec |
| 1830 |
tmp29 = _Int_sub(i, 1) |
| 1831 |
goto cont |
| 1832 |
end |
| 1833 |
end |
| 1834 |
end |
| 1835 |
length = function(a) |
| 1836 |
return a.n |
| 1837 |
end |
| 1838 |
array = function(a) |
| 1839 |
local n = a[1] |
| 1840 |
return _Array_array(n, a[2]) |
| 1841 |
end |
| 1842 |
size = function(a) |
| 1843 |
return #a |
| 1844 |
end |
| 1845 |
str = function(a) |
| 1846 |
return string_char(a) |
| 1847 |
end |
| 1848 |
eq = function(a) |
| 1849 |
local x = a[1] |
| 1850 |
return x == a[2] |
| 1851 |
end |
| 1852 |
local tmp26 = _ENV.io |
| 1853 |
tmp1 = _ENV.os |
| 1854 |
tmp2 = _ENV.package |
| 1855 |
tmp3 = _ENV.require |
| 1856 |
tmp4 = _ENV.tonumber |
| 1857 |
tmp5 = _ENV.tostring |
| 1858 |
tmp6 = _ENV.type |
| 1859 |
tmp7 = tmp26.open |
| 1860 |
tmp8 = tmp26.popen |
| 1861 |
tmp9 = tmp26.stderr |
| 1862 |
tmp10 = tmp26.stdout |
| 1863 |
tmp11 = math.huge |
| 1864 |
tmp12 = math.modf |
| 1865 |
tmp13 = tmp1.difftime |
| 1866 |
tmp14 = tmp1.execute |
| 1867 |
tmp15 = tmp1.exit |
| 1868 |
tmp16 = tmp1.getenv |
| 1869 |
tmp17 = tmp1.setlocale |
| 1870 |
tmp18 = tmp1.time |
| 1871 |
tmp19 = string.byte |
| 1872 |
tmp20 = string.find |
| 1873 |
tmp21 = string.gsub |
| 1874 |
tmp22 = string.match |
| 1875 |
local tmp27 = string.sub |
| 1876 |
do |
| 1877 |
local tmp28, tmp29 = pcall(tmp3, "lfs") |
| 1878 |
if tmp28 then |
| 1879 |
tmp23 = {tag = "SOME", payload = tmp29} |
| 1880 |
else |
| 1881 |
tmp23 = NONE |
| 1882 |
end |
| 1883 |
end |
| 1884 |
TypeError_tag = {"TypeError"} |
| 1885 |
DEC = "DEC" |
| 1886 |
quot = function(x, y) |
| 1887 |
do |
| 1888 |
local tmp28 = x >= 0 and y >= 0 |
| 1889 |
local tmp29 |
| 1890 |
tmp29 = tmp28 or x <= 0 and y <= 0 |
| 1891 |
if tmp29 then |
| 1892 |
return _Int_div(x, y) |
| 1893 |
end |
| 1894 |
if x == math_mininteger then |
| 1895 |
else |
| 1896 |
goto else1 |
| 1897 |
end |
| 1898 |
do |
| 1899 |
if y == 1 then |
| 1900 |
return x |
| 1901 |
end |
| 1902 |
local tmp30 = _Int_negate(y) |
| 1903 |
return _Int_negate(_Int_div(x, tmp30)) |
| 1904 |
end |
| 1905 |
end |
| 1906 |
::else1:: |
| 1907 |
local tmp28 = _Int_negate(x) |
| 1908 |
return _Int_negate(_Int_div(tmp28, y)) |
| 1909 |
end |
| 1910 |
rem = function(x, y) |
| 1911 |
if y == -1 then |
| 1912 |
return 0 |
| 1913 |
end |
| 1914 |
local tmp28 = quot(x, y) |
| 1915 |
return _Int_sub(x, _Int_mul(tmp28, y)) |
| 1916 |
end |
| 1917 |
compare = function(a) |
| 1918 |
local x = a[1] |
| 1919 |
local y = a[2] |
| 1920 |
if x == y then |
| 1921 |
return EQUAL |
| 1922 |
elseif x < y then |
| 1923 |
return LESS |
| 1924 |
else |
| 1925 |
return GREATER |
| 1926 |
end |
| 1927 |
end |
| 1928 |
do |
| 1929 |
local tmp28, tmp29 = math_maxinteger, 1 |
| 1930 |
::cont5:: |
| 1931 |
do |
| 1932 |
local x, n = tmp28, tmp29 |
| 1933 |
if x == 0 then |
| 1934 |
tmp24 = n |
| 1935 |
else |
| 1936 |
local tmp30 = x >> 1 |
| 1937 |
tmp28 = tmp30 |
| 1938 |
tmp29 = _Int_add(n, 1) |
| 1939 |
goto cont5 |
| 1940 |
end |
| 1941 |
end |
| 1942 |
end |
| 1943 |
tmp25 = - tmp11 |
| 1944 |
fromManExp = function(exp, man) |
| 1945 |
local tmp28, tmp29 = exp, man |
| 1946 |
::cont:: |
| 1947 |
do |
| 1948 |
local exp1, man1 = tmp28, tmp29 |
| 1949 |
if -1022 <= exp1 then |
| 1950 |
if exp1 < 1024 then |
| 1951 |
return man1 * 2.0 ^ exp1 |
| 1952 |
end |
| 1953 |
local exp_PRIME |
| 1954 |
if exp1 > 2098 then |
| 1955 |
exp_PRIME = 2098 |
| 1956 |
else |
| 1957 |
exp_PRIME = exp1 |
| 1958 |
end |
| 1959 |
local tmp30 = man1 * 0x1p1023 |
| 1960 |
tmp28 = _Int_sub(exp_PRIME, 1023) |
| 1961 |
tmp29 = tmp30 |
| 1962 |
goto cont |
| 1963 |
end |
| 1964 |
local exp_PRIME |
| 1965 |
if exp1 < -2099 then |
| 1966 |
exp_PRIME = -2099 |
| 1967 |
else |
| 1968 |
exp_PRIME = exp1 |
| 1969 |
end |
| 1970 |
local tmp30 = exp_PRIME % -1022 |
| 1971 |
if tmp30 ~= 0 then |
| 1972 |
local tmp31 = man1 * 2.0 ^ tmp30 |
| 1973 |
tmp28 = _Int_sub(exp_PRIME, tmp30) |
| 1974 |
tmp29 = tmp31 |
| 1975 |
goto cont |
| 1976 |
else |
| 1977 |
local tmp31 = man1 * 0x1p-1022 |
| 1978 |
tmp28 = _Int_add(exp_PRIME, 1022) |
| 1979 |
tmp29 = tmp31 |
| 1980 |
goto cont |
| 1981 |
end |
| 1982 |
end |
| 1983 |
end |
| 1984 |
sub1 = function(a) |
| 1985 |
local s = a[1] |
| 1986 |
local i = a[2] |
| 1987 |
if i < 0 or #s <= i then |
| 1988 |
_raise(_Subscript, "string-1.sml:33:44") |
| 1989 |
else |
| 1990 |
return tmp19(s, _Int_add(i, 1)) |
| 1991 |
end |
| 1992 |
end |
| 1993 |
substring = function(s, i, j) |
| 1994 |
local tmp28 |
| 1995 |
if i < 0 then |
| 1996 |
tmp28 = true |
| 1997 |
elseif j < 0 then |
| 1998 |
tmp28 = true |
| 1999 |
else |
| 2000 |
local tmp29 = #s |
| 2001 |
tmp28 = tmp29 < _Int_add(i, j) |
| 2002 |
end |
| 2003 |
if tmp28 then |
| 2004 |
_raise(_Subscript, "string-1.sml:40:59") |
| 2005 |
else |
| 2006 |
local tmp29 = _Int_add(i, 1) |
| 2007 |
return tmp27(s, tmp29, _Int_add(i, j)) |
| 2008 |
end |
| 2009 |
end |
| 2010 |
extract = function(s, i, tmp28) |
| 2011 |
if tmp28.tag == "NONE" then |
| 2012 |
if i < 0 or #s < i then |
| 2013 |
_raise(_Subscript, "string-1.sml:46:69") |
| 2014 |
else |
| 2015 |
return tmp27(s, _Int_add(i, 1)) |
| 2016 |
end |
| 2017 |
else |
| 2018 |
if tmp28.tag == "SOME" then |
| 2019 |
else |
| 2020 |
_raise(_Match, "string-1.sml:45:5") |
| 2021 |
end |
| 2022 |
do |
| 2023 |
return substring(s, i, tmp28.payload) |
| 2024 |
end |
| 2025 |
end |
| 2026 |
end |
| 2027 |
concat = function(a) |
| 2028 |
return table_concat(_VectorOrArray_fromList(a)) |
| 2029 |
end |
| 2030 |
implode = function(a) |
| 2031 |
local v = _VectorOrArray_fromList(a) |
| 2032 |
local tmp28 |
| 2033 |
do |
| 2034 |
local tmp29 = v.n |
| 2035 |
tmp28 = _VectorOrArray_tabulate({tmp29, function(i) |
| 2036 |
return string_char(v[i + 1]) |
| 2037 |
end}) |
| 2038 |
end |
| 2039 |
return table_concat(tmp28) |
| 2040 |
end |
| 2041 |
implodeRev = function(a) |
| 2042 |
local tmp28 = revAppend(a, nil) |
| 2043 |
local v = _VectorOrArray_fromList(tmp28) |
| 2044 |
local tmp29 |
| 2045 |
do |
| 2046 |
local tmp30 = v.n |
| 2047 |
tmp29 = _VectorOrArray_tabulate({tmp30, function(i) |
| 2048 |
return string_char(v[i + 1]) |
| 2049 |
end}) |
| 2050 |
end |
| 2051 |
return table_concat(tmp29) |
| 2052 |
end |
| 2053 |
fields = function(a) |
| 2054 |
return function(a1) |
| 2055 |
local tmp28, tmp29, tmp30 |
| 2056 |
do |
| 2057 |
local tmp31 |
| 2058 |
do |
| 2059 |
local tmp32 = foldr(_COLON_COLON, nil) |
| 2060 |
local tmp33 = _VectorOrArray_tabulate({#a1, function(i) |
| 2061 |
return sub1({a1, i}) |
| 2062 |
end}) |
| 2063 |
tmp31 = tmp32(tmp33) |
| 2064 |
end |
| 2065 |
tmp30, tmp29, tmp28 = nil, nil, tmp31 |
| 2066 |
end |
| 2067 |
::cont:: |
| 2068 |
do |
| 2069 |
local revFields, acc, tmp31 = tmp30, tmp29, tmp28 |
| 2070 |
if tmp31 == nil then |
| 2071 |
else |
| 2072 |
goto else1 |
| 2073 |
end |
| 2074 |
do |
| 2075 |
local tmp32 = implodeRev(acc) |
| 2076 |
return revAppend({tmp32, revFields}, nil) |
| 2077 |
end |
| 2078 |
::else1:: |
| 2079 |
if tmp31 ~= nil then |
| 2080 |
else |
| 2081 |
_raise(_Match, "string-1.sml:80:26") |
| 2082 |
end |
| 2083 |
do |
| 2084 |
local tmp32 = tmp31[1] |
| 2085 |
local tmp33 = tmp31[2] |
| 2086 |
local tmp34 = a(tmp32) |
| 2087 |
if tmp34 then |
| 2088 |
else |
| 2089 |
tmp30 = revFields |
| 2090 |
tmp29 = {tmp32, acc} |
| 2091 |
tmp28 = tmp33 |
| 2092 |
goto cont |
| 2093 |
end |
| 2094 |
do |
| 2095 |
local tmp35 = implodeRev(acc) |
| 2096 |
tmp30 = {tmp35, revFields} |
| 2097 |
tmp29 = nil |
| 2098 |
tmp28 = tmp33 |
| 2099 |
goto cont |
| 2100 |
end |
| 2101 |
end |
| 2102 |
end |
| 2103 |
end |
| 2104 |
end |
| 2105 |
isPrefix = function(a) |
| 2106 |
return function(a1) |
| 2107 |
local tmp28 = #a |
| 2108 |
if tmp28 > #a1 then |
| 2109 |
return false |
| 2110 |
end |
| 2111 |
local tmp29 = substring(a1, 0, tmp28) |
| 2112 |
return tmp29 == a |
| 2113 |
end |
| 2114 |
end |
| 2115 |
isSuffix = function(a) |
| 2116 |
return function(a1) |
| 2117 |
local tmp28 = #a |
| 2118 |
local tmp29 = #a1 |
| 2119 |
if tmp28 > tmp29 then |
| 2120 |
return false |
| 2121 |
end |
| 2122 |
local tmp30 = substring(a1, _Int_sub(tmp29, tmp28), tmp28) |
| 2123 |
return tmp30 == a |
| 2124 |
end |
| 2125 |
end |
| 2126 |
isAscii = function(a) |
| 2127 |
return a <= 127 |
| 2128 |
end |
| 2129 |
isDigit = function(a) |
| 2130 |
return 48 <= a and a <= 57 |
| 2131 |
end |
| 2132 |
isAlphaNum = function(a) |
| 2133 |
local tmp28 |
| 2134 |
if 65 <= a and a <= 90 then |
| 2135 |
return true |
| 2136 |
else |
| 2137 |
tmp28 = 97 <= a and a <= 122 |
| 2138 |
end |
| 2139 |
return tmp28 or 48 <= a and a <= 57 |
| 2140 |
end |
| 2141 |
isHexDigit = function(a) |
| 2142 |
return 48 <= a and a <= 57 or (97 <= a and a <= 102 or 65 <= a and a <= 70) |
| 2143 |
end |
| 2144 |
isPrint = function(a) |
| 2145 |
return 33 <= a and a <= 126 or a == 32 |
| 2146 |
end |
| 2147 |
isSpace = function(a) |
| 2148 |
return 9 <= a and a <= 13 or a == 32 |
| 2149 |
end |
| 2150 |
toUpper = function(a) |
| 2151 |
if 97 <= a and a <= 122 then |
| 2152 |
local tmp28 = _Int_sub(a, 32) |
| 2153 |
if tmp28 < 0 then |
| 2154 |
_raise(Chr, "char-1.sml:47:37") |
| 2155 |
elseif tmp28 > 255 then |
| 2156 |
_raise(Chr, "char-1.sml:47:37") |
| 2157 |
else |
| 2158 |
return tmp28 |
| 2159 |
end |
| 2160 |
else |
| 2161 |
return a |
| 2162 |
end |
| 2163 |
end |
| 2164 |
toString = function(a) |
| 2165 |
if a == 92 then |
| 2166 |
return "\\\\" |
| 2167 |
end |
| 2168 |
if a == 34 then |
| 2169 |
return "\\\"" |
| 2170 |
end |
| 2171 |
local tmp28 = isPrint(a) |
| 2172 |
if tmp28 then |
| 2173 |
return string_char(a) |
| 2174 |
end |
| 2175 |
if a == 7 then |
| 2176 |
return "\\a" |
| 2177 |
end |
| 2178 |
if a == 8 then |
| 2179 |
return "\\b" |
| 2180 |
end |
| 2181 |
if a == 9 then |
| 2182 |
return "\\t" |
| 2183 |
end |
| 2184 |
if a == 10 then |
| 2185 |
return "\\n" |
| 2186 |
end |
| 2187 |
if a == 11 then |
| 2188 |
return "\\v" |
| 2189 |
end |
| 2190 |
if a == 12 then |
| 2191 |
return "\\f" |
| 2192 |
end |
| 2193 |
if a == 13 then |
| 2194 |
return "\\r" |
| 2195 |
end |
| 2196 |
local tmp29 = a |
| 2197 |
if tmp29 < 32 then |
| 2198 |
local tmp30 = _Int_add(tmp29, 64) |
| 2199 |
if tmp30 < 0 then |
| 2200 |
_raise(Chr, "char-1.sml:47:37") |
| 2201 |
elseif tmp30 > 255 then |
| 2202 |
_raise(Chr, "char-1.sml:47:37") |
| 2203 |
else |
| 2204 |
return "\\^" .. string_char(tmp30) |
| 2205 |
end |
| 2206 |
elseif tmp29 < 100 then |
| 2207 |
return "\\0" .. tmp21(tmp5(tmp29), "-", "~") |
| 2208 |
else |
| 2209 |
return "\\" .. tmp21(tmp5(tmp29), "-", "~") |
| 2210 |
end |
| 2211 |
end |
| 2212 |
scanString = function(a) |
| 2213 |
return function(a1) |
| 2214 |
local tmp28 = a(function(a2) |
| 2215 |
local s = a2[1] |
| 2216 |
local i = a2[2] |
| 2217 |
if i < #s then |
| 2218 |
else |
| 2219 |
return NONE |
| 2220 |
end |
| 2221 |
do |
| 2222 |
local tmp29 = sub1({s, i}) |
| 2223 |
return {tag = "SOME", payload = {tmp29, {s, _Int_add(i, 1)}}} |
| 2224 |
end |
| 2225 |
end) |
| 2226 |
local exp = tmp28({a1, 0}) |
| 2227 |
if exp.tag == "SOME" then |
| 2228 |
return {tag = "SOME", payload = exp.payload[1]} |
| 2229 |
elseif exp.tag == "NONE" then |
| 2230 |
return NONE |
| 2231 |
else |
| 2232 |
_raise(_Match, "string-cvt-1.sml:33:25") |
| 2233 |
end |
| 2234 |
end |
| 2235 |
end |
| 2236 |
do |
| 2237 |
if tmp24 ~= 64 then |
| 2238 |
else |
| 2239 |
goto cont |
| 2240 |
end |
| 2241 |
do |
| 2242 |
local tmp28 = _Fail("Word64 is not available") |
| 2243 |
_raise(tmp28, "word.sml:333:18") |
| 2244 |
end |
| 2245 |
end |
| 2246 |
end |
| 2247 |
::cont:: |
| 2248 |
local MonoSequence, CharArray, extract1, full, string1, isEmpty, getc, concat1, splitl, splitr, tokens, tmp26, tmp27, tmp28, tmp29, tmp30, tmp31, tmp32, tmp33, tmp34, tmp35, tmp36, tmp37, tmp38, tmp39, tmp40, tmp41, tmp42 |
| 2249 |
do |
| 2250 |
MonoSequence = function(fromList, length1, maxLen, tmp43, create, tmp44, tmp45, tmp46, tmp47, fromList1, length2, maxLen1, tmp48, vector, tmp49, tmp50, tmp51) |
| 2251 |
local tabulate1, sub2, update1, appi, app2, mapi, map1, foldli, foldri, foldl1, foldr1, findi, find1, exists1, all1, collate, toList, append, prepend, array1, tabulate2, sub3, update2, copy, copyVec, appi1, app3, modifyi, modify, foldli1, foldri1, foldl2, foldr2, findi1, find2, exists2, all2, collate1, toList1, vector1, fromVector, length3, sub4, update3, full1, slice, subslice, base, copy1, copyVec1, isEmpty1, getItem, appi2, app4, modifyi1, modify1, foldli2, foldri2, foldl3, foldr3, findi2, find3, exists3, all3, collate2, vector2, UnsafeMonoVector, UnsafeMonoArray, MonoVectorSlice |
| 2252 |
do |
| 2253 |
tabulate1 = function(a) |
| 2254 |
local n = a[1] |
| 2255 |
local tmp52 = tabulate(n, a[2]) |
| 2256 |
return tmp49({n, tmp52}) |
| 2257 |
end |
| 2258 |
sub2 = function(a) |
| 2259 |
local v = a[1] |
| 2260 |
local i = a[2] |
| 2261 |
local tmp52 |
| 2262 |
do |
| 2263 |
if 0 <= i then |
| 2264 |
else |
| 2265 |
tmp52 = false |
| 2266 |
goto cont |
| 2267 |
end |
| 2268 |
do |
| 2269 |
local tmp53 = length2(v) |
| 2270 |
tmp52 = i < tmp53 |
| 2271 |
end |
| 2272 |
end |
| 2273 |
::cont:: |
| 2274 |
if tmp52 then |
| 2275 |
else |
| 2276 |
_raise(_Subscript, "mono-sequence.sml:221:22") |
| 2277 |
end |
| 2278 |
do |
| 2279 |
return tmp51({v, i}) |
| 2280 |
end |
| 2281 |
end |
| 2282 |
update1 = function(a) |
| 2283 |
local v = a[1] |
| 2284 |
local i = a[2] |
| 2285 |
local x = a[3] |
| 2286 |
local tmp52 = tmp48({base = v, length = i, start = 0}) |
| 2287 |
local tmp53 = fromList1({x, nil}) |
| 2288 |
local tmp54 = _Int_add(i, 1) |
| 2289 |
local tmp55 = length2(v) |
| 2290 |
local tmp56 = tmp48({base = v, length = _Int_sub(_Int_sub(tmp55, i), 1), start = tmp54}) |
| 2291 |
return tmp47({tmp52, {tmp53, {tmp56, nil}}}) |
| 2292 |
end |
| 2293 |
appi = function(a) |
| 2294 |
return function(a1) |
| 2295 |
local n = length2(a1) |
| 2296 |
local tmp52 = 0 |
| 2297 |
::cont:: |
| 2298 |
do |
| 2299 |
local a2 = tmp52 |
| 2300 |
if a2 >= n then |
| 2301 |
return nil |
| 2302 |
end |
| 2303 |
local tmp53 = tmp51({a1, a2}) |
| 2304 |
a({a2, tmp53}) |
| 2305 |
tmp52 = _Int_add(a2, 1) |
| 2306 |
goto cont |
| 2307 |
end |
| 2308 |
end |
| 2309 |
end |
| 2310 |
app2 = function(a) |
| 2311 |
return function(a1) |
| 2312 |
local n = length2(a1) |
| 2313 |
local tmp52 = 0 |
| 2314 |
::cont:: |
| 2315 |
do |
| 2316 |
local a2 = tmp52 |
| 2317 |
if a2 >= n then |
| 2318 |
return nil |
| 2319 |
end |
| 2320 |
local tmp53 = tmp51({a1, a2}) |
| 2321 |
a(tmp53) |
| 2322 |
tmp52 = _Int_add(a2, 1) |
| 2323 |
goto cont |
| 2324 |
end |
| 2325 |
end |
| 2326 |
end |
| 2327 |
mapi = function(a) |
| 2328 |
return function(a1) |
| 2329 |
local n = length2(a1) |
| 2330 |
local tmp52 = tabulate(n, function(i) |
| 2331 |
local tmp53 = tmp51({a1, i}) |
| 2332 |
return a({i, tmp53}) |
| 2333 |
end) |
| 2334 |
return tmp49({n, tmp52}) |
| 2335 |
end |
| 2336 |
end |
| 2337 |
map1 = function(a) |
| 2338 |
return function(a1) |
| 2339 |
local n = length2(a1) |
| 2340 |
local tmp52 = tabulate(n, function(i) |
| 2341 |
local tmp53 = tmp51({a1, i}) |
| 2342 |
return a(tmp53) |
| 2343 |
end) |
| 2344 |
return tmp49({n, tmp52}) |
| 2345 |
end |
| 2346 |
end |
| 2347 |
foldli = function(a) |
| 2348 |
return function(a1) |
| 2349 |
return function(a2) |
| 2350 |
local n = length2(a2) |
| 2351 |
local tmp52, tmp53 = 0, a1 |
| 2352 |
::cont:: |
| 2353 |
do |
| 2354 |
local i, acc = tmp52, tmp53 |
| 2355 |
if i >= n then |
| 2356 |
return acc |
| 2357 |
end |
| 2358 |
local tmp54 = _Int_add(i, 1) |
| 2359 |
local tmp55 = tmp51({a2, i}) |
| 2360 |
local tmp56 = a({i, tmp55, acc}) |
| 2361 |
tmp52 = tmp54 |
| 2362 |
tmp53 = tmp56 |
| 2363 |
goto cont |
| 2364 |
end |
| 2365 |
end |
| 2366 |
end |
| 2367 |
end |
| 2368 |
foldri = function(a) |
| 2369 |
return function(a1) |
| 2370 |
return function(a2) |
| 2371 |
local tmp52, tmp53 |
| 2372 |
do |
| 2373 |
local tmp54 = length2(a2) |
| 2374 |
tmp53, tmp52 = _Int_sub(tmp54, 1), a1 |
| 2375 |
end |
| 2376 |
::cont:: |
| 2377 |
do |
| 2378 |
local i, acc = tmp53, tmp52 |
| 2379 |
if i < 0 then |
| 2380 |
return acc |
| 2381 |
end |
| 2382 |
local tmp54 = _Int_sub(i, 1) |
| 2383 |
local tmp55 = tmp51({a2, i}) |
| 2384 |
local tmp56 = a({i, tmp55, acc}) |
| 2385 |
tmp53 = tmp54 |
| 2386 |
tmp52 = tmp56 |
| 2387 |
goto cont |
| 2388 |
end |
| 2389 |
end |
| 2390 |
end |
| 2391 |
end |
| 2392 |
foldl1 = function(a) |
| 2393 |
return function(a1) |
| 2394 |
return function(a2) |
| 2395 |
local n = length2(a2) |
| 2396 |
local tmp52, tmp53 = 0, a1 |
| 2397 |
::cont:: |
| 2398 |
do |
| 2399 |
local i, acc = tmp52, tmp53 |
| 2400 |
if i >= n then |
| 2401 |
return acc |
| 2402 |
end |
| 2403 |
local tmp54 = _Int_add(i, 1) |
| 2404 |
local tmp55 = tmp51({a2, i}) |
| 2405 |
local tmp56 = a({tmp55, acc}) |
| 2406 |
tmp52 = tmp54 |
| 2407 |
tmp53 = tmp56 |
| 2408 |
goto cont |
| 2409 |
end |
| 2410 |
end |
| 2411 |
end |
| 2412 |
end |
| 2413 |
foldr1 = function(a) |
| 2414 |
return function(a1) |
| 2415 |
return function(a2) |
| 2416 |
local tmp52, tmp53 |
| 2417 |
do |
| 2418 |
local tmp54 = length2(a2) |
| 2419 |
tmp53, tmp52 = _Int_sub(tmp54, 1), a1 |
| 2420 |
end |
| 2421 |
::cont:: |
| 2422 |
do |
| 2423 |
local i, acc = tmp53, tmp52 |
| 2424 |
if i < 0 then |
| 2425 |
return acc |
| 2426 |
end |
| 2427 |
local tmp54 = _Int_sub(i, 1) |
| 2428 |
local tmp55 = tmp51({a2, i}) |
| 2429 |
local tmp56 = a({tmp55, acc}) |
| 2430 |
tmp53 = tmp54 |
| 2431 |
tmp52 = tmp56 |
| 2432 |
goto cont |
| 2433 |
end |
| 2434 |
end |
| 2435 |
end |
| 2436 |
end |
| 2437 |
findi = function(a) |
| 2438 |
return function(a1) |
| 2439 |
local n = length2(a1) |
| 2440 |
local tmp52 = 0 |
| 2441 |
::cont:: |
| 2442 |
do |
| 2443 |
local a2 = tmp52 |
| 2444 |
if a2 >= n then |
| 2445 |
return NONE |
| 2446 |
end |
| 2447 |
local x = tmp51({a1, a2}) |
| 2448 |
local tmp53 = a({a2, x}) |
| 2449 |
if tmp53 then |
| 2450 |
return {tag = "SOME", payload = {a2, x}} |
| 2451 |
else |
| 2452 |
tmp52 = _Int_add(a2, 1) |
| 2453 |
goto cont |
| 2454 |
end |
| 2455 |
end |
| 2456 |
end |
| 2457 |
end |
| 2458 |
find1 = function(a) |
| 2459 |
return function(a1) |
| 2460 |
local n = length2(a1) |
| 2461 |
local tmp52 = 0 |
| 2462 |
::cont:: |
| 2463 |
do |
| 2464 |
local a2 = tmp52 |
| 2465 |
if a2 >= n then |
| 2466 |
return NONE |
| 2467 |
end |
| 2468 |
local x = tmp51({a1, a2}) |
| 2469 |
local tmp53 = a(x) |
| 2470 |
if tmp53 then |
| 2471 |
return {tag = "SOME", payload = x} |
| 2472 |
else |
| 2473 |
tmp52 = _Int_add(a2, 1) |
| 2474 |
goto cont |
| 2475 |
end |
| 2476 |
end |
| 2477 |
end |
| 2478 |
end |
| 2479 |
exists1 = function(a) |
| 2480 |
return function(a1) |
| 2481 |
local n = length2(a1) |
| 2482 |
local tmp52 = 0 |
| 2483 |
::cont:: |
| 2484 |
do |
| 2485 |
local a2 = tmp52 |
| 2486 |
if a2 >= n then |
| 2487 |
return false |
| 2488 |
end |
| 2489 |
local tmp53 = tmp51({a1, a2}) |
| 2490 |
local tmp54 = a(tmp53) |
| 2491 |
if tmp54 then |
| 2492 |
return true |
| 2493 |
else |
| 2494 |
tmp52 = _Int_add(a2, 1) |
| 2495 |
goto cont |
| 2496 |
end |
| 2497 |
end |
| 2498 |
end |
| 2499 |
end |
| 2500 |
all1 = function(a) |
| 2501 |
return function(a1) |
| 2502 |
local n = length2(a1) |
| 2503 |
local tmp52 = 0 |
| 2504 |
::cont:: |
| 2505 |
do |
| 2506 |
local a2 = tmp52 |
| 2507 |
if a2 >= n then |
| 2508 |
return true |
| 2509 |
end |
| 2510 |
local tmp53 = tmp51({a1, a2}) |
| 2511 |
local tmp54 = a(tmp53) |
| 2512 |
if tmp54 then |
| 2513 |
tmp52 = _Int_add(a2, 1) |
| 2514 |
goto cont |
| 2515 |
else |
| 2516 |
return false |
| 2517 |
end |
| 2518 |
end |
| 2519 |
end |
| 2520 |
end |
| 2521 |
collate = function(a) |
| 2522 |
return function(a1) |
| 2523 |
local xs = a1[1] |
| 2524 |
local ys = a1[2] |
| 2525 |
local xl = length2(xs) |
| 2526 |
local yl = length2(ys) |
| 2527 |
local tmp52 = 0 |
| 2528 |
::cont:: |
| 2529 |
do |
| 2530 |
local a2 = tmp52 |
| 2531 |
local tmp53 = xl <= a2 |
| 2532 |
local tmp54 = yl <= a2 |
| 2533 |
local tmp55 |
| 2534 |
tmp55 = tmp53 and tmp54 |
| 2535 |
if tmp55 then |
| 2536 |
return EQUAL |
| 2537 |
end |
| 2538 |
local tmp56 |
| 2539 |
tmp56 = tmp53 and not tmp54 |
| 2540 |
if tmp56 then |
| 2541 |
return LESS |
| 2542 |
end |
| 2543 |
if not tmp53 and tmp54 then |
| 2544 |
return GREATER |
| 2545 |
end |
| 2546 |
if not tmp53 and not tmp54 then |
| 2547 |
else |
| 2548 |
_raise(_Match, "mono-sequence.sml:310:49") |
| 2549 |
end |
| 2550 |
do |
| 2551 |
local tmp57 = tmp51({xs, a2}) |
| 2552 |
local tmp58 = tmp51({ys, a2}) |
| 2553 |
local exp = a({tmp57, tmp58}) |
| 2554 |
if exp == "EQUAL" then |
| 2555 |
tmp52 = _Int_add(a2, 1) |
| 2556 |
goto cont |
| 2557 |
else |
| 2558 |
return exp |
| 2559 |
end |
| 2560 |
end |
| 2561 |
end |
| 2562 |
end |
| 2563 |
end |
| 2564 |
toList = function(a) |
| 2565 |
local tmp52 = foldr1(_COLON_COLON) |
| 2566 |
local tmp53 = tmp52(nil) |
| 2567 |
return tmp53(a) |
| 2568 |
end |
| 2569 |
append = function(a) |
| 2570 |
local v = a[1] |
| 2571 |
local tmp52 = fromList1({a[2], nil}) |
| 2572 |
return tmp47({v, {tmp52, nil}}) |
| 2573 |
end |
| 2574 |
prepend = function(a) |
| 2575 |
local x = a[1] |
| 2576 |
local v = a[2] |
| 2577 |
local tmp52 = fromList1({x, nil}) |
| 2578 |
return tmp47({tmp52, {v, nil}}) |
| 2579 |
end |
| 2580 |
local length4 = function(tmp52) |
| 2581 |
return tmp52.length |
| 2582 |
end |
| 2583 |
local sub5 = function(a) |
| 2584 |
local base1 = a[1].base |
| 2585 |
local start = a[1].start |
| 2586 |
local length5 = a[1].length |
| 2587 |
local i = a[2] |
| 2588 |
if 0 <= i and i < length5 then |
| 2589 |
else |
| 2590 |
_raise(_Subscript, "mono-sequence.sml:331:44") |
| 2591 |
end |
| 2592 |
do |
| 2593 |
return tmp51({base1, _Int_add(start, i)}) |
| 2594 |
end |
| 2595 |
end |
| 2596 |
local full2 = function(a) |
| 2597 |
local tmp52 = length2(a) |
| 2598 |
return {base = a, length = tmp52, start = 0} |
| 2599 |
end |
| 2600 |
local slice1 = function(a) |
| 2601 |
if a[3].tag == "NONE" then |
| 2602 |
else |
| 2603 |
goto else1 |
| 2604 |
end |
| 2605 |
do |
| 2606 |
local v = a[1] |
| 2607 |
local i = a[2] |
| 2608 |
local n = length2(v) |
| 2609 |
if 0 <= i and i <= n then |
| 2610 |
return {base = v, length = _Int_sub(n, i), start = i} |
| 2611 |
else |
| 2612 |
_raise(_Subscript, "mono-sequence.sml:337:33") |
| 2613 |
end |
| 2614 |
end |
| 2615 |
::else1:: |
| 2616 |
if a[3].tag == "SOME" then |
| 2617 |
else |
| 2618 |
_raise(_Match, "mono-sequence.sml:333:5") |
| 2619 |
end |
| 2620 |
do |
| 2621 |
local v = a[1] |
| 2622 |
local i = a[2] |
| 2623 |
local n = a[3].payload |
| 2624 |
local tmp52 |
| 2625 |
do |
| 2626 |
if 0 <= i then |
| 2627 |
else |
| 2628 |
tmp52 = false |
| 2629 |
goto cont |
| 2630 |
end |
| 2631 |
do |
| 2632 |
if 0 <= n then |
| 2633 |
else |
| 2634 |
tmp52 = false |
| 2635 |
goto cont |
| 2636 |
end |
| 2637 |
do |
| 2638 |
local tmp53 = _Int_add(i, n) |
| 2639 |
local tmp54 = length2(v) |
| 2640 |
tmp52 = tmp53 <= tmp54 |
| 2641 |
end |
| 2642 |
end |
| 2643 |
end |
| 2644 |
::cont:: |
| 2645 |
if tmp52 then |
| 2646 |
return {base = v, length = n, start = i} |
| 2647 |
else |
| 2648 |
_raise(_Subscript, "mono-sequence.sml:342:32") |
| 2649 |
end |
| 2650 |
end |
| 2651 |
end |
| 2652 |
local subslice1 = function(a) |
| 2653 |
if a[3].tag == "NONE" then |
| 2654 |
local base1 = a[1].base |
| 2655 |
local start = a[1].start |
| 2656 |
local length5 = a[1].length |
| 2657 |
local i = a[2] |
| 2658 |
if 0 <= i and i <= length5 then |
| 2659 |
local tmp52 = _Int_add(start, i) |
| 2660 |
return {base = base1, length = _Int_sub(length5, i), start = tmp52} |
| 2661 |
else |
| 2662 |
_raise(_Subscript, "mono-sequence.sml:346:55") |
| 2663 |
end |
| 2664 |
end |
| 2665 |
if a[3].tag == "SOME" then |
| 2666 |
local base1 = a[1].base |
| 2667 |
local start = a[1].start |
| 2668 |
local length5 = a[1].length |
| 2669 |
local i = a[2] |
| 2670 |
local n = a[3].payload |
| 2671 |
if 0 <= i and (0 <= n and _Int_add(i, n) <= length5) then |
| 2672 |
return {base = base1, length = n, start = _Int_add(start, i)} |
| 2673 |
else |
| 2674 |
_raise(_Subscript, "mono-sequence.sml:350:57") |
| 2675 |
end |
| 2676 |
else |
| 2677 |
_raise(_Match, "mono-sequence.sml:343:5") |
| 2678 |
end |
| 2679 |
end |
| 2680 |
local base1 = function(a) |
| 2681 |
local b = a.base |
| 2682 |
local start = a.start |
| 2683 |
return {b, start, a.length} |
| 2684 |
end |
| 2685 |
local concat2 = function(a) |
| 2686 |
local tmp52 = map(tmp48) |
| 2687 |
local tmp53 = tmp52(a) |
| 2688 |
return tmp47(tmp53) |
| 2689 |
end |
| 2690 |
local isEmpty2 = function(a) |
| 2691 |
return a.length == 0 |
| 2692 |
end |
| 2693 |
local getItem1 = function(a) |
| 2694 |
local base2 = a.base |
| 2695 |
local start = a.start |
| 2696 |
local length5 = a.length |
| 2697 |
if length5 > 0 then |
| 2698 |
else |
| 2699 |
return NONE |
| 2700 |
end |
| 2701 |
do |
| 2702 |
local tmp52 = tmp51({base2, start}) |
| 2703 |
local tmp53 = _Int_add(start, 1) |
| 2704 |
return {tag = "SOME", payload = {tmp52, {base = base2, length = _Int_sub(length5, 1), start = tmp53}}} |
| 2705 |
end |
| 2706 |
end |
| 2707 |
local appi3 = function(a) |
| 2708 |
return function(a1) |
| 2709 |
local base2 = a1.base |
| 2710 |
local start = a1.start |
| 2711 |
local length5 = a1.length |
| 2712 |
local tmp52 = 0 |
| 2713 |
::cont:: |
| 2714 |
do |
| 2715 |
local a2 = tmp52 |
| 2716 |
if a2 >= length5 then |
| 2717 |
return nil |
| 2718 |
end |
| 2719 |
local tmp53 = tmp51({base2, _Int_add(start, a2)}) |
| 2720 |
a({a2, tmp53}) |
| 2721 |
tmp52 = _Int_add(a2, 1) |
| 2722 |
goto cont |
| 2723 |
end |
| 2724 |
end |
| 2725 |
end |
| 2726 |
local app5 = function(a) |
| 2727 |
return function(a1) |
| 2728 |
local base2, tmp52, tmp53 |
| 2729 |
do |
| 2730 |
base2 = a1.base |
| 2731 |
local start = a1.start |
| 2732 |
tmp52 = _Int_add(start, a1.length) |
| 2733 |
tmp53 = start |
| 2734 |
end |
| 2735 |
::cont:: |
| 2736 |
do |
| 2737 |
local a2 = tmp53 |
| 2738 |
if a2 >= tmp52 then |
| 2739 |
return nil |
| 2740 |
end |
| 2741 |
local tmp54 = tmp51({base2, a2}) |
| 2742 |
a(tmp54) |
| 2743 |
tmp53 = _Int_add(a2, 1) |
| 2744 |
goto cont |
| 2745 |
end |
| 2746 |
end |
| 2747 |
end |
| 2748 |
local mapi1 = function(a) |
| 2749 |
return function(a1) |
| 2750 |
local base2 = a1.base |
| 2751 |
local start = a1.start |
| 2752 |
local length5 = a1.length |
| 2753 |
local tmp52, tmp53 = 0, nil |
| 2754 |
::cont:: |
| 2755 |
do |
| 2756 |
local i, acc = tmp52, tmp53 |
| 2757 |
if i >= length5 then |
| 2758 |
else |
| 2759 |
goto else1 |
| 2760 |
end |
| 2761 |
do |
| 2762 |
return tmp50({length5, acc}) |
| 2763 |
end |
| 2764 |
::else1:: |
| 2765 |
local tmp54 = _Int_add(i, 1) |
| 2766 |
local tmp55 = tmp51({base2, _Int_add(start, i)}) |
| 2767 |
local tmp56 = a({i, tmp55}) |
| 2768 |
tmp52 = tmp54 |
| 2769 |
tmp53 = {tmp56, acc} |
| 2770 |
goto cont |
| 2771 |
end |
| 2772 |
end |
| 2773 |
end |
| 2774 |
local map2 = function(a) |
| 2775 |
return function(a1) |
| 2776 |
local base2, length5, tmp52, tmp53, tmp54 |
| 2777 |
do |
| 2778 |
base2 = a1.base |
| 2779 |
local start = a1.start |
| 2780 |
length5 = a1.length |
| 2781 |
tmp52 = _Int_add(start, length5) |
| 2782 |
tmp54, tmp53 = start, nil |
| 2783 |
end |
| 2784 |
::cont:: |
| 2785 |
do |
| 2786 |
local i, acc = tmp54, tmp53 |
| 2787 |
if i >= tmp52 then |
| 2788 |
else |
| 2789 |
goto else1 |
| 2790 |
end |
| 2791 |
do |
| 2792 |
return tmp50({length5, acc}) |
| 2793 |
end |
| 2794 |
::else1:: |
| 2795 |
local tmp55 = _Int_add(i, 1) |
| 2796 |
local tmp56 = tmp51({base2, i}) |
| 2797 |
local tmp57 = a(tmp56) |
| 2798 |
tmp54 = tmp55 |
| 2799 |
tmp53 = {tmp57, acc} |
| 2800 |
goto cont |
| 2801 |
end |
| 2802 |
end |
| 2803 |
end |
| 2804 |
local foldli3 = function(a) |
| 2805 |
return function(a1) |
| 2806 |
return function(a2) |
| 2807 |
local base2 = a2.base |
| 2808 |
local start = a2.start |
| 2809 |
local length5 = a2.length |
| 2810 |
local tmp52, tmp53 = 0, a1 |
| 2811 |
::cont:: |
| 2812 |
do |
| 2813 |
local i, acc = tmp52, tmp53 |
| 2814 |
if i >= length5 then |
| 2815 |
return acc |
| 2816 |
end |
| 2817 |
local tmp54 = _Int_add(i, 1) |
| 2818 |
local tmp55 = tmp51({base2, _Int_add(start, i)}) |
| 2819 |
local tmp56 = a({i, tmp55, acc}) |
| 2820 |
tmp52 = tmp54 |
| 2821 |
tmp53 = tmp56 |
| 2822 |
goto cont |
| 2823 |
end |
| 2824 |
end |
| 2825 |
end |
| 2826 |
end |
| 2827 |
local foldri3 = function(a) |
| 2828 |
return function(a1) |
| 2829 |
return function(a2) |
| 2830 |
local base2 = a2.base |
| 2831 |
local start = a2.start |
| 2832 |
local tmp52, tmp53 = _Int_sub(a2.length, 1), a1 |
| 2833 |
::cont:: |
| 2834 |
do |
| 2835 |
local i, acc = tmp52, tmp53 |
| 2836 |
if i < 0 then |
| 2837 |
return acc |
| 2838 |
end |
| 2839 |
local tmp54 = _Int_sub(i, 1) |
| 2840 |
local tmp55 = tmp51({base2, _Int_add(start, i)}) |
| 2841 |
local tmp56 = a({i, tmp55, acc}) |
| 2842 |
tmp52 = tmp54 |
| 2843 |
tmp53 = tmp56 |
| 2844 |
goto cont |
| 2845 |
end |
| 2846 |
end |
| 2847 |
end |
| 2848 |
end |
| 2849 |
local foldl4 = function(a) |
| 2850 |
return function(a1) |
| 2851 |
return function(a2) |
| 2852 |
local base2, tmp52, tmp53, tmp54 |
| 2853 |
do |
| 2854 |
base2 = a2.base |
| 2855 |
local start = a2.start |
| 2856 |
tmp52 = _Int_add(start, a2.length) |
| 2857 |
tmp54, tmp53 = start, a1 |
| 2858 |
end |
| 2859 |
::cont:: |
| 2860 |
do |
| 2861 |
local i, acc = tmp54, tmp53 |
| 2862 |
if i >= tmp52 then |
| 2863 |
return acc |
| 2864 |
end |
| 2865 |
local tmp55 = _Int_add(i, 1) |
| 2866 |
local tmp56 = tmp51({base2, i}) |
| 2867 |
local tmp57 = a({tmp56, acc}) |
| 2868 |
tmp54 = tmp55 |
| 2869 |
tmp53 = tmp57 |
| 2870 |
goto cont |
| 2871 |
end |
| 2872 |
end |
| 2873 |
end |
| 2874 |
end |
| 2875 |
local foldr4 = function(a) |
| 2876 |
return function(a1) |
| 2877 |
return function(a2) |
| 2878 |
local base2 = a2.base |
| 2879 |
local start = a2.start |
| 2880 |
local tmp52, tmp53 = _Int_sub(_Int_add(start, a2.length), 1), a1 |
| 2881 |
::cont:: |
| 2882 |
do |
| 2883 |
local i, acc = tmp52, tmp53 |
| 2884 |
if i < start then |
| 2885 |
return acc |
| 2886 |
end |
| 2887 |
local tmp54 = _Int_sub(i, 1) |
| 2888 |
local tmp55 = tmp51({base2, i}) |
| 2889 |
local tmp56 = a({tmp55, acc}) |
| 2890 |
tmp52 = tmp54 |
| 2891 |
tmp53 = tmp56 |
| 2892 |
goto cont |
| 2893 |
end |
| 2894 |
end |
| 2895 |
end |
| 2896 |
end |
| 2897 |
local findi3 = function(a) |
| 2898 |
return function(a1) |
| 2899 |
local base2 = a1.base |
| 2900 |
local start = a1.start |
| 2901 |
local length5 = a1.length |
| 2902 |
local tmp52 = 0 |
| 2903 |
::cont:: |
| 2904 |
do |
| 2905 |
local a2 = tmp52 |
| 2906 |
if a2 >= length5 then |
| 2907 |
return NONE |
| 2908 |
end |
| 2909 |
local x = tmp51({base2, _Int_add(start, a2)}) |
| 2910 |
local tmp53 = a({a2, x}) |
| 2911 |
if tmp53 then |
| 2912 |
return {tag = "SOME", payload = {a2, x}} |
| 2913 |
else |
| 2914 |
tmp52 = _Int_add(a2, 1) |
| 2915 |
goto cont |
| 2916 |
end |
| 2917 |
end |
| 2918 |
end |
| 2919 |
end |
| 2920 |
local find4 = function(a) |
| 2921 |
return function(a1) |
| 2922 |
local base2, tmp52, tmp53 |
| 2923 |
do |
| 2924 |
base2 = a1.base |
| 2925 |
local start = a1.start |
| 2926 |
tmp52 = _Int_add(start, a1.length) |
| 2927 |
tmp53 = start |
| 2928 |
end |
| 2929 |
::cont:: |
| 2930 |
do |
| 2931 |
local a2 = tmp53 |
| 2932 |
if a2 >= tmp52 then |
| 2933 |
return NONE |
| 2934 |
end |
| 2935 |
local x = tmp51({base2, a2}) |
| 2936 |
local tmp54 = a(x) |
| 2937 |
if tmp54 then |
| 2938 |
return {tag = "SOME", payload = x} |
| 2939 |
else |
| 2940 |
tmp53 = _Int_add(a2, 1) |
| 2941 |
goto cont |
| 2942 |
end |
| 2943 |
end |
| 2944 |
end |
| 2945 |
end |
| 2946 |
local exists4 = function(a) |
| 2947 |
return function(a1) |
| 2948 |
local base2, tmp52, tmp53 |
| 2949 |
do |
| 2950 |
base2 = a1.base |
| 2951 |
local start = a1.start |
| 2952 |
tmp52 = _Int_add(start, a1.length) |
| 2953 |
tmp53 = start |
| 2954 |
end |
| 2955 |
::cont:: |
| 2956 |
do |
| 2957 |
local a2 = tmp53 |
| 2958 |
if a2 >= tmp52 then |
| 2959 |
return false |
| 2960 |
end |
| 2961 |
local tmp54 = tmp51({base2, a2}) |
| 2962 |
local tmp55 = a(tmp54) |
| 2963 |
if tmp55 then |
| 2964 |
return true |
| 2965 |
else |
| 2966 |
tmp53 = _Int_add(a2, 1) |
| 2967 |
goto cont |
| 2968 |
end |
| 2969 |
end |
| 2970 |
end |
| 2971 |
end |
| 2972 |
local all4 = function(a) |
| 2973 |
return function(a1) |
| 2974 |
local base2, tmp52, tmp53 |
| 2975 |
do |
| 2976 |
base2 = a1.base |
| 2977 |
local start = a1.start |
| 2978 |
tmp52 = _Int_add(start, a1.length) |
| 2979 |
tmp53 = start |
| 2980 |
end |
| 2981 |
::cont:: |
| 2982 |
do |
| 2983 |
local a2 = tmp53 |
| 2984 |
if a2 >= tmp52 then |
| 2985 |
return true |
| 2986 |
end |
| 2987 |
local tmp54 = tmp51({base2, a2}) |
| 2988 |
local tmp55 = a(tmp54) |
| 2989 |
if tmp55 then |
| 2990 |
tmp53 = _Int_add(a2, 1) |
| 2991 |
goto cont |
| 2992 |
else |
| 2993 |
return false |
| 2994 |
end |
| 2995 |
end |
| 2996 |
end |
| 2997 |
end |
| 2998 |
local collate3 = function(a) |
| 2999 |
return function(a1) |
| 3000 |
local base2, base_PRIME, tmp52, tmp53, tmp54, tmp55 |
| 3001 |
do |
| 3002 |
base2 = a1[1].base |
| 3003 |
local start = a1[1].start |
| 3004 |
local length5 = a1[1].length |
| 3005 |
base_PRIME = a1[2].base |
| 3006 |
local start_PRIME = a1[2].start |
| 3007 |
local length_PRIME = a1[2].length |
| 3008 |
tmp52 = _Int_add(start, length5) |
| 3009 |
tmp53 = _Int_add(start_PRIME, length_PRIME) |
| 3010 |
tmp55, tmp54 = start, start_PRIME |
| 3011 |
end |
| 3012 |
::cont:: |
| 3013 |
do |
| 3014 |
local i, j = tmp55, tmp54 |
| 3015 |
local tmp56 = tmp52 <= i |
| 3016 |
local tmp57 = tmp53 <= j |
| 3017 |
local tmp58 |
| 3018 |
tmp58 = tmp56 and tmp57 |
| 3019 |
if tmp58 then |
| 3020 |
return EQUAL |
| 3021 |
end |
| 3022 |
local tmp59 |
| 3023 |
tmp59 = tmp56 and not tmp57 |
| 3024 |
if tmp59 then |
| 3025 |
return LESS |
| 3026 |
end |
| 3027 |
if not tmp56 and tmp57 then |
| 3028 |
return GREATER |
| 3029 |
end |
| 3030 |
if not tmp56 and not tmp57 then |
| 3031 |
else |
| 3032 |
_raise(_Match, "mono-sequence.sml:454:29") |
| 3033 |
end |
| 3034 |
do |
| 3035 |
local tmp60 = tmp51({base2, i}) |
| 3036 |
local tmp61 = tmp51({base_PRIME, j}) |
| 3037 |
local exp = a({tmp60, tmp61}) |
| 3038 |
if exp == "EQUAL" then |
| 3039 |
tmp55 = _Int_add(i, 1) |
| 3040 |
tmp54 = _Int_add(j, 1) |
| 3041 |
goto cont |
| 3042 |
else |
| 3043 |
return exp |
| 3044 |
end |
| 3045 |
end |
| 3046 |
end |
| 3047 |
end |
| 3048 |
end |
| 3049 |
array1 = function(a) |
| 3050 |
local n = a[1] |
| 3051 |
local init = a[2] |
| 3052 |
if n < 0 or maxLen < n then |
| 3053 |
_raise(_Size, "mono-sequence.sml:470:27") |
| 3054 |
else |
| 3055 |
return tmp43({n, init}) |
| 3056 |
end |
| 3057 |
end |
| 3058 |
tabulate2 = function(a) |
| 3059 |
local n = a[1] |
| 3060 |
local f = a[2] |
| 3061 |
if maxLen < n then |
| 3062 |
_raise(_Size, "mono-sequence.sml:475:27") |
| 3063 |
end |
| 3064 |
local tmp52 = tabulate(n, f) |
| 3065 |
return tmp44({n, tmp52}) |
| 3066 |
end |
| 3067 |
sub3 = function(a) |
| 3068 |
local a1 = a[1] |
| 3069 |
local i = a[2] |
| 3070 |
local tmp52 |
| 3071 |
do |
| 3072 |
if 0 <= i then |
| 3073 |
else |
| 3074 |
tmp52 = false |
| 3075 |
goto cont |
| 3076 |
end |
| 3077 |
do |
| 3078 |
local tmp53 = length1(a1) |
| 3079 |
tmp52 = i < tmp53 |
| 3080 |
end |
| 3081 |
end |
| 3082 |
::cont:: |
| 3083 |
if tmp52 then |
| 3084 |
else |
| 3085 |
_raise(_Subscript, "mono-sequence.sml:482:22") |
| 3086 |
end |
| 3087 |
do |
| 3088 |
return tmp45({a1, i}) |
| 3089 |
end |
| 3090 |
end |
| 3091 |
update2 = function(a) |
| 3092 |
local a1 = a[1] |
| 3093 |
local i = a[2] |
| 3094 |
local x = a[3] |
| 3095 |
local tmp52 |
| 3096 |
do |
| 3097 |
if 0 <= i then |
| 3098 |
else |
| 3099 |
tmp52 = false |
| 3100 |
goto cont |
| 3101 |
end |
| 3102 |
do |
| 3103 |
local tmp53 = length1(a1) |
| 3104 |
tmp52 = i < tmp53 |
| 3105 |
end |
| 3106 |
end |
| 3107 |
::cont:: |
| 3108 |
if tmp52 then |
| 3109 |
else |
| 3110 |
_raise(_Subscript, "mono-sequence.sml:486:28") |
| 3111 |
end |
| 3112 |
do |
| 3113 |
return tmp46({a1, i, x}) |
| 3114 |
end |
| 3115 |
end |
| 3116 |
copy = function(a) |
| 3117 |
local src = a.src |
| 3118 |
local dst = a.dst |
| 3119 |
local di = a.di |
| 3120 |
local srcLen = length1(src) |
| 3121 |
local tmp52 |
| 3122 |
do |
| 3123 |
if 0 <= di then |
| 3124 |
else |
| 3125 |
tmp52 = false |
| 3126 |
goto cont |
| 3127 |
end |
| 3128 |
do |
| 3129 |
local tmp53 = _Int_add(di, srcLen) |
| 3130 |
local tmp54 = length1(dst) |
| 3131 |
tmp52 = tmp53 <= tmp54 |
| 3132 |
end |
| 3133 |
end |
| 3134 |
::cont:: |
| 3135 |
if tmp52 then |
| 3136 |
else |
| 3137 |
_raise(_Subscript, "mono-sequence.sml:499:36") |
| 3138 |
end |
| 3139 |
do |
| 3140 |
local tmp53 = 0 |
| 3141 |
::cont1:: |
| 3142 |
do |
| 3143 |
local a1 = tmp53 |
| 3144 |
if a1 >= srcLen then |
| 3145 |
return nil |
| 3146 |
end |
| 3147 |
local tmp54 = _Int_add(di, a1) |
| 3148 |
local tmp55 = tmp45({src, a1}) |
| 3149 |
tmp46({dst, tmp54, tmp55}) |
| 3150 |
tmp53 = _Int_add(a1, 1) |
| 3151 |
goto cont1 |
| 3152 |
end |
| 3153 |
end |
| 3154 |
end |
| 3155 |
copyVec = function(a) |
| 3156 |
local src = a.src |
| 3157 |
local dst = a.dst |
| 3158 |
local di = a.di |
| 3159 |
local srcLen = length2(src) |
| 3160 |
local tmp52 |
| 3161 |
do |
| 3162 |
if 0 <= di then |
| 3163 |
else |
| 3164 |
tmp52 = false |
| 3165 |
goto cont |
| 3166 |
end |
| 3167 |
do |
| 3168 |
local tmp53 = _Int_add(di, srcLen) |
| 3169 |
local tmp54 = length1(dst) |
| 3170 |
tmp52 = tmp53 <= tmp54 |
| 3171 |
end |
| 3172 |
end |
| 3173 |
::cont:: |
| 3174 |
if tmp52 then |
| 3175 |
else |
| 3176 |
_raise(_Subscript, "mono-sequence.sml:513:39") |
| 3177 |
end |
| 3178 |
do |
| 3179 |
local tmp53 = 0 |
| 3180 |
::cont1:: |
| 3181 |
do |
| 3182 |
local a1 = tmp53 |
| 3183 |
if a1 >= srcLen then |
| 3184 |
return nil |
| 3185 |
end |
| 3186 |
local tmp54 = _Int_add(di, a1) |
| 3187 |
local tmp55 = tmp51({src, a1}) |
| 3188 |
tmp46({dst, tmp54, tmp55}) |
| 3189 |
tmp53 = _Int_add(a1, 1) |
| 3190 |
goto cont1 |
| 3191 |
end |
| 3192 |
end |
| 3193 |
end |
| 3194 |
appi1 = function(a) |
| 3195 |
return function(a1) |
| 3196 |
local n = length1(a1) |
| 3197 |
local tmp52 = 0 |
| 3198 |
::cont:: |
| 3199 |
do |
| 3200 |
local a2 = tmp52 |
| 3201 |
if a2 >= n then |
| 3202 |
return nil |
| 3203 |
end |
| 3204 |
local tmp53 = tmp45({a1, a2}) |
| 3205 |
a({a2, tmp53}) |
| 3206 |
tmp52 = _Int_add(a2, 1) |
| 3207 |
goto cont |
| 3208 |
end |
| 3209 |
end |
| 3210 |
end |
| 3211 |
app3 = function(a) |
| 3212 |
return function(a1) |
| 3213 |
local n = length1(a1) |
| 3214 |
local tmp52 = 0 |
| 3215 |
::cont:: |
| 3216 |
do |
| 3217 |
local a2 = tmp52 |
| 3218 |
if a2 >= n then |
| 3219 |
return nil |
| 3220 |
end |
| 3221 |
local tmp53 = tmp45({a1, a2}) |
| 3222 |
a(tmp53) |
| 3223 |
tmp52 = _Int_add(a2, 1) |
| 3224 |
goto cont |
| 3225 |
end |
| 3226 |
end |
| 3227 |
end |
| 3228 |
modifyi = function(a) |
| 3229 |
return function(a1) |
| 3230 |
local n = length1(a1) |
| 3231 |
local tmp52 = 0 |
| 3232 |
::cont:: |
| 3233 |
do |
| 3234 |
local a2 = tmp52 |
| 3235 |
if a2 >= n then |
| 3236 |
return nil |
| 3237 |
end |
| 3238 |
local x = tmp45({a1, a2}) |
| 3239 |
local y = a({a2, x}) |
| 3240 |
tmp46({a1, a2, y}) |
| 3241 |
tmp52 = _Int_add(a2, 1) |
| 3242 |
goto cont |
| 3243 |
end |
| 3244 |
end |
| 3245 |
end |
| 3246 |
modify = function(a) |
| 3247 |
return function(a1) |
| 3248 |
local n = length1(a1) |
| 3249 |
local tmp52 = 0 |
| 3250 |
::cont:: |
| 3251 |
do |
| 3252 |
local a2 = tmp52 |
| 3253 |
if a2 >= n then |
| 3254 |
return nil |
| 3255 |
end |
| 3256 |
local x = tmp45({a1, a2}) |
| 3257 |
local y = a(x) |
| 3258 |
tmp46({a1, a2, y}) |
| 3259 |
tmp52 = _Int_add(a2, 1) |
| 3260 |
goto cont |
| 3261 |
end |
| 3262 |
end |
| 3263 |
end |
| 3264 |
foldli1 = function(a) |
| 3265 |
return function(a1) |
| 3266 |
return function(a2) |
| 3267 |
local n = length1(a2) |
| 3268 |
local tmp52, tmp53 = 0, a1 |
| 3269 |
::cont:: |
| 3270 |
do |
| 3271 |
local i, acc = tmp52, tmp53 |
| 3272 |
if i >= n then |
| 3273 |
return acc |
| 3274 |
end |
| 3275 |
local tmp54 = _Int_add(i, 1) |
| 3276 |
local tmp55 = tmp45({a2, i}) |
| 3277 |
local tmp56 = a({i, tmp55, acc}) |
| 3278 |
tmp52 = tmp54 |
| 3279 |
tmp53 = tmp56 |
| 3280 |
goto cont |
| 3281 |
end |
| 3282 |
end |
| 3283 |
end |
| 3284 |
end |
| 3285 |
foldri1 = function(a) |
| 3286 |
return function(a1) |
| 3287 |
return function(a2) |
| 3288 |
local tmp52, tmp53 |
| 3289 |
do |
| 3290 |
local tmp54 = length1(a2) |
| 3291 |
tmp53, tmp52 = _Int_sub(tmp54, 1), a1 |
| 3292 |
end |
| 3293 |
::cont:: |
| 3294 |
do |
| 3295 |
local i, acc = tmp53, tmp52 |
| 3296 |
if i < 0 then |
| 3297 |
return acc |
| 3298 |
end |
| 3299 |
local tmp54 = _Int_sub(i, 1) |
| 3300 |
local tmp55 = tmp45({a2, i}) |
| 3301 |
local tmp56 = a({i, tmp55, acc}) |
| 3302 |
tmp53 = tmp54 |
| 3303 |
tmp52 = tmp56 |
| 3304 |
goto cont |
| 3305 |
end |
| 3306 |
end |
| 3307 |
end |
| 3308 |
end |
| 3309 |
foldl2 = function(a) |
| 3310 |
return function(a1) |
| 3311 |
return function(a2) |
| 3312 |
local n = length1(a2) |
| 3313 |
local tmp52, tmp53 = 0, a1 |
| 3314 |
::cont:: |
| 3315 |
do |
| 3316 |
local i, acc = tmp52, tmp53 |
| 3317 |
if i >= n then |
| 3318 |
return acc |
| 3319 |
end |
| 3320 |
local tmp54 = _Int_add(i, 1) |
| 3321 |
local tmp55 = tmp45({a2, i}) |
| 3322 |
local tmp56 = a({tmp55, acc}) |
| 3323 |
tmp52 = tmp54 |
| 3324 |
tmp53 = tmp56 |
| 3325 |
goto cont |
| 3326 |
end |
| 3327 |
end |
| 3328 |
end |
| 3329 |
end |
| 3330 |
foldr2 = function(a) |
| 3331 |
return function(a1) |
| 3332 |
return function(a2) |
| 3333 |
local tmp52, tmp53 |
| 3334 |
do |
| 3335 |
local tmp54 = length1(a2) |
| 3336 |
tmp53, tmp52 = _Int_sub(tmp54, 1), a1 |
| 3337 |
end |
| 3338 |
::cont:: |
| 3339 |
do |
| 3340 |
local i, acc = tmp53, tmp52 |
| 3341 |
if i < 0 then |
| 3342 |
return acc |
| 3343 |
end |
| 3344 |
local tmp54 = _Int_sub(i, 1) |
| 3345 |
local tmp55 = tmp45({a2, i}) |
| 3346 |
local tmp56 = a({tmp55, acc}) |
| 3347 |
tmp53 = tmp54 |
| 3348 |
tmp52 = tmp56 |
| 3349 |
goto cont |
| 3350 |
end |
| 3351 |
end |
| 3352 |
end |
| 3353 |
end |
| 3354 |
findi1 = function(a) |
| 3355 |
return function(a1) |
| 3356 |
local n = length1(a1) |
| 3357 |
local tmp52 = 0 |
| 3358 |
::cont:: |
| 3359 |
do |
| 3360 |
local a2 = tmp52 |
| 3361 |
if a2 >= n then |
| 3362 |
return NONE |
| 3363 |
end |
| 3364 |
local x = tmp45({a1, a2}) |
| 3365 |
local tmp53 = a({a2, x}) |
| 3366 |
if tmp53 then |
| 3367 |
return {tag = "SOME", payload = {a2, x}} |
| 3368 |
else |
| 3369 |
tmp52 = _Int_add(a2, 1) |
| 3370 |
goto cont |
| 3371 |
end |
| 3372 |
end |
| 3373 |
end |
| 3374 |
end |
| 3375 |
find2 = function(a) |
| 3376 |
return function(a1) |
| 3377 |
local n = length1(a1) |
| 3378 |
local tmp52 = 0 |
| 3379 |
::cont:: |
| 3380 |
do |
| 3381 |
local a2 = tmp52 |
| 3382 |
if a2 >= n then |
| 3383 |
return NONE |
| 3384 |
end |
| 3385 |
local x = tmp45({a1, a2}) |
| 3386 |
local tmp53 = a(x) |
| 3387 |
if tmp53 then |
| 3388 |
return {tag = "SOME", payload = x} |
| 3389 |
else |
| 3390 |
tmp52 = _Int_add(a2, 1) |
| 3391 |
goto cont |
| 3392 |
end |
| 3393 |
end |
| 3394 |
end |
| 3395 |
end |
| 3396 |
exists2 = function(a) |
| 3397 |
return function(a1) |
| 3398 |
local n = length1(a1) |
| 3399 |
local tmp52 = 0 |
| 3400 |
::cont:: |
| 3401 |
do |
| 3402 |
local a2 = tmp52 |
| 3403 |
if a2 >= n then |
| 3404 |
return false |
| 3405 |
end |
| 3406 |
local tmp53 = tmp45({a1, a2}) |
| 3407 |
local tmp54 = a(tmp53) |
| 3408 |
if tmp54 then |
| 3409 |
return true |
| 3410 |
else |
| 3411 |
tmp52 = _Int_add(a2, 1) |
| 3412 |
goto cont |
| 3413 |
end |
| 3414 |
end |
| 3415 |
end |
| 3416 |
end |
| 3417 |
all2 = function(a) |
| 3418 |
return function(a1) |
| 3419 |
local n = length1(a1) |
| 3420 |
local tmp52 = 0 |
| 3421 |
::cont:: |
| 3422 |
do |
| 3423 |
local a2 = tmp52 |
| 3424 |
if a2 >= n then |
| 3425 |
return true |
| 3426 |
end |
| 3427 |
local tmp53 = tmp45({a1, a2}) |
| 3428 |
local tmp54 = a(tmp53) |
| 3429 |
if tmp54 then |
| 3430 |
tmp52 = _Int_add(a2, 1) |
| 3431 |
goto cont |
| 3432 |
else |
| 3433 |
return false |
| 3434 |
end |
| 3435 |
end |
| 3436 |
end |
| 3437 |
end |
| 3438 |
collate1 = function(a) |
| 3439 |
return function(a1) |
| 3440 |
local xs = a1[1] |
| 3441 |
local ys = a1[2] |
| 3442 |
local xl = length1(xs) |
| 3443 |
local yl = length1(ys) |
| 3444 |
local tmp52 = 0 |
| 3445 |
::cont:: |
| 3446 |
do |
| 3447 |
local a2 = tmp52 |
| 3448 |
local tmp53 = xl <= a2 |
| 3449 |
local tmp54 = yl <= a2 |
| 3450 |
local tmp55 |
| 3451 |
tmp55 = tmp53 and tmp54 |
| 3452 |
if tmp55 then |
| 3453 |
return EQUAL |
| 3454 |
end |
| 3455 |
local tmp56 |
| 3456 |
tmp56 = tmp53 and not tmp54 |
| 3457 |
if tmp56 then |
| 3458 |
return LESS |
| 3459 |
end |
| 3460 |
if not tmp53 and tmp54 then |
| 3461 |
return GREATER |
| 3462 |
end |
| 3463 |
if not tmp53 and not tmp54 then |
| 3464 |
else |
| 3465 |
_raise(_Match, "mono-sequence.sml:621:49") |
| 3466 |
end |
| 3467 |
do |
| 3468 |
local tmp57 = tmp45({xs, a2}) |
| 3469 |
local tmp58 = tmp45({ys, a2}) |
| 3470 |
local exp = a({tmp57, tmp58}) |
| 3471 |
if exp == "EQUAL" then |
| 3472 |
tmp52 = _Int_add(a2, 1) |
| 3473 |
goto cont |
| 3474 |
else |
| 3475 |
return exp |
| 3476 |
end |
| 3477 |
end |
| 3478 |
end |
| 3479 |
end |
| 3480 |
end |
| 3481 |
toList1 = function(a) |
| 3482 |
local tmp52 = foldr2(_COLON_COLON) |
| 3483 |
local tmp53 = tmp52(nil) |
| 3484 |
return tmp53(a) |
| 3485 |
end |
| 3486 |
vector1 = function(a) |
| 3487 |
local tmp52 = length1(a) |
| 3488 |
local tmp53 |
| 3489 |
do |
| 3490 |
local tmp54 = foldr2(_COLON_COLON) |
| 3491 |
local tmp55 = tmp54(nil) |
| 3492 |
tmp53 = tmp55(a) |
| 3493 |
end |
| 3494 |
return tmp49({tmp52, tmp53}) |
| 3495 |
end |
| 3496 |
fromVector = function(a) |
| 3497 |
local tmp52 = length2(a) |
| 3498 |
local tmp53 |
| 3499 |
do |
| 3500 |
local tmp54 = foldr1(_COLON_COLON) |
| 3501 |
local tmp55 = tmp54(nil) |
| 3502 |
tmp53 = tmp55(a) |
| 3503 |
end |
| 3504 |
return tmp44({tmp52, tmp53}) |
| 3505 |
end |
| 3506 |
length3 = function(tmp52) |
| 3507 |
return tmp52.length |
| 3508 |
end |
| 3509 |
sub4 = function(a) |
| 3510 |
local base2 = a[1].base |
| 3511 |
local start = a[1].start |
| 3512 |
local length5 = a[1].length |
| 3513 |
local i = a[2] |
| 3514 |
if 0 <= i and i < length5 then |
| 3515 |
else |
| 3516 |
_raise(_Subscript, "mono-sequence.sml:645:44") |
| 3517 |
end |
| 3518 |
do |
| 3519 |
return tmp45({base2, _Int_add(start, i)}) |
| 3520 |
end |
| 3521 |
end |
| 3522 |
update3 = function(a) |
| 3523 |
local base2 = a[1].base |
| 3524 |
local start = a[1].start |
| 3525 |
local length5 = a[1].length |
| 3526 |
local i = a[2] |
| 3527 |
local x = a[3] |
| 3528 |
if 0 <= i and i < length5 then |
| 3529 |
else |
| 3530 |
_raise(_Subscript, "mono-sequence.sml:649:50") |
| 3531 |
end |
| 3532 |
do |
| 3533 |
return tmp46({base2, _Int_add(start, i), x}) |
| 3534 |
end |
| 3535 |
end |
| 3536 |
full1 = function(a) |
| 3537 |
local tmp52 = length1(a) |
| 3538 |
return {base = a, length = tmp52, start = 0} |
| 3539 |
end |
| 3540 |
slice = function(a) |
| 3541 |
if a[3].tag == "NONE" then |
| 3542 |
else |
| 3543 |
goto else1 |
| 3544 |
end |
| 3545 |
do |
| 3546 |
local v = a[1] |
| 3547 |
local i = a[2] |
| 3548 |
local n = length1(v) |
| 3549 |
if 0 <= i and i <= n then |
| 3550 |
return {base = v, length = _Int_sub(n, i), start = i} |
| 3551 |
else |
| 3552 |
_raise(_Subscript, "mono-sequence.sml:655:33") |
| 3553 |
end |
| 3554 |
end |
| 3555 |
::else1:: |
| 3556 |
if a[3].tag == "SOME" then |
| 3557 |
else |
| 3558 |
_raise(_Match, "mono-sequence.sml:651:5") |
| 3559 |
end |
| 3560 |
do |
| 3561 |
local v = a[1] |
| 3562 |
local i = a[2] |
| 3563 |
local n = a[3].payload |
| 3564 |
local tmp52 |
| 3565 |
do |
| 3566 |
if 0 <= i then |
| 3567 |
else |
| 3568 |
tmp52 = false |
| 3569 |
goto cont |
| 3570 |
end |
| 3571 |
do |
| 3572 |
if 0 <= n then |
| 3573 |
else |
| 3574 |
tmp52 = false |
| 3575 |
goto cont |
| 3576 |
end |
| 3577 |
do |
| 3578 |
local tmp53 = _Int_add(i, n) |
| 3579 |
local tmp54 = length1(v) |
| 3580 |
tmp52 = tmp53 <= tmp54 |
| 3581 |
end |
| 3582 |
end |
| 3583 |
end |
| 3584 |
::cont:: |
| 3585 |
if tmp52 then |
| 3586 |
return {base = v, length = n, start = i} |
| 3587 |
else |
| 3588 |
_raise(_Subscript, "mono-sequence.sml:660:32") |
| 3589 |
end |
| 3590 |
end |
| 3591 |
end |
| 3592 |
subslice = function(a) |
| 3593 |
if a[3].tag == "NONE" then |
| 3594 |
local base2 = a[1].base |
| 3595 |
local start = a[1].start |
| 3596 |
local length5 = a[1].length |
| 3597 |
local i = a[2] |
| 3598 |
if 0 <= i and i <= length5 then |
| 3599 |
local tmp52 = _Int_add(start, i) |
| 3600 |
return {base = base2, length = _Int_sub(length5, i), start = tmp52} |
| 3601 |
else |
| 3602 |
_raise(_Subscript, "mono-sequence.sml:664:55") |
| 3603 |
end |
| 3604 |
end |
| 3605 |
if a[3].tag == "SOME" then |
| 3606 |
local base2 = a[1].base |
| 3607 |
local start = a[1].start |
| 3608 |
local length5 = a[1].length |
| 3609 |
local i = a[2] |
| 3610 |
local n = a[3].payload |
| 3611 |
if 0 <= i and (0 <= n and _Int_add(i, n) <= length5) then |
| 3612 |
return {base = base2, length = n, start = _Int_add(start, i)} |
| 3613 |
else |
| 3614 |
_raise(_Subscript, "mono-sequence.sml:668:57") |
| 3615 |
end |
| 3616 |
else |
| 3617 |
_raise(_Match, "mono-sequence.sml:661:5") |
| 3618 |
end |
| 3619 |
end |
| 3620 |
base = function(a) |
| 3621 |
local b = a.base |
| 3622 |
local start = a.start |
| 3623 |
return {b, start, a.length} |
| 3624 |
end |
| 3625 |
copy1 = function(a) |
| 3626 |
local base2 = a.src.base |
| 3627 |
local start = a.src.start |
| 3628 |
local length5 = a.src.length |
| 3629 |
local dst = a.dst |
| 3630 |
local di = a.di |
| 3631 |
local tmp52 |
| 3632 |
do |
| 3633 |
if di < 0 then |
| 3634 |
tmp52 = true |
| 3635 |
goto cont |
| 3636 |
end |
| 3637 |
local tmp53 = length1(dst) |
| 3638 |
tmp52 = tmp53 < _Int_add(di, length5) |
| 3639 |
end |
| 3640 |
::cont:: |
| 3641 |
if tmp52 then |
| 3642 |
_raise(_Subscript, "mono-sequence.sml:684:14") |
| 3643 |
end |
| 3644 |
if start >= di then |
| 3645 |
else |
| 3646 |
goto else1 |
| 3647 |
end |
| 3648 |
do |
| 3649 |
local tmp53 = 0 |
| 3650 |
::cont2:: |
| 3651 |
do |
| 3652 |
local a1 = tmp53 |
| 3653 |
if a1 >= length5 then |
| 3654 |
return nil |
| 3655 |
end |
| 3656 |
local tmp54 = _Int_add(di, a1) |
| 3657 |
local tmp55 = tmp45({base2, _Int_add(start, a1)}) |
| 3658 |
tmp46({dst, tmp54, tmp55}) |
| 3659 |
tmp53 = _Int_add(a1, 1) |
| 3660 |
goto cont2 |
| 3661 |
end |
| 3662 |
end |
| 3663 |
::else1:: |
| 3664 |
local tmp53 = _Int_sub(length5, 1) |
| 3665 |
::cont1:: |
| 3666 |
do |
| 3667 |
local a1 = tmp53 |
| 3668 |
if a1 < 0 then |
| 3669 |
return nil |
| 3670 |
end |
| 3671 |
local tmp54 = _Int_add(di, a1) |
| 3672 |
local tmp55 = tmp45({base2, _Int_add(start, a1)}) |
| 3673 |
tmp46({dst, tmp54, tmp55}) |
| 3674 |
tmp53 = _Int_sub(a1, 1) |
| 3675 |
goto cont1 |
| 3676 |
end |
| 3677 |
end |
| 3678 |
copyVec1 = function(a) |
| 3679 |
local base2, start, length5, dst, di, tmp52 |
| 3680 |
do |
| 3681 |
base2 = a.src.base |
| 3682 |
start = a.src.start |
| 3683 |
length5 = a.src.length |
| 3684 |
dst = a.dst |
| 3685 |
di = a.di |
| 3686 |
if di < 0 then |
| 3687 |
_raise(_Subscript, "mono-sequence.sml:699:14") |
| 3688 |
end |
| 3689 |
local tmp53 = length1(dst) |
| 3690 |
if tmp53 < _Int_add(di, length5) then |
| 3691 |
_raise(_Subscript, "mono-sequence.sml:699:14") |
| 3692 |
end |
| 3693 |
tmp52 = 0 |
| 3694 |
end |
| 3695 |
::cont:: |
| 3696 |
do |
| 3697 |
local a1 = tmp52 |
| 3698 |
if a1 >= length5 then |
| 3699 |
return nil |
| 3700 |
end |
| 3701 |
local tmp53 = _Int_add(di, a1) |
| 3702 |
local tmp54 = tmp51({base2, _Int_add(start, a1)}) |
| 3703 |
tmp46({dst, tmp53, tmp54}) |
| 3704 |
tmp52 = _Int_add(a1, 1) |
| 3705 |
goto cont |
| 3706 |
end |
| 3707 |
end |
| 3708 |
isEmpty1 = function(a) |
| 3709 |
return a.length == 0 |
| 3710 |
end |
| 3711 |
getItem = function(a) |
| 3712 |
local base2 = a.base |
| 3713 |
local start = a.start |
| 3714 |
local length5 = a.length |
| 3715 |
if length5 > 0 then |
| 3716 |
else |
| 3717 |
return NONE |
| 3718 |
end |
| 3719 |
do |
| 3720 |
local tmp52 = tmp45({base2, start}) |
| 3721 |
local tmp53 = _Int_add(start, 1) |
| 3722 |
return {tag = "SOME", payload = {tmp52, {base = base2, length = _Int_sub(length5, 1), start = tmp53}}} |
| 3723 |
end |
| 3724 |
end |
| 3725 |
appi2 = function(a) |
| 3726 |
return function(a1) |
| 3727 |
local base2 = a1.base |
| 3728 |
local start = a1.start |
| 3729 |
local length5 = a1.length |
| 3730 |
local tmp52 = 0 |
| 3731 |
::cont:: |
| 3732 |
do |
| 3733 |
local a2 = tmp52 |
| 3734 |
if a2 >= length5 then |
| 3735 |
return nil |
| 3736 |
end |
| 3737 |
local tmp53 = tmp45({base2, _Int_add(start, a2)}) |
| 3738 |
a({a2, tmp53}) |
| 3739 |
tmp52 = _Int_add(a2, 1) |
| 3740 |
goto cont |
| 3741 |
end |
| 3742 |
end |
| 3743 |
end |
| 3744 |
app4 = function(a) |
| 3745 |
return function(a1) |
| 3746 |
local base2, tmp52, tmp53 |
| 3747 |
do |
| 3748 |
base2 = a1.base |
| 3749 |
local start = a1.start |
| 3750 |
tmp52 = _Int_add(start, a1.length) |
| 3751 |
tmp53 = start |
| 3752 |
end |
| 3753 |
::cont:: |
| 3754 |
do |
| 3755 |
local a2 = tmp53 |
| 3756 |
if a2 >= tmp52 then |
| 3757 |
return nil |
| 3758 |
end |
| 3759 |
local tmp54 = tmp45({base2, a2}) |
| 3760 |
a(tmp54) |
| 3761 |
tmp53 = _Int_add(a2, 1) |
| 3762 |
goto cont |
| 3763 |
end |
| 3764 |
end |
| 3765 |
end |
| 3766 |
modifyi1 = function(a) |
| 3767 |
return function(a1) |
| 3768 |
local base2 = a1.base |
| 3769 |
local start = a1.start |
| 3770 |
local length5 = a1.length |
| 3771 |
local tmp52 = 0 |
| 3772 |
::cont:: |
| 3773 |
do |
| 3774 |
local a2 = tmp52 |
| 3775 |
if a2 >= length5 then |
| 3776 |
return nil |
| 3777 |
end |
| 3778 |
local tmp53 = _Int_add(start, a2) |
| 3779 |
local x = tmp45({base2, tmp53}) |
| 3780 |
local y = a({a2, x}) |
| 3781 |
tmp46({base2, tmp53, y}) |
| 3782 |
tmp52 = _Int_add(a2, 1) |
| 3783 |
goto cont |
| 3784 |
end |
| 3785 |
end |
| 3786 |
end |
| 3787 |
modify1 = function(a) |
| 3788 |
return function(a1) |
| 3789 |
local base2, tmp52, tmp53 |
| 3790 |
do |
| 3791 |
base2 = a1.base |
| 3792 |
local start = a1.start |
| 3793 |
tmp52 = _Int_add(start, a1.length) |
| 3794 |
tmp53 = start |
| 3795 |
end |
| 3796 |
::cont:: |
| 3797 |
do |
| 3798 |
local a2 = tmp53 |
| 3799 |
if a2 >= tmp52 then |
| 3800 |
return nil |
| 3801 |
end |
| 3802 |
local x = tmp45({base2, a2}) |
| 3803 |
local y = a(x) |
| 3804 |
tmp46({base2, a2, y}) |
| 3805 |
tmp53 = _Int_add(a2, 1) |
| 3806 |
goto cont |
| 3807 |
end |
| 3808 |
end |
| 3809 |
end |
| 3810 |
foldli2 = function(a) |
| 3811 |
return function(a1) |
| 3812 |
return function(a2) |
| 3813 |
local base2 = a2.base |
| 3814 |
local start = a2.start |
| 3815 |
local length5 = a2.length |
| 3816 |
local tmp52, tmp53 = 0, a1 |
| 3817 |
::cont:: |
| 3818 |
do |
| 3819 |
local i, acc = tmp52, tmp53 |
| 3820 |
if i >= length5 then |
| 3821 |
return acc |
| 3822 |
end |
| 3823 |
local tmp54 = _Int_add(i, 1) |
| 3824 |
local tmp55 = tmp45({base2, _Int_add(start, i)}) |
| 3825 |
local tmp56 = a({i, tmp55, acc}) |
| 3826 |
tmp52 = tmp54 |
| 3827 |
tmp53 = tmp56 |
| 3828 |
goto cont |
| 3829 |
end |
| 3830 |
end |
| 3831 |
end |
| 3832 |
end |
| 3833 |
foldri2 = function(a) |
| 3834 |
return function(a1) |
| 3835 |
return function(a2) |
| 3836 |
local base2 = a2.base |
| 3837 |
local start = a2.start |
| 3838 |
local tmp52, tmp53 = _Int_sub(a2.length, 1), a1 |
| 3839 |
::cont:: |
| 3840 |
do |
| 3841 |
local i, acc = tmp52, tmp53 |
| 3842 |
if i < 0 then |
| 3843 |
return acc |
| 3844 |
end |
| 3845 |
local tmp54 = _Int_sub(i, 1) |
| 3846 |
local tmp55 = tmp45({base2, _Int_add(start, i)}) |
| 3847 |
local tmp56 = a({i, tmp55, acc}) |
| 3848 |
tmp52 = tmp54 |
| 3849 |
tmp53 = tmp56 |
| 3850 |
goto cont |
| 3851 |
end |
| 3852 |
end |
| 3853 |
end |
| 3854 |
end |
| 3855 |
foldl3 = function(a) |
| 3856 |
return function(a1) |
| 3857 |
return function(a2) |
| 3858 |
local base2, tmp52, tmp53, tmp54 |
| 3859 |
do |
| 3860 |
base2 = a2.base |
| 3861 |
local start = a2.start |
| 3862 |
tmp52 = _Int_add(start, a2.length) |
| 3863 |
tmp54, tmp53 = start, a1 |
| 3864 |
end |
| 3865 |
::cont:: |
| 3866 |
do |
| 3867 |
local i, acc = tmp54, tmp53 |
| 3868 |
if i >= tmp52 then |
| 3869 |
return acc |
| 3870 |
end |
| 3871 |
local tmp55 = _Int_add(i, 1) |
| 3872 |
local tmp56 = tmp45({base2, i}) |
| 3873 |
local tmp57 = a({tmp56, acc}) |
| 3874 |
tmp54 = tmp55 |
| 3875 |
tmp53 = tmp57 |
| 3876 |
goto cont |
| 3877 |
end |
| 3878 |
end |
| 3879 |
end |
| 3880 |
end |
| 3881 |
foldr3 = function(a) |
| 3882 |
return function(a1) |
| 3883 |
return function(a2) |
| 3884 |
local base2 = a2.base |
| 3885 |
local start = a2.start |
| 3886 |
local tmp52, tmp53 = _Int_sub(_Int_add(start, a2.length), 1), a1 |
| 3887 |
::cont:: |
| 3888 |
do |
| 3889 |
local i, acc = tmp52, tmp53 |
| 3890 |
if i < start then |
| 3891 |
return acc |
| 3892 |
end |
| 3893 |
local tmp54 = _Int_sub(i, 1) |
| 3894 |
local tmp55 = tmp45({base2, i}) |
| 3895 |
local tmp56 = a({tmp55, acc}) |
| 3896 |
tmp52 = tmp54 |
| 3897 |
tmp53 = tmp56 |
| 3898 |
goto cont |
| 3899 |
end |
| 3900 |
end |
| 3901 |
end |
| 3902 |
end |
| 3903 |
findi2 = function(a) |
| 3904 |
return function(a1) |
| 3905 |
local base2 = a1.base |
| 3906 |
local start = a1.start |
| 3907 |
local length5 = a1.length |
| 3908 |
local tmp52 = 0 |
| 3909 |
::cont:: |
| 3910 |
do |
| 3911 |
local a2 = tmp52 |
| 3912 |
if a2 >= length5 then |
| 3913 |
return NONE |
| 3914 |
end |
| 3915 |
local x = tmp45({base2, _Int_add(start, a2)}) |
| 3916 |
local tmp53 = a({a2, x}) |
| 3917 |
if tmp53 then |
| 3918 |
return {tag = "SOME", payload = {a2, x}} |
| 3919 |
else |
| 3920 |
tmp52 = _Int_add(a2, 1) |
| 3921 |
goto cont |
| 3922 |
end |
| 3923 |
end |
| 3924 |
end |
| 3925 |
end |
| 3926 |
find3 = function(a) |
| 3927 |
return function(a1) |
| 3928 |
local base2, tmp52, tmp53 |
| 3929 |
do |
| 3930 |
base2 = a1.base |
| 3931 |
local start = a1.start |
| 3932 |
tmp52 = _Int_add(start, a1.length) |
| 3933 |
tmp53 = start |
| 3934 |
end |
| 3935 |
::cont:: |
| 3936 |
do |
| 3937 |
local a2 = tmp53 |
| 3938 |
if a2 >= tmp52 then |
| 3939 |
return NONE |
| 3940 |
end |
| 3941 |
local x = tmp45({base2, a2}) |
| 3942 |
local tmp54 = a(x) |
| 3943 |
if tmp54 then |
| 3944 |
return {tag = "SOME", payload = x} |
| 3945 |
else |
| 3946 |
tmp53 = _Int_add(a2, 1) |
| 3947 |
goto cont |
| 3948 |
end |
| 3949 |
end |
| 3950 |
end |
| 3951 |
end |
| 3952 |
exists3 = function(a) |
| 3953 |
return function(a1) |
| 3954 |
local base2, tmp52, tmp53 |
| 3955 |
do |
| 3956 |
base2 = a1.base |
| 3957 |
local start = a1.start |
| 3958 |
tmp52 = _Int_add(start, a1.length) |
| 3959 |
tmp53 = start |
| 3960 |
end |
| 3961 |
::cont:: |
| 3962 |
do |
| 3963 |
local a2 = tmp53 |
| 3964 |
if a2 >= tmp52 then |
| 3965 |
return false |
| 3966 |
end |
| 3967 |
local tmp54 = tmp45({base2, a2}) |
| 3968 |
local tmp55 = a(tmp54) |
| 3969 |
if tmp55 then |
| 3970 |
return true |
| 3971 |
else |
| 3972 |
tmp53 = _Int_add(a2, 1) |
| 3973 |
goto cont |
| 3974 |
end |
| 3975 |
end |
| 3976 |
end |
| 3977 |
end |
| 3978 |
all3 = function(a) |
| 3979 |
return function(a1) |
| 3980 |
local base2, tmp52, tmp53 |
| 3981 |
do |
| 3982 |
base2 = a1.base |
| 3983 |
local start = a1.start |
| 3984 |
tmp52 = _Int_add(start, a1.length) |
| 3985 |
tmp53 = start |
| 3986 |
end |
| 3987 |
::cont:: |
| 3988 |
do |
| 3989 |
local a2 = tmp53 |
| 3990 |
if a2 >= tmp52 then |
| 3991 |
return true |
| 3992 |
end |
| 3993 |
local tmp54 = tmp45({base2, a2}) |
| 3994 |
local tmp55 = a(tmp54) |
| 3995 |
if tmp55 then |
| 3996 |
tmp53 = _Int_add(a2, 1) |
| 3997 |
goto cont |
| 3998 |
else |
| 3999 |
return false |
| 4000 |
end |
| 4001 |
end |
| 4002 |
end |
| 4003 |
end |
| 4004 |
collate2 = function(a) |
| 4005 |
return function(a1) |
| 4006 |
local base2, base_PRIME, tmp52, tmp53, tmp54, tmp55 |
| 4007 |
do |
| 4008 |
base2 = a1[1].base |
| 4009 |
local start = a1[1].start |
| 4010 |
local length5 = a1[1].length |
| 4011 |
base_PRIME = a1[2].base |
| 4012 |
local start_PRIME = a1[2].start |
| 4013 |
local length_PRIME = a1[2].length |
| 4014 |
tmp52 = _Int_add(start, length5) |
| 4015 |
tmp53 = _Int_add(start_PRIME, length_PRIME) |
| 4016 |
tmp55, tmp54 = start, start_PRIME |
| 4017 |
end |
| 4018 |
::cont:: |
| 4019 |
do |
| 4020 |
local i, j = tmp55, tmp54 |
| 4021 |
local tmp56 = tmp52 <= i |
| 4022 |
local tmp57 = tmp53 <= j |
| 4023 |
local tmp58 |
| 4024 |
tmp58 = tmp56 and tmp57 |
| 4025 |
if tmp58 then |
| 4026 |
return EQUAL |
| 4027 |
end |
| 4028 |
local tmp59 |
| 4029 |
tmp59 = tmp56 and not tmp57 |
| 4030 |
if tmp59 then |
| 4031 |
return LESS |
| 4032 |
end |
| 4033 |
if not tmp56 and tmp57 then |
| 4034 |
return GREATER |
| 4035 |
end |
| 4036 |
if not tmp56 and not tmp57 then |
| 4037 |
else |
| 4038 |
_raise(_Match, "mono-sequence.sml:812:29") |
| 4039 |
end |
| 4040 |
do |
| 4041 |
local tmp60 = tmp45({base2, i}) |
| 4042 |
local tmp61 = tmp45({base_PRIME, j}) |
| 4043 |
local exp = a({tmp60, tmp61}) |
| 4044 |
if exp == "EQUAL" then |
| 4045 |
tmp55 = _Int_add(i, 1) |
| 4046 |
tmp54 = _Int_add(j, 1) |
| 4047 |
goto cont |
| 4048 |
else |
| 4049 |
return exp |
| 4050 |
end |
| 4051 |
end |
| 4052 |
end |
| 4053 |
end |
| 4054 |
end |
| 4055 |
vector2 = function(a) |
| 4056 |
local tmp52 = a.length |
| 4057 |
local tmp53 = foldr3(_COLON_COLON) |
| 4058 |
local tmp54 = tmp53(nil) |
| 4059 |
local tmp55 = tmp54(a) |
| 4060 |
return tmp49({tmp52, tmp55}) |
| 4061 |
end |
| 4062 |
UnsafeMonoVector = {sub = tmp51} |
| 4063 |
UnsafeMonoArray = {create = create, sub = tmp45, update = tmp46} |
| 4064 |
MonoVectorSlice = {all = all4, app = app5, appi = appi3, base = base1, collate = collate3, concat = concat2, exists = exists4, find = find4, findi = findi3, foldl = foldl4, foldli = foldli3, foldr = foldr4, foldri = foldri3, full = full2, getItem = getItem1, isEmpty = isEmpty2, length = length4, map = map2, mapi = mapi1, slice = slice1, sub = sub5, subslice = subslice1, vector = vector} |
| 4065 |
end |
| 4066 |
local MonoVector = {all = all1, app = app2, append = append, appi = appi, collate = collate, concat = tmp47, exists = exists1, find = find1, findi = findi, foldl = foldl1, foldli = foldli, foldr = foldr1, foldri = foldri, fromList = fromList1, length = length2, map = map1, mapi = mapi, maxLen = maxLen1, prepend = prepend, sub = sub2, tabulate = tabulate1, toList = toList, update = update1} |
| 4067 |
local MonoArraySlice = {all = all3, app = app4, appi = appi2, base = base, collate = collate2, copy = copy1, copyVec = copyVec1, exists = exists3, find = find3, findi = findi2, foldl = foldl3, foldli = foldli2, foldr = foldr3, foldri = foldri2, full = full1, getItem = getItem, isEmpty = isEmpty1, length = length3, modify = modify1, modifyi = modifyi1, slice = slice, sub = sub4, subslice = subslice, update = update3, vector = vector2} |
| 4068 |
return {_MonoArray = {all = all2, app = app3, appi = appi1, array = array1, collate = collate1, copy = copy, copyVec = copyVec, exists = exists2, find = find2, findi = findi1, foldl = foldl2, foldli = foldli1, foldr = foldr2, foldri = foldri1, fromList = fromList, fromVector = fromVector, length = length1, maxLen = maxLen, modify = modify, modifyi = modifyi, sub = sub3, tabulate = tabulate2, toList = toList1, toVector = vector1, update = update2, vector = vector1}, _MonoArraySlice = MonoArraySlice, _MonoVector = MonoVector, _MonoVectorSlice = MonoVectorSlice, _UnsafeMonoArray = UnsafeMonoArray, _UnsafeMonoVector = UnsafeMonoVector} |
| 4069 |
end |
| 4070 |
local unsafeFromListN = function(a) |
| 4071 |
return implode(a[2]) |
| 4072 |
end |
| 4073 |
local unsafeFromListRevN = function(a) |
| 4074 |
return implodeRev(a[2]) |
| 4075 |
end |
| 4076 |
local sliceToVector = function(a) |
| 4077 |
local base = a.base |
| 4078 |
local start = a.start |
| 4079 |
return substring(base, start, a.length) |
| 4080 |
end |
| 4081 |
local unsafeCreateWithZero = function(a) |
| 4082 |
return _Array_array(a, 0) |
| 4083 |
end |
| 4084 |
local Base = MonoSequence(_VectorOrArray_fromList, length, math_maxinteger, array, unsafeCreateWithZero, function(a) |
| 4085 |
return _VectorOrArray_fromList(a[2]) |
| 4086 |
end, sub, update, concat, implode, size, math_maxinteger, sliceToVector, sliceToVector, unsafeFromListN, unsafeFromListRevN, sub1) |
| 4087 |
local CharVector = Base._MonoVector |
| 4088 |
local CharVectorSlice = Base._MonoVectorSlice |
| 4089 |
CharArray = Base._MonoArray |
| 4090 |
local CharArraySlice = Base._MonoArraySlice |
| 4091 |
local UnsafeCharVector = Base._UnsafeMonoVector |
| 4092 |
local sub2 = CharVectorSlice.sub |
| 4093 |
extract1 = CharVectorSlice.slice |
| 4094 |
full = CharVectorSlice.full |
| 4095 |
string1 = CharVectorSlice.vector |
| 4096 |
isEmpty = CharVectorSlice.isEmpty |
| 4097 |
getc = CharVectorSlice.getItem |
| 4098 |
concat1 = CharVectorSlice.concat |
| 4099 |
splitl = function(a) |
| 4100 |
return function(a1) |
| 4101 |
local base = a1.base |
| 4102 |
local start = a1.start |
| 4103 |
local length1 = a1.length |
| 4104 |
local tmp43 = 0 |
| 4105 |
::cont:: |
| 4106 |
do |
| 4107 |
local a2 = tmp43 |
| 4108 |
if a2 >= length1 then |
| 4109 |
return {a1, {base = base, length = 0, start = _Int_add(start, a2)}} |
| 4110 |
end |
| 4111 |
local tmp44 = sub2({a1, a2}) |
| 4112 |
local tmp45 = a(tmp44) |
| 4113 |
if tmp45 then |
| 4114 |
tmp43 = _Int_add(a2, 1) |
| 4115 |
goto cont |
| 4116 |
else |
| 4117 |
local tmp46 = {base = base, length = a2, start = start} |
| 4118 |
return {tmp46, {base = base, length = _Int_sub(length1, a2), start = _Int_add(start, a2)}} |
| 4119 |
end |
| 4120 |
end |
| 4121 |
end |
| 4122 |
end |
| 4123 |
splitr = function(a, a1) |
| 4124 |
local base = a1.base |
| 4125 |
local start = a1.start |
| 4126 |
local length1 = a1.length |
| 4127 |
local tmp43 = _Int_sub(length1, 1) |
| 4128 |
::cont:: |
| 4129 |
do |
| 4130 |
local a2 = tmp43 |
| 4131 |
if a2 < 0 then |
| 4132 |
return {{base = base, length = 0, start = start}, a1} |
| 4133 |
end |
| 4134 |
local tmp44 = sub2({a1, a2}) |
| 4135 |
local tmp45 = a(tmp44) |
| 4136 |
if tmp45 then |
| 4137 |
tmp43 = _Int_sub(a2, 1) |
| 4138 |
goto cont |
| 4139 |
else |
| 4140 |
local tmp46 = _Int_add(a2, 1) |
| 4141 |
local tmp47 = {base = base, length = tmp46, start = start} |
| 4142 |
local tmp48 = _Int_add(start, tmp46) |
| 4143 |
return {tmp47, {base = base, length = _Int_sub(length1, tmp46), start = tmp48}} |
| 4144 |
end |
| 4145 |
end |
| 4146 |
end |
| 4147 |
tokens = function(a) |
| 4148 |
return function(a1) |
| 4149 |
local base, tmp43, tmp44, tmp45, tmp46 |
| 4150 |
do |
| 4151 |
base = a1.base |
| 4152 |
local start = a1.start |
| 4153 |
tmp43 = _Int_add(start, a1.length) |
| 4154 |
tmp46, tmp45, tmp44 = nil, start, start |
| 4155 |
end |
| 4156 |
::cont:: |
| 4157 |
do |
| 4158 |
local revTokens, s, i = tmp46, tmp45, tmp44 |
| 4159 |
if i >= tmp43 then |
| 4160 |
else |
| 4161 |
goto else1 |
| 4162 |
end |
| 4163 |
do |
| 4164 |
if s == i then |
| 4165 |
else |
| 4166 |
return revAppend({{base = base, length = _Int_sub(i, s), start = s}, revTokens}, nil) |
| 4167 |
end |
| 4168 |
do |
| 4169 |
return revAppend(revTokens, nil) |
| 4170 |
end |
| 4171 |
end |
| 4172 |
::else1:: |
| 4173 |
local tmp47 = sub1({base, i}) |
| 4174 |
local tmp48 = a(tmp47) |
| 4175 |
if tmp48 then |
| 4176 |
local tmp49 = _Int_add(i, 1) |
| 4177 |
if s == i then |
| 4178 |
tmp46 = revTokens |
| 4179 |
tmp45 = tmp49 |
| 4180 |
tmp44 = tmp49 |
| 4181 |
goto cont |
| 4182 |
else |
| 4183 |
tmp46 = {{base = base, length = _Int_sub(i, s), start = s}, revTokens} |
| 4184 |
tmp45 = tmp49 |
| 4185 |
tmp44 = tmp49 |
| 4186 |
goto cont |
| 4187 |
end |
| 4188 |
else |
| 4189 |
tmp46 = revTokens |
| 4190 |
tmp45 = s |
| 4191 |
tmp44 = _Int_add(i, 1) |
| 4192 |
goto cont |
| 4193 |
end |
| 4194 |
end |
| 4195 |
end |
| 4196 |
end |
| 4197 |
tmp26 = UnsafeCharVector.sub |
| 4198 |
tmp27 = CharVectorSlice.concat |
| 4199 |
tmp28 = CharVectorSlice.full |
| 4200 |
tmp29 = CharVectorSlice.length |
| 4201 |
tmp30 = CharVectorSlice.slice |
| 4202 |
tmp31 = CharVectorSlice.vector |
| 4203 |
tmp32 = CharVector.all |
| 4204 |
tmp33 = CharVector.appi |
| 4205 |
tmp34 = CharVector.exists |
| 4206 |
tmp35 = CharVector.fromList |
| 4207 |
tmp36 = CharVector.length |
| 4208 |
tmp37 = CharArraySlice.base |
| 4209 |
tmp38 = CharArraySlice.copyVec |
| 4210 |
tmp39 = CharArraySlice.full |
| 4211 |
tmp40 = CharArraySlice.length |
| 4212 |
tmp41 = CharArraySlice.slice |
| 4213 |
tmp42 = CharArraySlice.vector |
| 4214 |
end |
| 4215 |
local _L = {} |
| 4216 |
do |
| 4217 |
_L[1] = CharArray.array |
| 4218 |
_L[2] = CharArray.copyVec |
| 4219 |
_L[3] = function(getc1, strm) |
| 4220 |
local tmp43, tmp44 = getc1, strm |
| 4221 |
::cont:: |
| 4222 |
do |
| 4223 |
local getc2, strm1 = tmp43, tmp44 |
| 4224 |
local exp = getc2(strm1) |
| 4225 |
if exp.tag == "NONE" then |
| 4226 |
return strm1 |
| 4227 |
end |
| 4228 |
if exp.tag == "SOME" then |
| 4229 |
else |
| 4230 |
_raise(_Match, "scan-num-utils.sml:2:42") |
| 4231 |
end |
| 4232 |
do |
| 4233 |
local c = exp.payload[1] |
| 4234 |
local strm_PRIME = exp.payload[2] |
| 4235 |
local tmp45 = isSpace(c) |
| 4236 |
if tmp45 then |
| 4237 |
tmp43 = getc2 |
| 4238 |
tmp44 = strm_PRIME |
| 4239 |
goto cont |
| 4240 |
else |
| 4241 |
return strm1 |
| 4242 |
end |
| 4243 |
end |
| 4244 |
end |
| 4245 |
end |
| 4246 |
_L[4] = function(a) |
| 4247 |
return a == 48 or a == 49 |
| 4248 |
end |
| 4249 |
_L[5] = function(a) |
| 4250 |
return 48 <= a and a <= 55 |
| 4251 |
end |
| 4252 |
_L[6] = function(a) |
| 4253 |
if 48 <= a and a <= 57 then |
| 4254 |
return _Int_sub(a, 48) |
| 4255 |
elseif 97 <= a and a <= 102 then |
| 4256 |
return _Int_add(_Int_sub(a, 97), 10) |
| 4257 |
else |
| 4258 |
return _Int_add(_Int_sub(a, 65), 10) |
| 4259 |
end |
| 4260 |
end |
| 4261 |
_L[7] = function(getc1, strm) |
| 4262 |
local exp = getc1(strm) |
| 4263 |
if exp.tag == "SOME" and exp.payload[1] == 43 then |
| 4264 |
return {false, exp.payload[2]} |
| 4265 |
elseif exp.tag == "SOME" and exp.payload[1] == 126 then |
| 4266 |
return {true, exp.payload[2]} |
| 4267 |
elseif exp.tag == "SOME" and exp.payload[1] == 45 then |
| 4268 |
return {true, exp.payload[2]} |
| 4269 |
else |
| 4270 |
return {false, strm} |
| 4271 |
end |
| 4272 |
end |
| 4273 |
local scanSubstring = function(getc1, strm, s) |
| 4274 |
local tmp43, tmp44, tmp45 = getc1, strm, s |
| 4275 |
::cont:: |
| 4276 |
do |
| 4277 |
local getc2, strm1, s1 = tmp43, tmp44, tmp45 |
| 4278 |
local exp = getc(s1) |
| 4279 |
if exp.tag == "NONE" then |
| 4280 |
return {tag = "SOME", payload = strm1} |
| 4281 |
end |
| 4282 |
if exp.tag == "SOME" then |
| 4283 |
else |
| 4284 |
_raise(_Match, "scan-num.sml:341:37") |
| 4285 |
end |
| 4286 |
do |
| 4287 |
local c = exp.payload[1] |
| 4288 |
local s_PRIME = exp.payload[2] |
| 4289 |
local exp1 = getc2(strm1) |
| 4290 |
if exp1.tag == "SOME" then |
| 4291 |
elseif exp1.tag == "NONE" then |
| 4292 |
return NONE |
| 4293 |
else |
| 4294 |
_raise(_Match, "scan-num.sml:343:57") |
| 4295 |
end |
| 4296 |
do |
| 4297 |
local strm_PRIME, tmp46 |
| 4298 |
do |
| 4299 |
local c_PRIME = exp1.payload[1] |
| 4300 |
strm_PRIME = exp1.payload[2] |
| 4301 |
do |
| 4302 |
if c == c_PRIME then |
| 4303 |
tmp46 = true |
| 4304 |
goto cont1 |
| 4305 |
end |
| 4306 |
local tmp47 |
| 4307 |
tmp47 = 65 <= c and c <= 90 or 97 <= c and c <= 122 |
| 4308 |
if tmp47 then |
| 4309 |
else |
| 4310 |
tmp46 = false |
| 4311 |
goto cont1 |
| 4312 |
end |
| 4313 |
do |
| 4314 |
local tmp48 |
| 4315 |
tmp48 = 65 <= c_PRIME and c_PRIME <= 90 or 97 <= c_PRIME and c_PRIME <= 122 |
| 4316 |
if tmp48 then |
| 4317 |
else |
| 4318 |
tmp46 = false |
| 4319 |
goto cont1 |
| 4320 |
end |
| 4321 |
do |
| 4322 |
local tmp49 = toUpper(c) |
| 4323 |
local tmp50 = toUpper(c_PRIME) |
| 4324 |
tmp46 = tmp49 == tmp50 |
| 4325 |
end |
| 4326 |
end |
| 4327 |
end |
| 4328 |
end |
| 4329 |
::cont1:: |
| 4330 |
if tmp46 then |
| 4331 |
tmp43 = getc2 |
| 4332 |
tmp44 = strm_PRIME |
| 4333 |
tmp45 = s_PRIME |
| 4334 |
goto cont |
| 4335 |
else |
| 4336 |
return NONE |
| 4337 |
end |
| 4338 |
end |
| 4339 |
end |
| 4340 |
end |
| 4341 |
end |
| 4342 |
local scanZeroOrMoreDigits = function(getc1, strm, revAcc) |
| 4343 |
local tmp43, tmp44, tmp45 = getc1, strm, revAcc |
| 4344 |
::cont:: |
| 4345 |
do |
| 4346 |
local getc2, strm1, revAcc1 = tmp43, tmp44, tmp45 |
| 4347 |
local exp = getc2(strm1) |
| 4348 |
if exp.tag == "SOME" then |
| 4349 |
local c = exp.payload[1] |
| 4350 |
local strm_PRIME = exp.payload[2] |
| 4351 |
if 48 <= c and c <= 57 then |
| 4352 |
tmp43 = getc2 |
| 4353 |
tmp44 = strm_PRIME |
| 4354 |
tmp45 = {c, revAcc1} |
| 4355 |
goto cont |
| 4356 |
else |
| 4357 |
return {revAcc1, strm1} |
| 4358 |
end |
| 4359 |
elseif exp.tag == "NONE" then |
| 4360 |
return {revAcc1, strm1} |
| 4361 |
else |
| 4362 |
_raise(_Match, "scan-num.sml:349:49") |
| 4363 |
end |
| 4364 |
end |
| 4365 |
end |
| 4366 |
local scanOneOrMoreDigits = function(getc1, strm, revAcc) |
| 4367 |
local exp = getc1(strm) |
| 4368 |
if exp.tag == "SOME" then |
| 4369 |
elseif exp.tag == "NONE" then |
| 4370 |
return NONE |
| 4371 |
else |
| 4372 |
_raise(_Match, "scan-num.sml:355:48") |
| 4373 |
end |
| 4374 |
do |
| 4375 |
local c = exp.payload[1] |
| 4376 |
local strm_PRIME = exp.payload[2] |
| 4377 |
if 48 <= c and c <= 57 then |
| 4378 |
else |
| 4379 |
return NONE |
| 4380 |
end |
| 4381 |
do |
| 4382 |
local tmp43 = scanZeroOrMoreDigits(getc1, strm_PRIME, {c, revAcc}) |
| 4383 |
return {tag = "SOME", payload = tmp43} |
| 4384 |
end |
| 4385 |
end |
| 4386 |
end |
| 4387 |
local scanOptExpPart = function(getc1, strm, revAcc) |
| 4388 |
local exp = getc1(strm) |
| 4389 |
if exp.tag == "SOME" then |
| 4390 |
elseif exp.tag == "NONE" then |
| 4391 |
return {revAcc, strm} |
| 4392 |
else |
| 4393 |
_raise(_Match, "scan-num.sml:367:43") |
| 4394 |
end |
| 4395 |
do |
| 4396 |
local c = exp.payload[1] |
| 4397 |
local strm_PRIME = exp.payload[2] |
| 4398 |
if c == 101 or c == 69 then |
| 4399 |
else |
| 4400 |
return {revAcc, strm} |
| 4401 |
end |
| 4402 |
do |
| 4403 |
local exp1 = _L[7](getc1, strm_PRIME) |
| 4404 |
local isNegative = exp1[1] |
| 4405 |
local strm_PRIME_PRIME = exp1[2] |
| 4406 |
local tmp43 |
| 4407 |
if isNegative then |
| 4408 |
tmp43 = {45, {101, revAcc}} |
| 4409 |
else |
| 4410 |
tmp43 = {101, revAcc} |
| 4411 |
end |
| 4412 |
local exp2 = scanOneOrMoreDigits(getc1, strm_PRIME_PRIME, tmp43) |
| 4413 |
if exp2.tag == "SOME" then |
| 4414 |
local revAcc1 = exp2.payload[1] |
| 4415 |
return {revAcc1, exp2.payload[2]} |
| 4416 |
elseif exp2.tag == "NONE" then |
| 4417 |
return {revAcc, strm} |
| 4418 |
else |
| 4419 |
_raise(_Match, "scan-num.sml:370:73") |
| 4420 |
end |
| 4421 |
end |
| 4422 |
end |
| 4423 |
end |
| 4424 |
_L[8] = function(a) |
| 4425 |
return function(a1) |
| 4426 |
local isNegative, signPart, exp |
| 4427 |
do |
| 4428 |
local strm = _L[3](a, a1) |
| 4429 |
local exp1 = _L[7](a, strm) |
| 4430 |
isNegative = exp1[1] |
| 4431 |
local strm1 = exp1[2] |
| 4432 |
if isNegative then |
| 4433 |
signPart = {45, nil} |
| 4434 |
else |
| 4435 |
signPart = nil |
| 4436 |
end |
| 4437 |
exp = a(strm1) |
| 4438 |
if exp.tag == "SOME" and exp.payload[1] == 46 then |
| 4439 |
else |
| 4440 |
goto else1 |
| 4441 |
end |
| 4442 |
do |
| 4443 |
local exp2 = scanOneOrMoreDigits(a, exp.payload[2], {46, {48, signPart}}) |
| 4444 |
if exp2.tag == "SOME" then |
| 4445 |
elseif exp2.tag == "NONE" then |
| 4446 |
return NONE |
| 4447 |
else |
| 4448 |
_raise(_Match, "scan-num.sml:385:52") |
| 4449 |
end |
| 4450 |
do |
| 4451 |
local exp3 = scanOptExpPart(a, exp2.payload[2], exp2.payload[1]) |
| 4452 |
local revAcc = exp3[1] |
| 4453 |
local strm_PRIME_PRIME_PRIME = exp3[2] |
| 4454 |
local tmp43 = implodeRev(revAcc) |
| 4455 |
return {tag = "SOME", payload = {tmp4(tmp43) * 1.0, strm_PRIME_PRIME_PRIME}} |
| 4456 |
end |
| 4457 |
end |
| 4458 |
end |
| 4459 |
::else1:: |
| 4460 |
if exp.tag == "SOME" then |
| 4461 |
elseif exp.tag == "NONE" then |
| 4462 |
return NONE |
| 4463 |
else |
| 4464 |
_raise(_Match, "scan-num.sml:384:25") |
| 4465 |
end |
| 4466 |
do |
| 4467 |
local c = exp.payload[1] |
| 4468 |
local strm_PRIME = exp.payload[2] |
| 4469 |
if c == 105 or c == 73 then |
| 4470 |
else |
| 4471 |
goto else2 |
| 4472 |
end |
| 4473 |
do |
| 4474 |
local tmp43 = full("nf") |
| 4475 |
local exp1 = scanSubstring(a, strm_PRIME, tmp43) |
| 4476 |
if exp1.tag == "SOME" then |
| 4477 |
elseif exp1.tag == "NONE" then |
| 4478 |
return NONE |
| 4479 |
else |
| 4480 |
_raise(_Match, "scan-num.sml:393:52") |
| 4481 |
end |
| 4482 |
do |
| 4483 |
local strm_PRIME_PRIME = exp1.payload |
| 4484 |
local inf |
| 4485 |
if isNegative then |
| 4486 |
inf = tmp25 |
| 4487 |
else |
| 4488 |
inf = tmp11 |
| 4489 |
end |
| 4490 |
local tmp44 = full("inity") |
| 4491 |
local exp2 = scanSubstring(a, strm_PRIME_PRIME, tmp44) |
| 4492 |
if exp2.tag == "SOME" then |
| 4493 |
return {tag = "SOME", payload = {inf, exp2.payload}} |
| 4494 |
elseif exp2.tag == "NONE" then |
| 4495 |
return {tag = "SOME", payload = {inf, strm_PRIME_PRIME}} |
| 4496 |
else |
| 4497 |
_raise(_Match, "scan-num.sml:395:74") |
| 4498 |
end |
| 4499 |
end |
| 4500 |
end |
| 4501 |
::else2:: |
| 4502 |
if c == 110 or c == 78 then |
| 4503 |
else |
| 4504 |
goto else3 |
| 4505 |
end |
| 4506 |
do |
| 4507 |
local tmp43 = full("an") |
| 4508 |
local exp1 = scanSubstring(a, strm_PRIME, tmp43) |
| 4509 |
if exp1.tag == "SOME" then |
| 4510 |
local strm_PRIME_PRIME = exp1.payload |
| 4511 |
return {tag = "SOME", payload = {0.0 / 0.0, strm_PRIME_PRIME}} |
| 4512 |
elseif exp1.tag == "NONE" then |
| 4513 |
return NONE |
| 4514 |
else |
| 4515 |
_raise(_Match, "scan-num.sml:402:52") |
| 4516 |
end |
| 4517 |
end |
| 4518 |
::else3:: |
| 4519 |
if 48 <= c and c <= 57 then |
| 4520 |
else |
| 4521 |
return NONE |
| 4522 |
end |
| 4523 |
do |
| 4524 |
local strm_PRIME_PRIME_PRIME, revAcc |
| 4525 |
do |
| 4526 |
local exp1 = scanZeroOrMoreDigits(a, strm_PRIME, {c, signPart}) |
| 4527 |
local revAcc1 = exp1[1] |
| 4528 |
local strm_PRIME_PRIME = exp1[2] |
| 4529 |
do |
| 4530 |
local exp2 = a(strm_PRIME_PRIME) |
| 4531 |
if exp2.tag == "SOME" and exp2.payload[1] == 46 then |
| 4532 |
else |
| 4533 |
strm_PRIME_PRIME_PRIME = strm_PRIME_PRIME |
| 4534 |
revAcc = revAcc1 |
| 4535 |
goto cont |
| 4536 |
end |
| 4537 |
do |
| 4538 |
local exp3 = scanOneOrMoreDigits(a, exp2.payload[2], {46, revAcc1}) |
| 4539 |
if exp3.tag == "SOME" then |
| 4540 |
strm_PRIME_PRIME_PRIME = exp3.payload[2] |
| 4541 |
revAcc = exp3.payload[1] |
| 4542 |
elseif exp3.tag == "NONE" then |
| 4543 |
strm_PRIME_PRIME_PRIME = strm_PRIME_PRIME |
| 4544 |
revAcc = revAcc1 |
| 4545 |
else |
| 4546 |
_raise(_Match, "scan-num.sml:362:71") |
| 4547 |
end |
| 4548 |
end |
| 4549 |
end |
| 4550 |
end |
| 4551 |
::cont:: |
| 4552 |
local exp1 = scanOptExpPart(a, strm_PRIME_PRIME_PRIME, revAcc) |
| 4553 |
local revAcc1 = exp1[1] |
| 4554 |
local strm_PRIME_PRIME_PRIME_PRIME = exp1[2] |
| 4555 |
local tmp43 = implodeRev(revAcc1) |
| 4556 |
return {tag = "SOME", payload = {tmp4(tmp43) * 1.0, strm_PRIME_PRIME_PRIME_PRIME}} |
| 4557 |
end |
| 4558 |
end |
| 4559 |
end |
| 4560 |
end |
| 4561 |
_L[9] = {"Io"} |
| 4562 |
_L[10] = {tag = {"BlockingNotSupported"}} |
| 4563 |
_L[11] = {tag = {"NonblockingNotSupported"}} |
| 4564 |
_L[12] = {tag = {"RandomAccessNotSupported"}} |
| 4565 |
_L[13] = {tag = {"ClosedStream"}} |
| 4566 |
_L[14] = "NO_BUF" |
| 4567 |
_L[15] = "LINE_BUF" |
| 4568 |
_L[16] = "BLOCK_BUF" |
| 4569 |
_L[17] = function(tmp43, tmp44) |
| 4570 |
return tmp43 == "NO_BUF" and tmp44 == "NO_BUF" or (tmp43 == "LINE_BUF" and tmp44 == "LINE_BUF" or tmp43 == "BLOCK_BUF" and tmp44 == "BLOCK_BUF") |
| 4571 |
end |
| 4572 |
_L[18] = function(base, length1, start, i) |
| 4573 |
if 0 <= i and i < length1 then |
| 4574 |
return base[_Int_add(start, i) + 1] |
| 4575 |
else |
| 4576 |
_raise(_Subscript, "vector-slice.sml:39:44") |
| 4577 |
end |
| 4578 |
end |
| 4579 |
_L[19] = function(a, i, tmp43) |
| 4580 |
if tmp43.tag == "NONE" then |
| 4581 |
if 0 <= i and i <= a.n then |
| 4582 |
return {base = a, length = _Int_sub(a.n, i), start = i} |
| 4583 |
else |
| 4584 |
_raise(_Subscript, "vector-slice.sml:44:30") |
| 4585 |
end |
| 4586 |
end |
| 4587 |
if tmp43.tag == "SOME" then |
| 4588 |
local n = tmp43.payload |
| 4589 |
local tmp44 |
| 4590 |
if 0 <= i then |
| 4591 |
if 0 <= n then |
| 4592 |
local tmp45 = _Int_add(i, n) |
| 4593 |
tmp44 = tmp45 <= a.n |
| 4594 |
else |
| 4595 |
tmp44 = false |
| 4596 |
end |
| 4597 |
else |
| 4598 |
tmp44 = false |
| 4599 |
end |
| 4600 |
if tmp44 then |
| 4601 |
return {base = a, length = n, start = i} |
| 4602 |
else |
| 4603 |
_raise(_Subscript, "vector-slice.sml:48:32") |
| 4604 |
end |
| 4605 |
else |
| 4606 |
_raise(_Match, "vector-slice.sml:41:5") |
| 4607 |
end |
| 4608 |
end |
| 4609 |
_L[20] = function(a) |
| 4610 |
return function(a1) |
| 4611 |
local base = a1.base |
| 4612 |
local start = a1.start |
| 4613 |
local length1 = a1.length |
| 4614 |
local tmp43 = 0 |
| 4615 |
::cont:: |
| 4616 |
do |
| 4617 |
local a2 = tmp43 |
| 4618 |
if a2 >= length1 then |
| 4619 |
return false |
| 4620 |
end |
| 4621 |
local tmp44 = a(base[_Int_add(start, a2) + 1]) |
| 4622 |
if tmp44 then |
| 4623 |
return true |
| 4624 |
else |
| 4625 |
tmp43 = _Int_add(a2, 1) |
| 4626 |
goto cont |
| 4627 |
end |
| 4628 |
end |
| 4629 |
end |
| 4630 |
end |
| 4631 |
_L[21] = {tag = "ZERO"} |
| 4632 |
local tmp43 = 0x1 << tmp24 // 2 |
| 4633 |
local tmp44 |
| 4634 |
if tmp43 < 0x0 then |
| 4635 |
_raise(_Overflow, "word-1.sml:52:39") |
| 4636 |
else |
| 4637 |
tmp44 = tmp43 |
| 4638 |
end |
| 4639 |
_L[22] = function(a) |
| 4640 |
if a == 0 then |
| 4641 |
return _L[21] |
| 4642 |
end |
| 4643 |
if a > 0 then |
| 4644 |
else |
| 4645 |
goto else1 |
| 4646 |
end |
| 4647 |
do |
| 4648 |
local function go(a1) |
| 4649 |
if a1 == 0 then |
| 4650 |
return nil |
| 4651 |
end |
| 4652 |
local tmp45 = _Int_div(a1, tmp44) |
| 4653 |
local tmp46 = _Int_mod(a1, tmp44) |
| 4654 |
local tmp47 = _Int_div(tmp45, tmp44) |
| 4655 |
local tmp48 = tmp46 + _Int_mod(tmp45, tmp44) * tmp43 |
| 4656 |
local tmp49 = go(tmp47) |
| 4657 |
return {tmp48, tmp49} |
| 4658 |
end |
| 4659 |
local tmp45 = go(a) |
| 4660 |
return {tag = "POSITIVE", payload = _VectorOrArray_fromList(tmp45)} |
| 4661 |
end |
| 4662 |
::else1:: |
| 4663 |
local function go(a1) |
| 4664 |
if a1 == 0 then |
| 4665 |
return nil |
| 4666 |
end |
| 4667 |
local q1 = quot(a1, tmp44) |
| 4668 |
local r1 = rem(a1, tmp44) |
| 4669 |
local q2 = quot(q1, tmp44) |
| 4670 |
local r2 = rem(q1, tmp44) |
| 4671 |
local tmp45 = _Int_negate(r1) |
| 4672 |
local tmp46 = _Int_negate(r2) |
| 4673 |
local tmp47 = tmp45 + tmp46 * tmp43 |
| 4674 |
local tmp48 = go(q2) |
| 4675 |
return {tmp47, tmp48} |
| 4676 |
end |
| 4677 |
local tmp45 = go(a) |
| 4678 |
return {tag = "NEGATIVE", payload = _VectorOrArray_fromList(tmp45)} |
| 4679 |
end |
| 4680 |
local add2 = function(x, y) |
| 4681 |
local tmp45 = x + y |
| 4682 |
if math_ult(tmp45, x) then |
| 4683 |
return {hi = 0x1, lo = tmp45} |
| 4684 |
else |
| 4685 |
return {hi = 0x0, lo = tmp45} |
| 4686 |
end |
| 4687 |
end |
| 4688 |
local add3 = function(x, y, z) |
| 4689 |
local exp = add2(x, y) |
| 4690 |
local lo1 = exp.lo |
| 4691 |
local hi1 = exp.hi |
| 4692 |
local exp1 = add2(lo1, z) |
| 4693 |
local lo2 = exp1.lo |
| 4694 |
return {hi = hi1 + exp1.hi, lo = lo2} |
| 4695 |
end |
| 4696 |
local tmp45 = tmp24 >> 1 |
| 4697 |
local tmp46 = (0x1 << tmp45) - 0x1 |
| 4698 |
_L[23] = function(words, words_PRIME) |
| 4699 |
local tmp47 = words.n |
| 4700 |
local exp = compare({tmp47, words_PRIME.n}) |
| 4701 |
if exp == "EQUAL" then |
| 4702 |
local tmp48 = _Int_sub(tmp47, 1) |
| 4703 |
::cont:: |
| 4704 |
do |
| 4705 |
local a = tmp48 |
| 4706 |
if a < 0 then |
| 4707 |
return EQUAL |
| 4708 |
end |
| 4709 |
local tmp49 = words[a + 1] |
| 4710 |
local tmp50 = words_PRIME[a + 1] |
| 4711 |
local exp1 |
| 4712 |
if tmp49 == tmp50 then |
| 4713 |
exp1 = EQUAL |
| 4714 |
elseif math_ult(tmp49, tmp50) then |
| 4715 |
exp1 = LESS |
| 4716 |
else |
| 4717 |
exp1 = GREATER |
| 4718 |
end |
| 4719 |
if exp1 == "EQUAL" then |
| 4720 |
tmp48 = _Int_sub(a, 1) |
| 4721 |
goto cont |
| 4722 |
else |
| 4723 |
return exp1 |
| 4724 |
end |
| 4725 |
end |
| 4726 |
else |
| 4727 |
return exp |
| 4728 |
end |
| 4729 |
end |
| 4730 |
_L[24] = function(a) |
| 4731 |
local length1 |
| 4732 |
do |
| 4733 |
local tmp47 = a.n |
| 4734 |
::cont:: |
| 4735 |
do |
| 4736 |
local a1 = tmp47 |
| 4737 |
local tmp48 = _Int_sub(a1, 1) |
| 4738 |
if tmp48 < 0 then |
| 4739 |
length1 = a1 |
| 4740 |
elseif a[tmp48 + 1] ~= 0x0 then |
| 4741 |
length1 = a1 |
| 4742 |
else |
| 4743 |
tmp47 = tmp48 |
| 4744 |
goto cont |
| 4745 |
end |
| 4746 |
end |
| 4747 |
end |
| 4748 |
if 0 <= length1 and length1 <= a.n then |
| 4749 |
else |
| 4750 |
_raise(_Subscript, "array-slice.sml:52:32") |
| 4751 |
end |
| 4752 |
do |
| 4753 |
return _VectorOrArray_tabulate({length1, function(i) |
| 4754 |
return a[i + 1] |
| 4755 |
end}) |
| 4756 |
end |
| 4757 |
end |
| 4758 |
_L[25] = function(words, words_PRIME) |
| 4759 |
local tmp47, tmp48, tmp49, tmp50, tmp51, tmp52 |
| 4760 |
do |
| 4761 |
tmp47 = words.n |
| 4762 |
tmp48 = words_PRIME.n |
| 4763 |
local tmp53 |
| 4764 |
if tmp47 < tmp48 then |
| 4765 |
tmp53 = tmp48 |
| 4766 |
else |
| 4767 |
tmp53 = tmp47 |
| 4768 |
end |
| 4769 |
tmp49 = _Int_add(tmp53, 1) |
| 4770 |
tmp50 = _Array_array(tmp49, 0x0) |
| 4771 |
tmp52, tmp51 = 0x0, 0 |
| 4772 |
end |
| 4773 |
::cont:: |
| 4774 |
do |
| 4775 |
local carry, i = tmp52, tmp51 |
| 4776 |
if i == tmp49 then |
| 4777 |
else |
| 4778 |
goto else1 |
| 4779 |
end |
| 4780 |
do |
| 4781 |
return _L[24](tmp50) |
| 4782 |
end |
| 4783 |
::else1:: |
| 4784 |
local w |
| 4785 |
if i < tmp47 then |
| 4786 |
w = words[i + 1] |
| 4787 |
else |
| 4788 |
w = 0x0 |
| 4789 |
end |
| 4790 |
local w_PRIME |
| 4791 |
if i < tmp48 then |
| 4792 |
w_PRIME = words_PRIME[i + 1] |
| 4793 |
else |
| 4794 |
w_PRIME = 0x0 |
| 4795 |
end |
| 4796 |
local exp = add3(w, w_PRIME, carry) |
| 4797 |
local x = exp.lo |
| 4798 |
local carry1 = exp.hi |
| 4799 |
tmp50[i + 1] = x |
| 4800 |
tmp52 = carry1 |
| 4801 |
tmp51 = _Int_add(i, 1) |
| 4802 |
goto cont |
| 4803 |
end |
| 4804 |
end |
| 4805 |
_L[26] = function(words, words_PRIME) |
| 4806 |
local tmp47 = words.n |
| 4807 |
local tmp48 = words_PRIME.n |
| 4808 |
local tmp49 = _Array_array(tmp47, 0x0) |
| 4809 |
local tmp50, tmp51 = 0x0, 0 |
| 4810 |
::cont:: |
| 4811 |
do |
| 4812 |
local carry, i = tmp50, tmp51 |
| 4813 |
if i == tmp47 then |
| 4814 |
else |
| 4815 |
goto else1 |
| 4816 |
end |
| 4817 |
do |
| 4818 |
if carry == 0x0 then |
| 4819 |
else |
| 4820 |
goto else2 |
| 4821 |
end |
| 4822 |
do |
| 4823 |
return _L[24](tmp49) |
| 4824 |
end |
| 4825 |
::else2:: |
| 4826 |
local tmp52 = _Fail("subAbs: carry not zero") |
| 4827 |
_raise(tmp52, "int-inf.sml:276:77") |
| 4828 |
end |
| 4829 |
::else1:: |
| 4830 |
local tmp52 = words[i + 1] |
| 4831 |
local w_PRIME |
| 4832 |
if i < tmp48 then |
| 4833 |
w_PRIME = words_PRIME[i + 1] |
| 4834 |
else |
| 4835 |
w_PRIME = 0x0 |
| 4836 |
end |
| 4837 |
local carry1, lo |
| 4838 |
if math_ult(tmp52, w_PRIME) then |
| 4839 |
lo = tmp52 - w_PRIME - carry |
| 4840 |
carry1 = 0x1 |
| 4841 |
elseif math_ult(w_PRIME, tmp52) then |
| 4842 |
lo = tmp52 - w_PRIME - carry |
| 4843 |
carry1 = 0x0 |
| 4844 |
elseif carry == 0x0 then |
| 4845 |
lo = 0x0 |
| 4846 |
carry1 = 0x0 |
| 4847 |
else |
| 4848 |
lo = - carry |
| 4849 |
carry1 = 0x1 |
| 4850 |
end |
| 4851 |
tmp49[i + 1] = lo |
| 4852 |
tmp50 = carry1 |
| 4853 |
tmp51 = _Int_add(i, 1) |
| 4854 |
goto cont |
| 4855 |
end |
| 4856 |
end |
| 4857 |
_L[27] = function(words, words_PRIME) |
| 4858 |
local tmp47 = words.n |
| 4859 |
local tmp48 = words_PRIME.n |
| 4860 |
local tmp49 = _Array_array(_Int_add(tmp47, tmp48), 0x0) |
| 4861 |
local tmp50 = 0 |
| 4862 |
::cont:: |
| 4863 |
do |
| 4864 |
local a = tmp50 |
| 4865 |
if a >= tmp48 then |
| 4866 |
else |
| 4867 |
goto else1 |
| 4868 |
end |
| 4869 |
do |
| 4870 |
return _L[24](tmp49) |
| 4871 |
end |
| 4872 |
::else1:: |
| 4873 |
local tmp51 = words_PRIME[a + 1] |
| 4874 |
local tmp52, tmp53 = 0, 0x0 |
| 4875 |
::cont1:: |
| 4876 |
do |
| 4877 |
local k, i, lo, hi |
| 4878 |
do |
| 4879 |
i, k = tmp52, tmp53 |
| 4880 |
if i >= tmp47 then |
| 4881 |
tmp49[_Int_add(i, a) + 1] = k |
| 4882 |
tmp50 = _Int_add(a, 1) |
| 4883 |
goto cont |
| 4884 |
end |
| 4885 |
local tmp54 = words[i + 1] |
| 4886 |
do |
| 4887 |
if tmp54 == 0x0 then |
| 4888 |
lo = 0x0 |
| 4889 |
hi = 0x0 |
| 4890 |
goto cont2 |
| 4891 |
end |
| 4892 |
if tmp51 == 0x0 then |
| 4893 |
lo = 0x0 |
| 4894 |
hi = 0x0 |
| 4895 |
goto cont2 |
| 4896 |
end |
| 4897 |
local tmp55 = tmp54 >> tmp45 |
| 4898 |
local tmp56 = tmp54 & tmp46 |
| 4899 |
local tmp57 = tmp51 >> tmp45 |
| 4900 |
local tmp58 = tmp51 & tmp46 |
| 4901 |
local tmp59 = tmp56 * tmp58 |
| 4902 |
local tmp60 = tmp55 * tmp58 |
| 4903 |
local tmp61 = tmp60 << tmp45 |
| 4904 |
local tmp62 = tmp60 >> tmp45 |
| 4905 |
local tmp63 = tmp56 * tmp57 |
| 4906 |
local tmp64 = tmp63 << tmp45 |
| 4907 |
local tmp65 = tmp63 >> tmp45 |
| 4908 |
local tmp66 = tmp55 * tmp57 |
| 4909 |
local exp = add3(tmp59, tmp61, tmp64) |
| 4910 |
local lo1 = exp.lo |
| 4911 |
local hi4 = exp.hi |
| 4912 |
lo = lo1 |
| 4913 |
hi = tmp62 + tmp65 + tmp66 + hi4 |
| 4914 |
end |
| 4915 |
end |
| 4916 |
::cont2:: |
| 4917 |
local exp = add3(lo, tmp49[_Int_add(i, a) + 1], k) |
| 4918 |
local lo1 = exp.lo |
| 4919 |
local hi_PRIME = exp.hi |
| 4920 |
tmp49[_Int_add(i, a) + 1] = lo1 |
| 4921 |
local tmp54 = _Int_add(i, 1) |
| 4922 |
tmp52 = tmp54 |
| 4923 |
tmp53 = hi + hi_PRIME |
| 4924 |
goto cont1 |
| 4925 |
end |
| 4926 |
end |
| 4927 |
end |
| 4928 |
end |
| 4929 |
local add, mul, log2Word, LShiftAbs, scan, tmp43 |
| 4930 |
do |
| 4931 |
add = function(tmp44, y) |
| 4932 |
if tmp44.tag == "ZERO" then |
| 4933 |
return y |
| 4934 |
end |
| 4935 |
if y.tag == "ZERO" then |
| 4936 |
return tmp44 |
| 4937 |
end |
| 4938 |
if tmp44.tag == "POSITIVE" and y.tag == "POSITIVE" then |
| 4939 |
else |
| 4940 |
goto else1 |
| 4941 |
end |
| 4942 |
do |
| 4943 |
local words = tmp44.payload |
| 4944 |
local tmp45 = _L[25](words, y.payload) |
| 4945 |
return {tag = "POSITIVE", payload = tmp45} |
| 4946 |
end |
| 4947 |
::else1:: |
| 4948 |
if tmp44.tag == "POSITIVE" and y.tag == "NEGATIVE" then |
| 4949 |
else |
| 4950 |
goto else2 |
| 4951 |
end |
| 4952 |
do |
| 4953 |
local words = tmp44.payload |
| 4954 |
local words_PRIME = y.payload |
| 4955 |
local exp = _L[23](words, words_PRIME) |
| 4956 |
if exp == "LESS" then |
| 4957 |
else |
| 4958 |
goto else4 |
| 4959 |
end |
| 4960 |
do |
| 4961 |
local tmp45 = _L[26](words_PRIME, words) |
| 4962 |
return {tag = "NEGATIVE", payload = tmp45} |
| 4963 |
end |
| 4964 |
::else4:: |
| 4965 |
if exp == "GREATER" then |
| 4966 |
elseif exp == "EQUAL" then |
| 4967 |
return _L[21] |
| 4968 |
else |
| 4969 |
_raise(_Match, "int-inf.sml:347:46") |
| 4970 |
end |
| 4971 |
do |
| 4972 |
local tmp45 = _L[26](words, words_PRIME) |
| 4973 |
return {tag = "POSITIVE", payload = tmp45} |
| 4974 |
end |
| 4975 |
end |
| 4976 |
::else2:: |
| 4977 |
if tmp44.tag == "NEGATIVE" and y.tag == "POSITIVE" then |
| 4978 |
else |
| 4979 |
goto else3 |
| 4980 |
end |
| 4981 |
do |
| 4982 |
local words = tmp44.payload |
| 4983 |
local words_PRIME = y.payload |
| 4984 |
local exp = _L[23](words, words_PRIME) |
| 4985 |
if exp == "LESS" then |
| 4986 |
else |
| 4987 |
goto else4 |
| 4988 |
end |
| 4989 |
do |
| 4990 |
local tmp45 = _L[26](words_PRIME, words) |
| 4991 |
return {tag = "POSITIVE", payload = tmp45} |
| 4992 |
end |
| 4993 |
::else4:: |
| 4994 |
if exp == "GREATER" then |
| 4995 |
elseif exp == "EQUAL" then |
| 4996 |
return _L[21] |
| 4997 |
else |
| 4998 |
_raise(_Match, "int-inf.sml:352:46") |
| 4999 |
end |
| 5000 |
do |
| 5001 |
local tmp45 = _L[26](words, words_PRIME) |
| 5002 |
return {tag = "NEGATIVE", payload = tmp45} |
| 5003 |
end |
| 5004 |
end |
| 5005 |
::else3:: |
| 5006 |
if tmp44.tag == "NEGATIVE" and y.tag == "NEGATIVE" then |
| 5007 |
else |
| 5008 |
_raise(_Match, "int-inf.sml:344:5") |
| 5009 |
end |
| 5010 |
do |
| 5011 |
local words = tmp44.payload |
| 5012 |
local tmp45 = _L[25](words, y.payload) |
| 5013 |
return {tag = "NEGATIVE", payload = tmp45} |
| 5014 |
end |
| 5015 |
end |
| 5016 |
mul = function(tmp44, tmp45) |
| 5017 |
if tmp44.tag == "ZERO" then |
| 5018 |
return tmp44 |
| 5019 |
end |
| 5020 |
if tmp45.tag == "ZERO" then |
| 5021 |
return tmp45 |
| 5022 |
end |
| 5023 |
if tmp44.tag == "POSITIVE" and tmp45.tag == "POSITIVE" then |
| 5024 |
else |
| 5025 |
goto else1 |
| 5026 |
end |
| 5027 |
do |
| 5028 |
local words = tmp44.payload |
| 5029 |
local tmp46 = _L[27](words, tmp45.payload) |
| 5030 |
return {tag = "POSITIVE", payload = tmp46} |
| 5031 |
end |
| 5032 |
::else1:: |
| 5033 |
if tmp44.tag == "POSITIVE" and tmp45.tag == "NEGATIVE" then |
| 5034 |
else |
| 5035 |
goto else2 |
| 5036 |
end |
| 5037 |
do |
| 5038 |
local words = tmp44.payload |
| 5039 |
local tmp46 = _L[27](words, tmp45.payload) |
| 5040 |
return {tag = "NEGATIVE", payload = tmp46} |
| 5041 |
end |
| 5042 |
::else2:: |
| 5043 |
if tmp44.tag == "NEGATIVE" and tmp45.tag == "POSITIVE" then |
| 5044 |
else |
| 5045 |
goto else3 |
| 5046 |
end |
| 5047 |
do |
| 5048 |
local words = tmp44.payload |
| 5049 |
local tmp46 = _L[27](words, tmp45.payload) |
| 5050 |
return {tag = "NEGATIVE", payload = tmp46} |
| 5051 |
end |
| 5052 |
::else3:: |
| 5053 |
if tmp44.tag == "NEGATIVE" and tmp45.tag == "NEGATIVE" then |
| 5054 |
else |
| 5055 |
_raise(_Match, "int-inf.sml:375:5") |
| 5056 |
end |
| 5057 |
do |
| 5058 |
local words = tmp44.payload |
| 5059 |
local tmp46 = _L[27](words, tmp45.payload) |
| 5060 |
return {tag = "POSITIVE", payload = tmp46} |
| 5061 |
end |
| 5062 |
end |
| 5063 |
log2Word = function(a) |
| 5064 |
if a == 0x0 then |
| 5065 |
_raise(Domain, "int-inf.sml:422:20") |
| 5066 |
end |
| 5067 |
if a == 0x1 then |
| 5068 |
return 0 |
| 5069 |
end |
| 5070 |
local tmp44 = log2Word(a >> 1) |
| 5071 |
return _Int_add(1, tmp44) |
| 5072 |
end |
| 5073 |
LShiftAbs = function(words, amount) |
| 5074 |
local tmp44, tmp45, tmp46, tmp47 |
| 5075 |
do |
| 5076 |
tmp44 = _Word_div(amount, tmp24) |
| 5077 |
tmp45 = _Word_mod(amount, tmp24) |
| 5078 |
tmp46 = words.n |
| 5079 |
local tmp48 |
| 5080 |
if tmp44 < 0x0 then |
| 5081 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5082 |
else |
| 5083 |
tmp48 = tmp44 |
| 5084 |
end |
| 5085 |
tmp47 = _Int_add(tmp46, tmp48) |
| 5086 |
if tmp45 == 0x0 then |
| 5087 |
else |
| 5088 |
goto else1 |
| 5089 |
end |
| 5090 |
do |
| 5091 |
return _VectorOrArray_tabulate({tmp47, function(i) |
| 5092 |
local tmp49 |
| 5093 |
if tmp44 < 0x0 then |
| 5094 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5095 |
else |
| 5096 |
tmp49 = tmp44 |
| 5097 |
end |
| 5098 |
if i < tmp49 then |
| 5099 |
return 0x0 |
| 5100 |
elseif tmp44 < 0x0 then |
| 5101 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5102 |
else |
| 5103 |
return words[_Int_sub(i, tmp44) + 1] |
| 5104 |
end |
| 5105 |
end}) |
| 5106 |
end |
| 5107 |
end |
| 5108 |
::else1:: |
| 5109 |
local tmp48 = _Array_array(_Int_add(tmp47, 1), 0x0) |
| 5110 |
local tmp49, tmp50 = 0x0, 0 |
| 5111 |
::cont:: |
| 5112 |
do |
| 5113 |
local lo, i = tmp49, tmp50 |
| 5114 |
if i == _Int_add(tmp46, 1) then |
| 5115 |
else |
| 5116 |
goto else2 |
| 5117 |
end |
| 5118 |
do |
| 5119 |
if lo == 0x0 then |
| 5120 |
else |
| 5121 |
goto else3 |
| 5122 |
end |
| 5123 |
do |
| 5124 |
return _L[24](tmp48) |
| 5125 |
end |
| 5126 |
::else3:: |
| 5127 |
local tmp51 = _Fail("LShiftAbs: carry not zero") |
| 5128 |
_raise(tmp51, "int-inf.sml:567:84") |
| 5129 |
end |
| 5130 |
::else2:: |
| 5131 |
local w |
| 5132 |
if i < tmp46 then |
| 5133 |
w = words[i + 1] |
| 5134 |
else |
| 5135 |
w = 0x0 |
| 5136 |
end |
| 5137 |
local tmp51 = w << tmp45 | lo |
| 5138 |
local tmp52 = w >> tmp24 - tmp45 |
| 5139 |
if tmp44 < 0x0 then |
| 5140 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5141 |
else |
| 5142 |
tmp48[_Int_add(i, tmp44) + 1] = tmp51 |
| 5143 |
tmp49 = tmp52 |
| 5144 |
tmp50 = _Int_add(i, 1) |
| 5145 |
goto cont |
| 5146 |
end |
| 5147 |
end |
| 5148 |
end |
| 5149 |
local scanDigits = function(radix, isDigit1, getc1) |
| 5150 |
return function(strm) |
| 5151 |
local exp = getc1(strm) |
| 5152 |
if exp.tag == "SOME" then |
| 5153 |
elseif exp.tag == "NONE" then |
| 5154 |
return NONE |
| 5155 |
else |
| 5156 |
_raise(_Match, "int-inf.sml:949:25") |
| 5157 |
end |
| 5158 |
do |
| 5159 |
local c = exp.payload[1] |
| 5160 |
local strm_PRIME = exp.payload[2] |
| 5161 |
local tmp44 = isDigit1(c) |
| 5162 |
if tmp44 then |
| 5163 |
else |
| 5164 |
return NONE |
| 5165 |
end |
| 5166 |
do |
| 5167 |
local tmp45, tmp46 |
| 5168 |
do |
| 5169 |
local tmp47 = _L[6](c) |
| 5170 |
local tmp48 = _L[22](tmp47) |
| 5171 |
tmp46, tmp45 = tmp48, strm_PRIME |
| 5172 |
end |
| 5173 |
::cont:: |
| 5174 |
do |
| 5175 |
local x, strm1 = tmp46, tmp45 |
| 5176 |
local exp1 = getc1(strm1) |
| 5177 |
if exp1.tag == "SOME" then |
| 5178 |
elseif exp1.tag == "NONE" then |
| 5179 |
return {tag = "SOME", payload = {x, strm1}} |
| 5180 |
else |
| 5181 |
_raise(_Match, "int-inf.sml:943:35") |
| 5182 |
end |
| 5183 |
do |
| 5184 |
local c1 = exp1.payload[1] |
| 5185 |
local strm_PRIME1 = exp1.payload[2] |
| 5186 |
local tmp47 = isDigit1(c1) |
| 5187 |
if tmp47 then |
| 5188 |
else |
| 5189 |
return {tag = "SOME", payload = {x, strm1}} |
| 5190 |
end |
| 5191 |
do |
| 5192 |
local tmp48 = mul(radix, x) |
| 5193 |
local tmp49 = _L[6](c1) |
| 5194 |
local tmp50 = _L[22](tmp49) |
| 5195 |
local tmp51 = add(tmp48, tmp50) |
| 5196 |
tmp46 = tmp51 |
| 5197 |
tmp45 = strm_PRIME1 |
| 5198 |
goto cont |
| 5199 |
end |
| 5200 |
end |
| 5201 |
end |
| 5202 |
end |
| 5203 |
end |
| 5204 |
end |
| 5205 |
end |
| 5206 |
local scanNegativeDigits = function(radix, isDigit1, getc1) |
| 5207 |
return function(strm) |
| 5208 |
local exp = getc1(strm) |
| 5209 |
if exp.tag == "SOME" then |
| 5210 |
elseif exp.tag == "NONE" then |
| 5211 |
return NONE |
| 5212 |
else |
| 5213 |
_raise(_Match, "int-inf.sml:963:25") |
| 5214 |
end |
| 5215 |
do |
| 5216 |
local c = exp.payload[1] |
| 5217 |
local strm_PRIME = exp.payload[2] |
| 5218 |
local tmp44 = isDigit1(c) |
| 5219 |
if tmp44 then |
| 5220 |
else |
| 5221 |
return NONE |
| 5222 |
end |
| 5223 |
do |
| 5224 |
local tmp45, tmp46 |
| 5225 |
do |
| 5226 |
local tmp47 = _L[6](c) |
| 5227 |
local tmp48 = _Int_negate(tmp47) |
| 5228 |
local tmp49 = _L[22](tmp48) |
| 5229 |
tmp46, tmp45 = tmp49, strm_PRIME |
| 5230 |
end |
| 5231 |
::cont:: |
| 5232 |
do |
| 5233 |
local x, strm1 = tmp46, tmp45 |
| 5234 |
local exp1 = getc1(strm1) |
| 5235 |
if exp1.tag == "SOME" then |
| 5236 |
elseif exp1.tag == "NONE" then |
| 5237 |
return {tag = "SOME", payload = {x, strm1}} |
| 5238 |
else |
| 5239 |
_raise(_Match, "int-inf.sml:957:35") |
| 5240 |
end |
| 5241 |
do |
| 5242 |
local c1 = exp1.payload[1] |
| 5243 |
local strm_PRIME1 = exp1.payload[2] |
| 5244 |
local tmp47 = isDigit1(c1) |
| 5245 |
if tmp47 then |
| 5246 |
else |
| 5247 |
return {tag = "SOME", payload = {x, strm1}} |
| 5248 |
end |
| 5249 |
do |
| 5250 |
local tmp48, tmp49 |
| 5251 |
do |
| 5252 |
tmp48 = mul(radix, x) |
| 5253 |
local tmp50 = _L[6](c1) |
| 5254 |
tmp49 = _L[22](tmp50) |
| 5255 |
if tmp49.tag == "ZERO" then |
| 5256 |
tmp46 = tmp48 |
| 5257 |
tmp45 = strm_PRIME1 |
| 5258 |
goto cont |
| 5259 |
end |
| 5260 |
if tmp48.tag == "ZERO" and tmp49.tag == "POSITIVE" then |
| 5261 |
tmp46 = {tag = "NEGATIVE", payload = tmp49.payload} |
| 5262 |
tmp45 = strm_PRIME1 |
| 5263 |
goto cont |
| 5264 |
end |
| 5265 |
if tmp48.tag == "ZERO" and tmp49.tag == "NEGATIVE" then |
| 5266 |
tmp46 = {tag = "POSITIVE", payload = tmp49.payload} |
| 5267 |
tmp45 = strm_PRIME1 |
| 5268 |
goto cont |
| 5269 |
end |
| 5270 |
if tmp48.tag == "POSITIVE" and tmp49.tag == "POSITIVE" then |
| 5271 |
else |
| 5272 |
goto else1 |
| 5273 |
end |
| 5274 |
do |
| 5275 |
local words = tmp48.payload |
| 5276 |
local words_PRIME = tmp49.payload |
| 5277 |
local exp2 = _L[23](words, words_PRIME) |
| 5278 |
if exp2 == "LESS" then |
| 5279 |
else |
| 5280 |
goto else4 |
| 5281 |
end |
| 5282 |
do |
| 5283 |
local tmp51 = _L[26](words_PRIME, words) |
| 5284 |
tmp46 = {tag = "NEGATIVE", payload = tmp51} |
| 5285 |
tmp45 = strm_PRIME1 |
| 5286 |
goto cont |
| 5287 |
end |
| 5288 |
::else4:: |
| 5289 |
if exp2 == "GREATER" then |
| 5290 |
elseif exp2 == "EQUAL" then |
| 5291 |
tmp46 = _L[21] |
| 5292 |
tmp45 = strm_PRIME1 |
| 5293 |
goto cont |
| 5294 |
else |
| 5295 |
_raise(_Match, "int-inf.sml:362:46") |
| 5296 |
end |
| 5297 |
do |
| 5298 |
local tmp51 = _L[26](words, words_PRIME) |
| 5299 |
tmp46 = {tag = "POSITIVE", payload = tmp51} |
| 5300 |
tmp45 = strm_PRIME1 |
| 5301 |
goto cont |
| 5302 |
end |
| 5303 |
end |
| 5304 |
end |
| 5305 |
::else1:: |
| 5306 |
if tmp48.tag == "POSITIVE" and tmp49.tag == "NEGATIVE" then |
| 5307 |
else |
| 5308 |
goto else2 |
| 5309 |
end |
| 5310 |
do |
| 5311 |
local tmp50 = _L[25](tmp48.payload, tmp49.payload) |
| 5312 |
tmp46 = {tag = "POSITIVE", payload = tmp50} |
| 5313 |
tmp45 = strm_PRIME1 |
| 5314 |
goto cont |
| 5315 |
end |
| 5316 |
::else2:: |
| 5317 |
if tmp48.tag == "NEGATIVE" and tmp49.tag == "POSITIVE" then |
| 5318 |
else |
| 5319 |
goto else3 |
| 5320 |
end |
| 5321 |
do |
| 5322 |
local tmp50 = _L[25](tmp48.payload, tmp49.payload) |
| 5323 |
tmp46 = {tag = "NEGATIVE", payload = tmp50} |
| 5324 |
tmp45 = strm_PRIME1 |
| 5325 |
goto cont |
| 5326 |
end |
| 5327 |
::else3:: |
| 5328 |
if tmp48.tag == "NEGATIVE" and tmp49.tag == "NEGATIVE" then |
| 5329 |
else |
| 5330 |
_raise(_Match, "int-inf.sml:359:5") |
| 5331 |
end |
| 5332 |
do |
| 5333 |
local words = tmp48.payload |
| 5334 |
local words_PRIME = tmp49.payload |
| 5335 |
local exp2 = _L[23](words, words_PRIME) |
| 5336 |
if exp2 == "LESS" then |
| 5337 |
else |
| 5338 |
goto else4 |
| 5339 |
end |
| 5340 |
do |
| 5341 |
local tmp50 = _L[26](words_PRIME, words) |
| 5342 |
tmp46 = {tag = "POSITIVE", payload = tmp50} |
| 5343 |
tmp45 = strm_PRIME1 |
| 5344 |
goto cont |
| 5345 |
end |
| 5346 |
::else4:: |
| 5347 |
if exp2 == "GREATER" then |
| 5348 |
elseif exp2 == "EQUAL" then |
| 5349 |
tmp46 = _L[21] |
| 5350 |
tmp45 = strm_PRIME1 |
| 5351 |
goto cont |
| 5352 |
else |
| 5353 |
_raise(_Match, "int-inf.sml:369:46") |
| 5354 |
end |
| 5355 |
do |
| 5356 |
local tmp50 = _L[26](words, words_PRIME) |
| 5357 |
tmp46 = {tag = "NEGATIVE", payload = tmp50} |
| 5358 |
tmp45 = strm_PRIME1 |
| 5359 |
goto cont |
| 5360 |
end |
| 5361 |
end |
| 5362 |
end |
| 5363 |
end |
| 5364 |
end |
| 5365 |
end |
| 5366 |
end |
| 5367 |
end |
| 5368 |
end |
| 5369 |
scan = function(a, a1) |
| 5370 |
return function(a2) |
| 5371 |
if a == "BIN" then |
| 5372 |
else |
| 5373 |
goto else1 |
| 5374 |
end |
| 5375 |
do |
| 5376 |
local strm |
| 5377 |
do |
| 5378 |
local strm1 = _L[3](a1, a2) |
| 5379 |
local exp = _L[7](a1, strm1) |
| 5380 |
local isNegative = exp[1] |
| 5381 |
strm = exp[2] |
| 5382 |
if isNegative then |
| 5383 |
else |
| 5384 |
goto else4 |
| 5385 |
end |
| 5386 |
do |
| 5387 |
local tmp44 = _L[22](2) |
| 5388 |
local tmp45 = scanNegativeDigits(tmp44, _L[4], a1) |
| 5389 |
return tmp45(strm) |
| 5390 |
end |
| 5391 |
end |
| 5392 |
::else4:: |
| 5393 |
local tmp44 = _L[22](2) |
| 5394 |
local tmp45 = scanDigits(tmp44, _L[4], a1) |
| 5395 |
return tmp45(strm) |
| 5396 |
end |
| 5397 |
::else1:: |
| 5398 |
if a == "OCT" then |
| 5399 |
else |
| 5400 |
goto else2 |
| 5401 |
end |
| 5402 |
do |
| 5403 |
local strm |
| 5404 |
do |
| 5405 |
local strm1 = _L[3](a1, a2) |
| 5406 |
local exp = _L[7](a1, strm1) |
| 5407 |
local isNegative = exp[1] |
| 5408 |
strm = exp[2] |
| 5409 |
if isNegative then |
| 5410 |
else |
| 5411 |
goto else4 |
| 5412 |
end |
| 5413 |
do |
| 5414 |
local tmp44 = _L[22](8) |
| 5415 |
local tmp45 = scanNegativeDigits(tmp44, _L[5], a1) |
| 5416 |
return tmp45(strm) |
| 5417 |
end |
| 5418 |
end |
| 5419 |
::else4:: |
| 5420 |
local tmp44 = _L[22](8) |
| 5421 |
local tmp45 = scanDigits(tmp44, _L[5], a1) |
| 5422 |
return tmp45(strm) |
| 5423 |
end |
| 5424 |
::else2:: |
| 5425 |
if a == "DEC" then |
| 5426 |
else |
| 5427 |
goto else3 |
| 5428 |
end |
| 5429 |
do |
| 5430 |
local strm |
| 5431 |
do |
| 5432 |
local strm1 = _L[3](a1, a2) |
| 5433 |
local exp = _L[7](a1, strm1) |
| 5434 |
local isNegative = exp[1] |
| 5435 |
strm = exp[2] |
| 5436 |
if isNegative then |
| 5437 |
else |
| 5438 |
goto else4 |
| 5439 |
end |
| 5440 |
do |
| 5441 |
local tmp44 = _L[22](10) |
| 5442 |
local tmp45 = scanNegativeDigits(tmp44, isDigit, a1) |
| 5443 |
return tmp45(strm) |
| 5444 |
end |
| 5445 |
end |
| 5446 |
::else4:: |
| 5447 |
local tmp44 = _L[22](10) |
| 5448 |
local tmp45 = scanDigits(tmp44, isDigit, a1) |
| 5449 |
return tmp45(strm) |
| 5450 |
end |
| 5451 |
::else3:: |
| 5452 |
if a == "HEX" then |
| 5453 |
else |
| 5454 |
_raise(_Match, "int-inf.sml:971:5") |
| 5455 |
end |
| 5456 |
do |
| 5457 |
local isNegative, strm |
| 5458 |
do |
| 5459 |
local strm1 = _L[3](a1, a2) |
| 5460 |
local exp = _L[7](a1, strm1) |
| 5461 |
isNegative = exp[1] |
| 5462 |
local strm2 = exp[2] |
| 5463 |
local exp1 = a1(strm2) |
| 5464 |
local tmp44 = exp1.tag == "SOME" and exp1.payload[1] == 48 |
| 5465 |
do |
| 5466 |
if tmp44 then |
| 5467 |
else |
| 5468 |
strm = strm2 |
| 5469 |
goto cont |
| 5470 |
end |
| 5471 |
do |
| 5472 |
local exp2 = a1(exp1.payload[2]) |
| 5473 |
if exp2.tag == "SOME" then |
| 5474 |
elseif exp2.tag == "NONE" then |
| 5475 |
strm = strm2 |
| 5476 |
goto cont |
| 5477 |
else |
| 5478 |
_raise(_Match, "int-inf.sml:996:56") |
| 5479 |
end |
| 5480 |
do |
| 5481 |
local c = exp2.payload[1] |
| 5482 |
local strm_PRIME_PRIME = exp2.payload[2] |
| 5483 |
if c == 120 or c == 88 then |
| 5484 |
else |
| 5485 |
strm = strm2 |
| 5486 |
goto cont |
| 5487 |
end |
| 5488 |
do |
| 5489 |
local exp3 = a1(strm_PRIME_PRIME) |
| 5490 |
if exp3.tag == "SOME" then |
| 5491 |
elseif exp3.tag == "NONE" then |
| 5492 |
strm = strm2 |
| 5493 |
goto cont |
| 5494 |
else |
| 5495 |
_raise(_Match, "int-inf.sml:999:64") |
| 5496 |
end |
| 5497 |
do |
| 5498 |
local tmp45 = isHexDigit(exp3.payload[1]) |
| 5499 |
if tmp45 then |
| 5500 |
strm = strm_PRIME_PRIME |
| 5501 |
else |
| 5502 |
strm = strm2 |
| 5503 |
end |
| 5504 |
end |
| 5505 |
end |
| 5506 |
end |
| 5507 |
end |
| 5508 |
end |
| 5509 |
end |
| 5510 |
::cont:: |
| 5511 |
if isNegative then |
| 5512 |
else |
| 5513 |
goto else4 |
| 5514 |
end |
| 5515 |
do |
| 5516 |
local tmp44 = _L[22](16) |
| 5517 |
local tmp45 = scanNegativeDigits(tmp44, isHexDigit, a1) |
| 5518 |
return tmp45(strm) |
| 5519 |
end |
| 5520 |
::else4:: |
| 5521 |
local tmp44 = _L[22](16) |
| 5522 |
local tmp45 = scanDigits(tmp44, isHexDigit, a1) |
| 5523 |
return tmp45(strm) |
| 5524 |
end |
| 5525 |
end |
| 5526 |
end |
| 5527 |
do |
| 5528 |
local tmp44, tmp45, tmp46 |
| 5529 |
do |
| 5530 |
local tmp47 = 2.0 |
| 5531 |
tmp46, tmp45, tmp44 = tmp47, tmp24, 1.0 |
| 5532 |
end |
| 5533 |
::cont5:: |
| 5534 |
do |
| 5535 |
local _L1 = {} |
| 5536 |
local a, tmp47, acc = tmp46, tmp45, tmp44 |
| 5537 |
if tmp47 == 0 then |
| 5538 |
tmp43 = acc |
| 5539 |
goto cont1 |
| 5540 |
end |
| 5541 |
if tmp47 == 1 then |
| 5542 |
tmp43 = acc * a |
| 5543 |
goto cont1 |
| 5544 |
end |
| 5545 |
local tmp48 = tmp47 // 2 |
| 5546 |
if tmp47 % 2 == 0 then |
| 5547 |
tmp46 = a * a |
| 5548 |
tmp45 = tmp48 |
| 5549 |
tmp44 = acc |
| 5550 |
goto cont5 |
| 5551 |
else |
| 5552 |
local tmp49 = a * a |
| 5553 |
tmp46 = tmp49 |
| 5554 |
tmp45 = tmp48 |
| 5555 |
tmp44 = acc * a |
| 5556 |
goto cont5 |
| 5557 |
end |
| 5558 |
end |
| 5559 |
end |
| 5560 |
end |
| 5561 |
::cont1:: |
| 5562 |
local toRealAbs, Word8Vector, Word8Array, Word8ArraySlice, UnsafeWord8Array, tmp44, tmp45, tmp46, tmp47, tmp48 |
| 5563 |
do |
| 5564 |
local function wordToReal(a) |
| 5565 |
if a == 0x0 then |
| 5566 |
return 0.0 |
| 5567 |
end |
| 5568 |
local tmp49 = wordToReal(a >> 0x1F) |
| 5569 |
local tmp50 = tmp49 * 0x1p31 |
| 5570 |
local tmp51 = a & 0x7FFFFFFF |
| 5571 |
if tmp51 < 0x0 then |
| 5572 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5573 |
else |
| 5574 |
return tmp50 + tmp51 * 1.0 |
| 5575 |
end |
| 5576 |
end |
| 5577 |
local simpleNatToReal = function(a) |
| 5578 |
local tmp49 = function(a1) |
| 5579 |
local w = a1[1] |
| 5580 |
local tmp50 = a1[2] * tmp43 |
| 5581 |
local tmp51 = wordToReal(w) |
| 5582 |
return tmp50 + tmp51 |
| 5583 |
end |
| 5584 |
local tmp50 = foldr(tmp49, 0.0) |
| 5585 |
return tmp50(a) |
| 5586 |
end |
| 5587 |
toRealAbs = function(a) |
| 5588 |
local k |
| 5589 |
do |
| 5590 |
local tmp49 = _Int_sub(a.n, 1) |
| 5591 |
local tmp50 = _Int_mul(tmp24, tmp49) |
| 5592 |
local tmp51 = log2Word(a[tmp49 + 1]) |
| 5593 |
k = _Int_add(tmp50, tmp51) |
| 5594 |
end |
| 5595 |
if k < 53 then |
| 5596 |
else |
| 5597 |
goto else1 |
| 5598 |
end |
| 5599 |
do |
| 5600 |
return simpleNatToReal(a) |
| 5601 |
end |
| 5602 |
::else1:: |
| 5603 |
if k >= 1024 then |
| 5604 |
return tmp11 |
| 5605 |
end |
| 5606 |
local tmp49 = _Int_add(_Int_sub(k, 53), 1) |
| 5607 |
local q |
| 5608 |
do |
| 5609 |
local tmp50, tmp51, tmp52 |
| 5610 |
do |
| 5611 |
tmp50 = _Word_div(tmp49, tmp24) |
| 5612 |
tmp51 = _Word_mod(tmp49, tmp24) |
| 5613 |
local tmp53 = a.n |
| 5614 |
local tmp54 |
| 5615 |
if tmp50 < 0x0 then |
| 5616 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5617 |
else |
| 5618 |
tmp54 = tmp50 |
| 5619 |
end |
| 5620 |
tmp52 = _Int_sub(tmp53, tmp54) |
| 5621 |
if tmp52 <= 0 then |
| 5622 |
q = {n = 0} |
| 5623 |
goto cont |
| 5624 |
end |
| 5625 |
if tmp51 == 0x0 then |
| 5626 |
else |
| 5627 |
goto else4 |
| 5628 |
end |
| 5629 |
do |
| 5630 |
local tmp55 = _VectorOrArray_tabulate({tmp52, function(i) |
| 5631 |
if tmp50 < 0x0 then |
| 5632 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5633 |
else |
| 5634 |
return a[_Int_add(i, tmp50) + 1] |
| 5635 |
end |
| 5636 |
end}) |
| 5637 |
local tmp56 = _L[20](function(x) |
| 5638 |
return x ~= 0x0 |
| 5639 |
end) |
| 5640 |
if tmp50 < 0x0 then |
| 5641 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5642 |
end |
| 5643 |
local tmp57 = _L[19](a, 0, {tag = "SOME", payload = tmp50}) |
| 5644 |
tmp56(tmp57) |
| 5645 |
q = tmp55 |
| 5646 |
goto cont |
| 5647 |
end |
| 5648 |
end |
| 5649 |
::else4:: |
| 5650 |
local tmp53 = _Array_array(tmp52, 0x0) |
| 5651 |
local hasRemainder |
| 5652 |
do |
| 5653 |
local tmp54, tmp55 = 0x0, _Int_sub(tmp52, 1) |
| 5654 |
::cont2:: |
| 5655 |
do |
| 5656 |
local hi, i = tmp54, tmp55 |
| 5657 |
if i < 0 then |
| 5658 |
hasRemainder = hi ~= 0x0 |
| 5659 |
goto cont1 |
| 5660 |
end |
| 5661 |
local tmp56 |
| 5662 |
if tmp50 < 0x0 then |
| 5663 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5664 |
else |
| 5665 |
tmp56 = tmp50 |
| 5666 |
end |
| 5667 |
local tmp57 = a[_Int_add(i, tmp56) + 1] |
| 5668 |
local tmp58 = tmp57 >> tmp51 | hi |
| 5669 |
local tmp59 = tmp57 << tmp24 - tmp51 |
| 5670 |
tmp53[i + 1] = tmp58 |
| 5671 |
tmp54 = tmp59 |
| 5672 |
tmp55 = _Int_sub(i, 1) |
| 5673 |
goto cont2 |
| 5674 |
end |
| 5675 |
end |
| 5676 |
::cont1:: |
| 5677 |
do |
| 5678 |
if hasRemainder then |
| 5679 |
else |
| 5680 |
goto else5 |
| 5681 |
end |
| 5682 |
q = _L[24](tmp53) |
| 5683 |
goto cont |
| 5684 |
::else5:: |
| 5685 |
local tmp54 = _L[20](function(x) |
| 5686 |
return x ~= 0x0 |
| 5687 |
end) |
| 5688 |
if tmp50 < 0x0 then |
| 5689 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5690 |
end |
| 5691 |
local tmp55 = _L[19](a, 0, {tag = "SOME", payload = tmp50}) |
| 5692 |
tmp54(tmp55) |
| 5693 |
end |
| 5694 |
q = _L[24](tmp53) |
| 5695 |
end |
| 5696 |
::cont:: |
| 5697 |
local exp |
| 5698 |
do |
| 5699 |
local tmp50 = LShiftAbs({n = 1, 0x1}, tmp49) |
| 5700 |
local tmp51 = _L[26](tmp50, {n = 1, 0x1}) |
| 5701 |
local r |
| 5702 |
do |
| 5703 |
local l, tmp52, tmp53 |
| 5704 |
do |
| 5705 |
local tmp54 = a.n |
| 5706 |
local tmp55 = tmp51.n |
| 5707 |
if tmp54 < tmp55 then |
| 5708 |
l = tmp54 |
| 5709 |
else |
| 5710 |
l = tmp55 |
| 5711 |
end |
| 5712 |
tmp52 = _Array_array(l, 0x0) |
| 5713 |
tmp53 = 0 |
| 5714 |
end |
| 5715 |
::cont1:: |
| 5716 |
do |
| 5717 |
local a1 = tmp53 |
| 5718 |
if a1 == l then |
| 5719 |
else |
| 5720 |
local tmp54 = a[a1 + 1] |
| 5721 |
tmp52[a1 + 1] = tmp54 & tmp51[a1 + 1] |
| 5722 |
tmp53 = _Int_add(a1, 1) |
| 5723 |
goto cont1 |
| 5724 |
end |
| 5725 |
r = _L[24](tmp52) |
| 5726 |
end |
| 5727 |
end |
| 5728 |
local tmp52 = {n = 1, 0x1} |
| 5729 |
local tmp53 = LShiftAbs(tmp52, _Int_sub(tmp49, 1)) |
| 5730 |
exp = _L[23](r, tmp53) |
| 5731 |
if exp == "LESS" then |
| 5732 |
else |
| 5733 |
goto else2 |
| 5734 |
end |
| 5735 |
do |
| 5736 |
local tmp54 = simpleNatToReal(q) |
| 5737 |
return fromManExp(tmp49, tmp54) |
| 5738 |
end |
| 5739 |
end |
| 5740 |
::else2:: |
| 5741 |
if exp == "EQUAL" then |
| 5742 |
else |
| 5743 |
goto else3 |
| 5744 |
end |
| 5745 |
do |
| 5746 |
if q[0 + 1] & 0x1 == 0x0 then |
| 5747 |
else |
| 5748 |
goto else4 |
| 5749 |
end |
| 5750 |
do |
| 5751 |
local tmp50 = simpleNatToReal(q) |
| 5752 |
return fromManExp(tmp49, tmp50) |
| 5753 |
end |
| 5754 |
::else4:: |
| 5755 |
local tmp50 = _L[25](q, {n = 1, 0x1}) |
| 5756 |
local tmp51 = simpleNatToReal(tmp50) |
| 5757 |
return fromManExp(tmp49, tmp51) |
| 5758 |
end |
| 5759 |
::else3:: |
| 5760 |
if exp == "GREATER" then |
| 5761 |
else |
| 5762 |
_raise(_Match, "int-inf.sml:1073:33") |
| 5763 |
end |
| 5764 |
do |
| 5765 |
local tmp50 = _L[25](q, {n = 1, 0x1}) |
| 5766 |
local tmp51 = simpleNatToReal(tmp50) |
| 5767 |
return fromManExp(tmp49, tmp51) |
| 5768 |
end |
| 5769 |
end |
| 5770 |
local unsafeSub = function(a) |
| 5771 |
local v = a[1] |
| 5772 |
local tmp49 = sub1({v, a[2]}) |
| 5773 |
return tmp49 & 0xFF |
| 5774 |
end |
| 5775 |
local fromList = function(a) |
| 5776 |
local tmp49 = map(function(a1) |
| 5777 |
if a1 < 0x0 then |
| 5778 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5779 |
elseif a1 < 0 then |
| 5780 |
_raise(Chr, "char-1.sml:47:37") |
| 5781 |
elseif a1 > 255 then |
| 5782 |
_raise(Chr, "char-1.sml:47:37") |
| 5783 |
else |
| 5784 |
return a1 |
| 5785 |
end |
| 5786 |
end) |
| 5787 |
local tmp50 = tmp49(a) |
| 5788 |
return implode(tmp50) |
| 5789 |
end |
| 5790 |
local unsafeFromListN = function(a) |
| 5791 |
return fromList(a[2]) |
| 5792 |
end |
| 5793 |
_L[28] = function(a) |
| 5794 |
local xs = a[2] |
| 5795 |
local tmp49 = map(function(a1) |
| 5796 |
if a1 < 0x0 then |
| 5797 |
_raise(_Overflow, "word-1.sml:52:39") |
| 5798 |
elseif a1 < 0 then |
| 5799 |
_raise(Chr, "char-1.sml:47:37") |
| 5800 |
elseif a1 > 255 then |
| 5801 |
_raise(Chr, "char-1.sml:47:37") |
| 5802 |
else |
| 5803 |
return a1 |
| 5804 |
end |
| 5805 |
end) |
| 5806 |
local tmp50 = tmp49(xs) |
| 5807 |
return implodeRev(tmp50) |
| 5808 |
end |
| 5809 |
_L[29] = function(a) |
| 5810 |
local base = a.base |
| 5811 |
local start = a.start |
| 5812 |
return substring(base, start, a.length) |
| 5813 |
end |
| 5814 |
_L[30] = function(a) |
| 5815 |
return _Array_array(a, 0x0) |
| 5816 |
end |
| 5817 |
_L[31] = MonoSequence(_VectorOrArray_fromList, length, math_maxinteger, array, _L[30], function(a) |
| 5818 |
return _VectorOrArray_fromList(a[2]) |
| 5819 |
end, sub, update, concat, fromList, size, math_maxinteger, _L[29], _L[29], unsafeFromListN, _L[28], unsafeSub) |
| 5820 |
Word8Vector = _L[31]._MonoVector |
| 5821 |
_L[32] = _L[31]._MonoVectorSlice |
| 5822 |
Word8Array = _L[31]._MonoArray |
| 5823 |
Word8ArraySlice = _L[31]._MonoArraySlice |
| 5824 |
UnsafeWord8Array = _L[31]._UnsafeMonoArray |
| 5825 |
tmp44 = _L[32].concat |
| 5826 |
tmp45 = _L[32].full |
| 5827 |
tmp46 = _L[32].length |
| 5828 |
tmp47 = _L[32].slice |
| 5829 |
tmp48 = _L[32].vector |
| 5830 |
end |
| 5831 |
local tmp49 = Word8Vector.concat |
| 5832 |
local tmp50 = Word8Vector.fromList |
| 5833 |
local tmp51 = Word8Vector.length |
| 5834 |
local tmp52 = Word8Vector.sub |
| 5835 |
local tmp53 = Word8Vector.tabulate |
| 5836 |
_L[33] = Word8ArraySlice.base |
| 5837 |
_L[34] = Word8ArraySlice.copyVec |
| 5838 |
_L[35] = Word8ArraySlice.full |
| 5839 |
_L[36] = Word8ArraySlice.length |
| 5840 |
_L[37] = Word8ArraySlice.slice |
| 5841 |
_L[38] = Word8ArraySlice.vector |
| 5842 |
_L[39] = Word8Array.array |
| 5843 |
_L[40] = Word8Array.copyVec |
| 5844 |
_L[41] = Word8Array.length |
| 5845 |
_L[42] = Word8Array.maxLen |
| 5846 |
_L[43] = Word8Array.sub |
| 5847 |
_L[44] = Word8Array.tabulate |
| 5848 |
_L[45] = Word8Array.update |
| 5849 |
_L[46] = UnsafeWord8Array.sub |
| 5850 |
_L[47] = UnsafeWord8Array.update |
| 5851 |
_L[48] = function(a, i, bytesPerElem) |
| 5852 |
if i < 0 then |
| 5853 |
_raise(_Subscript, "pack-word.sml:29:48") |
| 5854 |
end |
| 5855 |
local tmp54 = _Int_mul(bytesPerElem, i) |
| 5856 |
local tmp55 = _L[41](a) |
| 5857 |
if tmp55 < _Int_add(tmp54, bytesPerElem) then |
| 5858 |
_raise(_Subscript, "pack-word.sml:33:55") |
| 5859 |
else |
| 5860 |
return tmp54 |
| 5861 |
end |
| 5862 |
end |
| 5863 |
_L[49] = function(a) |
| 5864 |
return function(a1) |
| 5865 |
local tmp54 = #a |
| 5866 |
local tmp55 = _Int_sub(#a1, tmp54) |
| 5867 |
local tmp56 = 0 |
| 5868 |
::cont:: |
| 5869 |
do |
| 5870 |
local a2 = tmp56 |
| 5871 |
if a2 > tmp55 then |
| 5872 |
return false |
| 5873 |
end |
| 5874 |
local tmp57 |
| 5875 |
do |
| 5876 |
local tmp58 = 0 |
| 5877 |
::cont2:: |
| 5878 |
do |
| 5879 |
local a3 = tmp58 |
| 5880 |
if a3 >= tmp54 then |
| 5881 |
tmp57 = true |
| 5882 |
goto cont1 |
| 5883 |
end |
| 5884 |
local tmp59 = tmp26({a, a3}) |
| 5885 |
local tmp60 = tmp26({a1, _Int_add(a2, a3)}) |
| 5886 |
if tmp59 == tmp60 then |
| 5887 |
tmp58 = _Int_add(a3, 1) |
| 5888 |
goto cont2 |
| 5889 |
else |
| 5890 |
tmp57 = false |
| 5891 |
end |
| 5892 |
end |
| 5893 |
end |
| 5894 |
::cont1:: |
| 5895 |
if tmp57 then |
| 5896 |
return true |
| 5897 |
else |
| 5898 |
tmp56 = _Int_add(a2, 1) |
| 5899 |
goto cont |
| 5900 |
end |
| 5901 |
end |
| 5902 |
end |
| 5903 |
end |
| 5904 |
_L[50] = {} |
| 5905 |
_L[50].year = 2001 |
| 5906 |
_L[50].month = 1 |
| 5907 |
_L[50].day = 1 |
| 5908 |
_L[50].hour = 0 |
| 5909 |
_L[51] = tmp18(_L[50]) |
| 5910 |
_L[52] = {tag = {"Time"}} |
| 5911 |
_L[53] = function(a) |
| 5912 |
local tmp54 = tmp13(a, _L[51]) |
| 5913 |
local status, exn = _handle(function() |
| 5914 |
local tmp55 = tmp54 * 1e6 |
| 5915 |
local tmp56 = tmp12(tmp55) |
| 5916 |
if math_type(tmp56) == "integer" then |
| 5917 |
return tmp56 |
| 5918 |
elseif tmp55 ~= tmp55 then |
| 5919 |
_raise(Domain, "real-1.sml:301:26") |
| 5920 |
else |
| 5921 |
_raise(_Overflow, "real-1.sml:303:26") |
| 5922 |
end |
| 5923 |
end) |
| 5924 |
if not status then |
| 5925 |
_raise(_L[52], "time.sml:79:82") |
| 5926 |
else |
| 5927 |
return exn |
| 5928 |
end |
| 5929 |
end |
| 5930 |
_L[54] = {} |
| 5931 |
_L[55] = {} |
| 5932 |
_L[55].__mode = "k" |
| 5933 |
setmetatable(_L[54], _L[55]) |
| 5934 |
_L[56] = {} |
| 5935 |
_L[57] = {} |
| 5936 |
_L[57].__mode = "v" |
| 5937 |
setmetatable(_L[56], _L[57]) |
| 5938 |
_L[58] = {{0, nil}} |
| 5939 |
_L[59] = function(a) |
| 5940 |
local tmp54 = _L[54][a] |
| 5941 |
if tmp54 == nil then |
| 5942 |
local d |
| 5943 |
do |
| 5944 |
local x = _L[58][1] |
| 5945 |
if x[2] == nil then |
| 5946 |
local n = x[1] |
| 5947 |
_L[58][1] = {_Int_add(n, 1), nil} |
| 5948 |
d = n |
| 5949 |
elseif x[2] ~= nil then |
| 5950 |
local n = x[1] |
| 5951 |
local tmp55 = x[2][1] |
| 5952 |
_L[58][1] = {n, x[2][2]} |
| 5953 |
d = tmp55 |
| 5954 |
else |
| 5955 |
_raise(_Match, "iodesc.sml:29:24") |
| 5956 |
end |
| 5957 |
end |
| 5958 |
_L[54][a] = d |
| 5959 |
_L[56][d] = a |
| 5960 |
return d |
| 5961 |
else |
| 5962 |
return tmp54 |
| 5963 |
end |
| 5964 |
end |
| 5965 |
_L[60] = function(a) |
| 5966 |
local tmp54 = _L[56][a] |
| 5967 |
if tmp54 ~= nil then |
| 5968 |
local x = _L[58][1] |
| 5969 |
local n = x[1] |
| 5970 |
_L[58][1] = {n, {a, x[2]}} |
| 5971 |
_L[56][a] = nil |
| 5972 |
_L[54][tmp54] = nil |
| 5973 |
return nil |
| 5974 |
else |
| 5975 |
return nil |
| 5976 |
end |
| 5977 |
end |
| 5978 |
_L[61] = {"SysErr"} |
| 5979 |
_L[62] = function(field, f) |
| 5980 |
if tmp23.tag == "SOME" then |
| 5981 |
elseif tmp23.tag == "NONE" then |
| 5982 |
return function(a) |
| 5983 |
_raise({tag = _L[61], payload = {"LuaFileSystem not available", NONE}}, "os.sml:56:70") |
| 5984 |
end |
| 5985 |
else |
| 5986 |
_raise(_Match, "os.sml:54:50") |
| 5987 |
end |
| 5988 |
do |
| 5989 |
return f(tmp23.payload[field]) |
| 5990 |
end |
| 5991 |
end |
| 5992 |
_L[63] = _L[62]("chdir", function(lfs_chdir) |
| 5993 |
return function(path) |
| 5994 |
local tmp54, tmp55 = lfs_chdir(path) |
| 5995 |
if not tmp54 then |
| 5996 |
local tmp56 = tmp6(tmp55) |
| 5997 |
if tmp56 == "string" then |
| 5998 |
_raise({tag = _L[61], payload = {tmp55, {tag = "SOME", payload = tmp55}}}, "os.sml:61:98") |
| 5999 |
else |
| 6000 |
_raise({tag = TypeError_tag, payload = "expected a string, but got " .. tmp56}, "lua.sml:467:37") |
| 6001 |
end |
| 6002 |
else |
| 6003 |
return nil |
| 6004 |
end |
| 6005 |
end |
| 6006 |
end) |
| 6007 |
_L[64] = _L[62]("currentdir", function(lfs_currentdir) |
| 6008 |
return function(a) |
| 6009 |
local tmp54, tmp55 = lfs_currentdir() |
| 6010 |
if tmp6(tmp54) == "string" then |
| 6011 |
return tmp54 |
| 6012 |
end |
| 6013 |
local tmp56 = tmp6(tmp55) |
| 6014 |
if tmp56 == "string" then |
| 6015 |
_raise({tag = _L[61], payload = {tmp55, {tag = "SOME", payload = tmp55}}}, "os.sml:73:102") |
| 6016 |
else |
| 6017 |
_raise({tag = TypeError_tag, payload = "expected a string, but got " .. tmp56}, "lua.sml:467:37") |
| 6018 |
end |
| 6019 |
end |
| 6020 |
end) |
| 6021 |
_L[65] = _L[62]("mkdir", function(lfs_mkdir) |
| 6022 |
return function(path) |
| 6023 |
local tmp54, tmp55 = lfs_mkdir(path) |
| 6024 |
if not tmp54 then |
| 6025 |
local tmp56 = tmp6(tmp55) |
| 6026 |
if tmp56 == "string" then |
| 6027 |
_raise({tag = _L[61], payload = {tmp55, {tag = "SOME", payload = tmp55}}}, "os.sml:81:98") |
| 6028 |
else |
| 6029 |
_raise({tag = TypeError_tag, payload = "expected a string, but got " .. tmp56}, "lua.sml:467:37") |
| 6030 |
end |
| 6031 |
else |
| 6032 |
return nil |
| 6033 |
end |
| 6034 |
end |
| 6035 |
end) |
| 6036 |
_L[66] = _L[62]("attributes", function(lfs_attributes) |
| 6037 |
return function(path) |
| 6038 |
local tmp54, tmp55 = lfs_attributes(path, "modification") |
| 6039 |
if not tmp54 then |
| 6040 |
local tmp56 = tmp6(tmp55) |
| 6041 |
if tmp56 == "string" then |
| 6042 |
_raise({tag = _L[61], payload = {tmp55, {tag = "SOME", payload = tmp55}}}, "os.sml:132:103") |
| 6043 |
else |
| 6044 |
_raise({tag = TypeError_tag, payload = "expected a string, but got " .. tmp56}, "lua.sml:467:37") |
| 6045 |
end |
| 6046 |
else |
| 6047 |
return _L[53](tmp54) |
| 6048 |
end |
| 6049 |
end |
| 6050 |
end) |
| 6051 |
_L[67] = _L[62]("attributes", function(lfs_attributes) |
| 6052 |
return function(path) |
| 6053 |
local tmp54, tmp55 = lfs_attributes(path, "size") |
| 6054 |
if not tmp54 then |
| 6055 |
local tmp56 = tmp6(tmp55) |
| 6056 |
if tmp56 == "string" then |
| 6057 |
_raise({tag = _L[61], payload = {tmp55, {tag = "SOME", payload = tmp55}}}, "os.sml:142:114") |
| 6058 |
else |
| 6059 |
_raise({tag = TypeError_tag, payload = "expected a string, but got " .. tmp56}, "lua.sml:467:37") |
| 6060 |
end |
| 6061 |
else |
| 6062 |
return tmp54 |
| 6063 |
end |
| 6064 |
end |
| 6065 |
end) |
| 6066 |
_L[68] = {tag = {"Path"}} |
| 6067 |
_L[69] = {tag = {"InvalidArc"}} |
| 6068 |
_L[70] = function(a) |
| 6069 |
local tmp54 = tmp32(function(c) |
| 6070 |
return c ~= 47 |
| 6071 |
end) |
| 6072 |
return tmp54(a) |
| 6073 |
end |
| 6074 |
_L[71] = function(a) |
| 6075 |
local dir = a.dir |
| 6076 |
local file = a.file |
| 6077 |
local arcs, isAbs, vol |
| 6078 |
do |
| 6079 |
local tmp54 = fields(function(c) |
| 6080 |
return c == 47 |
| 6081 |
end) |
| 6082 |
local exp = tmp54(dir) |
| 6083 |
if exp ~= nil and (exp[1] == "" and exp[2] == nil) then |
| 6084 |
vol = "" |
| 6085 |
isAbs = false |
| 6086 |
arcs = nil |
| 6087 |
elseif exp ~= nil and exp[1] == "" then |
| 6088 |
vol = "" |
| 6089 |
isAbs = true |
| 6090 |
arcs = exp[2] |
| 6091 |
else |
| 6092 |
vol = "" |
| 6093 |
isAbs = false |
| 6094 |
arcs = exp |
| 6095 |
end |
| 6096 |
end |
| 6097 |
local tmp54 = {file, nil} |
| 6098 |
local tmp55 |
| 6099 |
do |
| 6100 |
local tmp56 = revAppend(arcs, nil) |
| 6101 |
tmp55 = revAppend(tmp56, tmp54) |
| 6102 |
end |
| 6103 |
if vol ~= "" then |
| 6104 |
_raise(_L[68], "os-path-unix.sml:24:41") |
| 6105 |
end |
| 6106 |
if not isAbs and (tmp55 ~= nil and tmp55[1] == "") then |
| 6107 |
_raise(_L[68], "os-path-unix.sml:27:65") |
| 6108 |
end |
| 6109 |
local tmp56 = all(_L[70]) |
| 6110 |
local tmp57 = tmp56(tmp55) |
| 6111 |
if tmp57 then |
| 6112 |
if isAbs then |
| 6113 |
return "/" .. table_concat(_VectorOrArray_fromList(tmp55), "/") |
| 6114 |
else |
| 6115 |
return table_concat(_VectorOrArray_fromList(tmp55), "/") |
| 6116 |
end |
| 6117 |
else |
| 6118 |
_raise(_L[69], "os-path-unix.sml:34:54") |
| 6119 |
end |
| 6120 |
end |
| 6121 |
_L[72] = function(a) |
| 6122 |
local tmp54 |
| 6123 |
do |
| 6124 |
if #a >= 5 then |
| 6125 |
else |
| 6126 |
tmp54 = false |
| 6127 |
goto cont |
| 6128 |
end |
| 6129 |
do |
| 6130 |
local tmp55 = sub1({a, 0}) |
| 6131 |
if tmp55 == 47 or tmp55 == 92 then |
| 6132 |
else |
| 6133 |
tmp54 = false |
| 6134 |
goto cont |
| 6135 |
end |
| 6136 |
do |
| 6137 |
local tmp56 = sub1({a, 1}) |
| 6138 |
if tmp56 == 47 or tmp56 == 92 then |
| 6139 |
else |
| 6140 |
tmp54 = false |
| 6141 |
goto cont |
| 6142 |
end |
| 6143 |
do |
| 6144 |
local tmp57 = sub1({a, 2}) |
| 6145 |
tmp54 = tmp57 ~= 47 and tmp57 ~= 92 |
| 6146 |
end |
| 6147 |
end |
| 6148 |
end |
| 6149 |
end |
| 6150 |
::cont:: |
| 6151 |
if tmp54 then |
| 6152 |
else |
| 6153 |
return NONE |
| 6154 |
end |
| 6155 |
do |
| 6156 |
local tmp55 = 3 |
| 6157 |
::cont1:: |
| 6158 |
do |
| 6159 |
local a1 = tmp55 |
| 6160 |
if #a <= a1 then |
| 6161 |
return NONE |
| 6162 |
end |
| 6163 |
local tmp56 = sub1({a, a1}) |
| 6164 |
if tmp56 == 47 or tmp56 == 92 then |
| 6165 |
else |
| 6166 |
tmp55 = _Int_add(a1, 1) |
| 6167 |
goto cont1 |
| 6168 |
end |
| 6169 |
do |
| 6170 |
local tmp57 = _Int_add(a1, 1) |
| 6171 |
local tmp58 |
| 6172 |
do |
| 6173 |
if #a > tmp57 then |
| 6174 |
else |
| 6175 |
tmp58 = false |
| 6176 |
goto cont2 |
| 6177 |
end |
| 6178 |
do |
| 6179 |
local tmp59 = sub1({a, tmp57}) |
| 6180 |
tmp58 = tmp59 ~= 47 and tmp59 ~= 92 |
| 6181 |
end |
| 6182 |
end |
| 6183 |
::cont2:: |
| 6184 |
if tmp58 then |
| 6185 |
else |
| 6186 |
return NONE |
| 6187 |
end |
| 6188 |
do |
| 6189 |
local tmp59 = _Int_add(tmp57, 1) |
| 6190 |
::cont3:: |
| 6191 |
do |
| 6192 |
local a2 = tmp59 |
| 6193 |
if #a <= a2 then |
| 6194 |
return {tag = "SOME", payload = a2} |
| 6195 |
end |
| 6196 |
local tmp60 = sub1({a, a2}) |
| 6197 |
if tmp60 == 47 or tmp60 == 92 then |
| 6198 |
return {tag = "SOME", payload = a2} |
| 6199 |
else |
| 6200 |
tmp59 = _Int_add(a2, 1) |
| 6201 |
goto cont3 |
| 6202 |
end |
| 6203 |
end |
| 6204 |
end |
| 6205 |
end |
| 6206 |
end |
| 6207 |
end |
| 6208 |
end |
| 6209 |
_L[73] = {tag = "DOS_VOLUME"} |
| 6210 |
_L[74] = {tag = "NO_VOLUME"} |
| 6211 |
_L[75] = function(a) |
| 6212 |
local tmp54 = tmp32(function(c) |
| 6213 |
return c ~= 47 and c ~= 92 |
| 6214 |
end) |
| 6215 |
return tmp54(a) |
| 6216 |
end |
| 6217 |
_L[76] = function(a) |
| 6218 |
local vol, isAbs, tmp54, tmp55 |
| 6219 |
do |
| 6220 |
local dir = a.dir |
| 6221 |
local file = a.file |
| 6222 |
local arcs |
| 6223 |
do |
| 6224 |
local exp |
| 6225 |
do |
| 6226 |
local tmp56 |
| 6227 |
do |
| 6228 |
if #dir >= 2 then |
| 6229 |
else |
| 6230 |
tmp56 = false |
| 6231 |
goto cont3 |
| 6232 |
end |
| 6233 |
do |
| 6234 |
local tmp57 = sub1({dir, 1}) |
| 6235 |
if tmp57 == 58 then |
| 6236 |
else |
| 6237 |
tmp56 = false |
| 6238 |
goto cont3 |
| 6239 |
end |
| 6240 |
do |
| 6241 |
local tmp58 = sub1({dir, 0}) |
| 6242 |
tmp56 = 65 <= tmp58 and tmp58 <= 90 or 97 <= tmp58 and tmp58 <= 122 |
| 6243 |
end |
| 6244 |
end |
| 6245 |
end |
| 6246 |
::cont3:: |
| 6247 |
if tmp56 then |
| 6248 |
exp = _L[73] |
| 6249 |
goto cont1 |
| 6250 |
end |
| 6251 |
local exp1 = _L[72](dir) |
| 6252 |
if exp1.tag == "SOME" then |
| 6253 |
exp = {tag = "UNC_PATH", payload = exp1.payload} |
| 6254 |
elseif exp1.tag == "NONE" then |
| 6255 |
exp = _L[74] |
| 6256 |
else |
| 6257 |
_raise(_Match, "os-path-windows.sml:44:27") |
| 6258 |
end |
| 6259 |
end |
| 6260 |
::cont1:: |
| 6261 |
local isUNC, vol1, rest |
| 6262 |
do |
| 6263 |
if exp.tag == "DOS_VOLUME" then |
| 6264 |
else |
| 6265 |
goto else1 |
| 6266 |
end |
| 6267 |
do |
| 6268 |
local tmp56 = substring(dir, 0, 2) |
| 6269 |
local tmp57 = extract(dir, 2, NONE) |
| 6270 |
rest = tmp57 |
| 6271 |
vol1 = tmp56 |
| 6272 |
isUNC = false |
| 6273 |
goto cont2 |
| 6274 |
end |
| 6275 |
::else1:: |
| 6276 |
if exp.tag == "UNC_PATH" then |
| 6277 |
elseif exp.tag == "NO_VOLUME" then |
| 6278 |
rest = dir |
| 6279 |
vol1 = "" |
| 6280 |
isUNC = false |
| 6281 |
goto cont2 |
| 6282 |
else |
| 6283 |
_raise(_Match, "os-path-windows.sml:75:52") |
| 6284 |
end |
| 6285 |
do |
| 6286 |
local i = exp.payload |
| 6287 |
local tmp56 = substring(dir, 0, i) |
| 6288 |
local tmp57 = extract(dir, i, NONE) |
| 6289 |
rest = tmp57 |
| 6290 |
vol1 = tmp56 |
| 6291 |
isUNC = true |
| 6292 |
end |
| 6293 |
end |
| 6294 |
::cont2:: |
| 6295 |
local tmp56 = fields(function(c) |
| 6296 |
return c == 47 or c == 92 |
| 6297 |
end) |
| 6298 |
local exp1 = tmp56(rest) |
| 6299 |
if exp1 ~= nil and (exp1[1] == "" and exp1[2] == nil) then |
| 6300 |
vol = vol1 |
| 6301 |
isAbs = isUNC |
| 6302 |
arcs = nil |
| 6303 |
elseif exp1 ~= nil and exp1[1] == "" then |
| 6304 |
vol = vol1 |
| 6305 |
isAbs = true |
| 6306 |
arcs = exp1[2] |
| 6307 |
else |
| 6308 |
vol = vol1 |
| 6309 |
isAbs = isUNC |
| 6310 |
arcs = exp1 |
| 6311 |
end |
| 6312 |
end |
| 6313 |
local tmp56 = {file, nil} |
| 6314 |
do |
| 6315 |
local tmp57 = revAppend(arcs, nil) |
| 6316 |
tmp54 = revAppend(tmp57, tmp56) |
| 6317 |
end |
| 6318 |
do |
| 6319 |
if not isAbs and vol == "" then |
| 6320 |
tmp55 = true |
| 6321 |
goto cont |
| 6322 |
end |
| 6323 |
local tmp57 |
| 6324 |
do |
| 6325 |
if #vol == 2 then |
| 6326 |
else |
| 6327 |
tmp57 = false |
| 6328 |
goto cont1 |
| 6329 |
end |
| 6330 |
do |
| 6331 |
local tmp58 = sub1({vol, 0}) |
| 6332 |
local tmp59 |
| 6333 |
tmp59 = 65 <= tmp58 and tmp58 <= 90 or 97 <= tmp58 and tmp58 <= 122 |
| 6334 |
if tmp59 then |
| 6335 |
else |
| 6336 |
tmp57 = false |
| 6337 |
goto cont1 |
| 6338 |
end |
| 6339 |
do |
| 6340 |
local tmp60 = sub1({vol, 1}) |
| 6341 |
tmp57 = tmp60 == 58 |
| 6342 |
end |
| 6343 |
end |
| 6344 |
end |
| 6345 |
::cont1:: |
| 6346 |
if tmp57 then |
| 6347 |
tmp55 = true |
| 6348 |
goto cont |
| 6349 |
end |
| 6350 |
if isAbs then |
| 6351 |
else |
| 6352 |
tmp55 = false |
| 6353 |
goto cont |
| 6354 |
end |
| 6355 |
do |
| 6356 |
local exp = _L[72](vol) |
| 6357 |
if exp.tag == "SOME" then |
| 6358 |
local i = exp.payload |
| 6359 |
tmp55 = i == #vol |
| 6360 |
elseif exp.tag == "NONE" then |
| 6361 |
tmp55 = false |
| 6362 |
else |
| 6363 |
_raise(_Match, "os-path-windows.sml:73:56") |
| 6364 |
end |
| 6365 |
end |
| 6366 |
end |
| 6367 |
end |
| 6368 |
::cont:: |
| 6369 |
if not tmp55 then |
| 6370 |
_raise(_L[68], "os-path-windows.sml:87:41") |
| 6371 |
end |
| 6372 |
if not isAbs and #vol >= 3 then |
| 6373 |
_raise(_L[68], "os-path-windows.sml:89:41") |
| 6374 |
end |
| 6375 |
if not isAbs and (tmp54 ~= nil and tmp54[1] == "") then |
| 6376 |
_raise(_L[68], "os-path-windows.sml:92:65") |
| 6377 |
end |
| 6378 |
local tmp56 = all(_L[75]) |
| 6379 |
local tmp57 = tmp56(tmp54) |
| 6380 |
if tmp57 then |
| 6381 |
if isAbs then |
| 6382 |
local tmp58 = vol .. "\\" |
| 6383 |
return tmp58 .. table_concat(_VectorOrArray_fromList(tmp54), "\\") |
| 6384 |
else |
| 6385 |
return vol .. table_concat(_VectorOrArray_fromList(tmp54), "\\") |
| 6386 |
end |
| 6387 |
else |
| 6388 |
_raise(_L[69], "os-path-windows.sml:99:54") |
| 6389 |
end |
| 6390 |
end |
| 6391 |
do |
| 6392 |
_L[78] = sub1({tmp2.config, 0}) |
| 6393 |
if _L[78] == 92 then |
| 6394 |
_L[77] = _L[76] |
| 6395 |
else |
| 6396 |
_L[77] = _L[71] |
| 6397 |
end |
| 6398 |
end |
| 6399 |
_L[79] = function(tmp54, tmp55, tmp56, tmp57, tmp58, tmp59, tmp60, tmp61, tmp62, tmp63, tmp64, tmp65, tmp66, tmp67, compare1, tmp68) |
| 6400 |
local RD = function(payload) |
| 6401 |
return payload |
| 6402 |
end |
| 6403 |
local WR = function(payload) |
| 6404 |
return payload |
| 6405 |
end |
| 6406 |
local openVector = function(a) |
| 6407 |
local tmp69 = {0} |
| 6408 |
local tmp70 = {false} |
| 6409 |
local readVec = function(a1) |
| 6410 |
if a1 < 0 then |
| 6411 |
_raise(_Size, "prim-io.sml:112:31") |
| 6412 |
end |
| 6413 |
local x = tmp69[1] |
| 6414 |
local total = tmp63(a) |
| 6415 |
local tmp71 = _Int_add(x, a1) |
| 6416 |
local newPos |
| 6417 |
if tmp71 < total then |
| 6418 |
newPos = tmp71 |
| 6419 |
else |
| 6420 |
newPos = total |
| 6421 |
end |
| 6422 |
tmp69[1] = newPos |
| 6423 |
local tmp72 = tmp66({a, x, {tag = "SOME", payload = _Int_sub(newPos, x)}}) |
| 6424 |
return tmp67(tmp72) |
| 6425 |
end |
| 6426 |
local readArr = function(a1) |
| 6427 |
local x = tmp69[1] |
| 6428 |
local total = tmp63(a) |
| 6429 |
local tmp71 = tmp59(a1) |
| 6430 |
local tmp72 = _Int_add(x, tmp71) |
| 6431 |
local newPos |
| 6432 |
if tmp72 < total then |
| 6433 |
newPos = tmp72 |
| 6434 |
else |
| 6435 |
newPos = total |
| 6436 |
end |
| 6437 |
local exp = tmp56(a1) |
| 6438 |
local baseArr = exp[1] |
| 6439 |
local start = exp[2] |
| 6440 |
local tmp73 = _Int_sub(newPos, x) |
| 6441 |
tmp69[1] = newPos |
| 6442 |
local tmp74 = tmp66({a, x, {tag = "SOME", payload = tmp73}}) |
| 6443 |
tmp57({di = start, dst = baseArr, src = tmp74}) |
| 6444 |
return tmp73 |
| 6445 |
end |
| 6446 |
local tmp71 = tmp63(a) |
| 6447 |
local tmp72 = {tag = "SOME", payload = function(n) |
| 6448 |
if tmp70[1] then |
| 6449 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "readVec", name = "<openVector>"}}, "prim-io.sml:108:36") |
| 6450 |
else |
| 6451 |
return readVec(n) |
| 6452 |
end |
| 6453 |
end} |
| 6454 |
local tmp73 = {tag = "SOME", payload = function(slice) |
| 6455 |
if tmp70[1] then |
| 6456 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "readArr", name = "<openVector>"}}, "prim-io.sml:108:36") |
| 6457 |
else |
| 6458 |
return readArr(slice) |
| 6459 |
end |
| 6460 |
end} |
| 6461 |
local tmp74 = {tag = "SOME", payload = function(n) |
| 6462 |
if tmp70[1] then |
| 6463 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "readVecNB", name = "<openVector>"}}, "prim-io.sml:108:36") |
| 6464 |
end |
| 6465 |
local tmp75 = readVec(n) |
| 6466 |
return {tag = "SOME", payload = tmp75} |
| 6467 |
end} |
| 6468 |
local tmp75 = {tag = "SOME", payload = function(slice) |
| 6469 |
if tmp70[1] then |
| 6470 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "readArrNB", name = "<openVector>"}}, "prim-io.sml:108:36") |
| 6471 |
end |
| 6472 |
local tmp76 = readArr(slice) |
| 6473 |
return {tag = "SOME", payload = tmp76} |
| 6474 |
end} |
| 6475 |
local tmp76 = {tag = "SOME", payload = function(a1) |
| 6476 |
if tmp70[1] then |
| 6477 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "block", name = "<openVector>"}}, "prim-io.sml:108:36") |
| 6478 |
else |
| 6479 |
return nil |
| 6480 |
end |
| 6481 |
end} |
| 6482 |
local tmp77 = {tag = "SOME", payload = function(a1) |
| 6483 |
if tmp70[1] then |
| 6484 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "canInput", name = "<openVector>"}}, "prim-io.sml:108:36") |
| 6485 |
else |
| 6486 |
return true |
| 6487 |
end |
| 6488 |
end} |
| 6489 |
local tmp78 = function(a1) |
| 6490 |
if tmp70[1] then |
| 6491 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "avail", name = "<openVector>"}}, "prim-io.sml:108:36") |
| 6492 |
end |
| 6493 |
local tmp79 = tmp63(a) |
| 6494 |
return {tag = "SOME", payload = _Int_sub(tmp79, tmp69[1])} |
| 6495 |
end |
| 6496 |
return {avail = tmp78, block = tmp76, canInput = tmp77, chunkSize = tmp71, close = function(a1) |
| 6497 |
tmp70[1] = true |
| 6498 |
return nil |
| 6499 |
end, endPos = NONE, getPos = NONE, ioDesc = NONE, name = "<openVector>", readArr = tmp73, readArrNB = tmp75, readVec = tmp72, readVecNB = tmp74, setPos = NONE, verifyPos = NONE} |
| 6500 |
end |
| 6501 |
local nullRd = function(a) |
| 6502 |
local tmp69 = {false} |
| 6503 |
local empty = tmp62(nil) |
| 6504 |
local tmp70 = {tag = "SOME", payload = function(n) |
| 6505 |
if tmp69[1] then |
| 6506 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "readVec", name = "<nullRd>"}}, "prim-io.sml:149:46") |
| 6507 |
elseif n < 0 then |
| 6508 |
_raise(_Size, "prim-io.sml:155:81") |
| 6509 |
else |
| 6510 |
return empty |
| 6511 |
end |
| 6512 |
end} |
| 6513 |
local tmp71 = {tag = "SOME", payload = function(slice) |
| 6514 |
if tmp69[1] then |
| 6515 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "readArr", name = "<nullRd>"}}, "prim-io.sml:149:46") |
| 6516 |
else |
| 6517 |
return 0 |
| 6518 |
end |
| 6519 |
end} |
| 6520 |
local tmp72 = {tag = "SOME", payload = function(n) |
| 6521 |
if tmp69[1] then |
| 6522 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "readVecNB", name = "<nullRd>"}}, "prim-io.sml:149:46") |
| 6523 |
else |
| 6524 |
return {tag = "SOME", payload = empty} |
| 6525 |
end |
| 6526 |
end} |
| 6527 |
local tmp73 = {tag = "SOME", payload = function(slice) |
| 6528 |
if tmp69[1] then |
| 6529 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "readArrNB", name = "<nullRd>"}}, "prim-io.sml:149:46") |
| 6530 |
else |
| 6531 |
return {tag = "SOME", payload = 0} |
| 6532 |
end |
| 6533 |
end} |
| 6534 |
local tmp74 = {tag = "SOME", payload = function(a1) |
| 6535 |
if tmp69[1] then |
| 6536 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "block", name = "<nullRd>"}}, "prim-io.sml:149:46") |
| 6537 |
else |
| 6538 |
return nil |
| 6539 |
end |
| 6540 |
end} |
| 6541 |
local tmp75 = {tag = "SOME", payload = function(a1) |
| 6542 |
if tmp69[1] then |
| 6543 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "canInput", name = "<nullRd>"}}, "prim-io.sml:149:46") |
| 6544 |
else |
| 6545 |
return true |
| 6546 |
end |
| 6547 |
end} |
| 6548 |
local tmp76 = function(a1) |
| 6549 |
return {tag = "SOME", payload = 0} |
| 6550 |
end |
| 6551 |
return {avail = tmp76, block = tmp74, canInput = tmp75, chunkSize = 1, close = function(a1) |
| 6552 |
tmp69[1] = true |
| 6553 |
return nil |
| 6554 |
end, endPos = NONE, getPos = NONE, ioDesc = NONE, name = "<nullRd>", readArr = tmp71, readArrNB = tmp73, readVec = tmp70, readVecNB = tmp72, setPos = NONE, verifyPos = NONE} |
| 6555 |
end |
| 6556 |
local nullWr = function(a) |
| 6557 |
local tmp69 = {false} |
| 6558 |
local tmp70 = {tag = "SOME", payload = function(slice) |
| 6559 |
if tmp69[1] then |
| 6560 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "writeVec", name = "<nullWr>"}}, "prim-io.sml:173:46") |
| 6561 |
else |
| 6562 |
return tmp65(slice) |
| 6563 |
end |
| 6564 |
end} |
| 6565 |
local tmp71 = {tag = "SOME", payload = function(slice) |
| 6566 |
if tmp69[1] then |
| 6567 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "writeArr", name = "<nullWr>"}}, "prim-io.sml:173:46") |
| 6568 |
else |
| 6569 |
return tmp59(slice) |
| 6570 |
end |
| 6571 |
end} |
| 6572 |
local tmp72 = {tag = "SOME", payload = function(slice) |
| 6573 |
if tmp69[1] then |
| 6574 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "writeVecNB", name = "<nullWr>"}}, "prim-io.sml:173:46") |
| 6575 |
end |
| 6576 |
local tmp73 = tmp65(slice) |
| 6577 |
return {tag = "SOME", payload = tmp73} |
| 6578 |
end} |
| 6579 |
local tmp73 = {tag = "SOME", payload = function(slice) |
| 6580 |
if tmp69[1] then |
| 6581 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "writeArrNB", name = "<nullWr>"}}, "prim-io.sml:173:46") |
| 6582 |
end |
| 6583 |
local tmp74 = tmp59(slice) |
| 6584 |
return {tag = "SOME", payload = tmp74} |
| 6585 |
end} |
| 6586 |
local tmp74 = {tag = "SOME", payload = function(a1) |
| 6587 |
if tmp69[1] then |
| 6588 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "block", name = "<nullWr>"}}, "prim-io.sml:173:46") |
| 6589 |
else |
| 6590 |
return nil |
| 6591 |
end |
| 6592 |
end} |
| 6593 |
local tmp75 = {tag = "SOME", payload = function(a1) |
| 6594 |
if tmp69[1] then |
| 6595 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "canOutput", name = "<nullWr>"}}, "prim-io.sml:173:46") |
| 6596 |
else |
| 6597 |
return true |
| 6598 |
end |
| 6599 |
end} |
| 6600 |
return {block = tmp74, canOutput = tmp75, chunkSize = 1, close = function(a1) |
| 6601 |
tmp69[1] = true |
| 6602 |
return nil |
| 6603 |
end, endPos = NONE, getPos = NONE, ioDesc = NONE, name = "<nullWr>", setPos = NONE, verifyPos = NONE, writeArr = tmp71, writeArrNB = tmp73, writeVec = tmp70, writeVecNB = tmp72} |
| 6604 |
end |
| 6605 |
local augmentReader = function(a) |
| 6606 |
local name, chunkSize, readVec, readArr, readVecNB, readArrNB, block, canInput, avail, getPos, setPos, endPos, verifyPos, close, ioDesc, readVec_PRIME |
| 6607 |
do |
| 6608 |
name = a.name |
| 6609 |
chunkSize = a.chunkSize |
| 6610 |
readVec = a.readVec |
| 6611 |
readArr = a.readArr |
| 6612 |
readVecNB = a.readVecNB |
| 6613 |
readArrNB = a.readArrNB |
| 6614 |
block = a.block |
| 6615 |
canInput = a.canInput |
| 6616 |
avail = a.avail |
| 6617 |
getPos = a.getPos |
| 6618 |
setPos = a.setPos |
| 6619 |
endPos = a.endPos |
| 6620 |
verifyPos = a.verifyPos |
| 6621 |
close = a.close |
| 6622 |
ioDesc = a.ioDesc |
| 6623 |
local empty = tmp62(nil) |
| 6624 |
if readVec.tag == "SOME" then |
| 6625 |
readVec_PRIME = readVec |
| 6626 |
goto cont |
| 6627 |
end |
| 6628 |
if readVec.tag == "NONE" then |
| 6629 |
if readArr.tag == "SOME" then |
| 6630 |
local ra = readArr.payload |
| 6631 |
readVec_PRIME = {tag = "SOME", payload = function(n) |
| 6632 |
local arr = tmp54({n, tmp68}) |
| 6633 |
local tmp69 = tmp58(arr) |
| 6634 |
local actual = ra(tmp69) |
| 6635 |
local tmp70 = tmp60({arr, 0, {tag = "SOME", payload = actual}}) |
| 6636 |
return tmp61(tmp70) |
| 6637 |
end} |
| 6638 |
goto cont |
| 6639 |
end |
| 6640 |
if readArr.tag == "NONE" then |
| 6641 |
if block.tag == "SOME" and readVecNB.tag == "SOME" then |
| 6642 |
local block_PRIME = block.payload |
| 6643 |
local rvNB = readVecNB.payload |
| 6644 |
readVec_PRIME = {tag = "SOME", payload = function(n) |
| 6645 |
if n < 0 then |
| 6646 |
_raise(_Size, "prim-io.sml:205:72") |
| 6647 |
end |
| 6648 |
local exp = rvNB(n) |
| 6649 |
if exp.tag == "SOME" then |
| 6650 |
return exp.payload |
| 6651 |
end |
| 6652 |
if exp.tag == "NONE" then |
| 6653 |
else |
| 6654 |
_raise(_Match, "prim-io.sml:207:72") |
| 6655 |
end |
| 6656 |
do |
| 6657 |
block_PRIME(nil) |
| 6658 |
local exp1 = rvNB(n) |
| 6659 |
if exp1.tag == "SOME" then |
| 6660 |
return exp1.payload |
| 6661 |
elseif exp1.tag == "NONE" then |
| 6662 |
return empty |
| 6663 |
else |
| 6664 |
_raise(_Match, "prim-io.sml:210:86") |
| 6665 |
end |
| 6666 |
end |
| 6667 |
end} |
| 6668 |
elseif block.tag == "SOME" and (readVecNB.tag == "NONE" and readArrNB.tag == "SOME") then |
| 6669 |
local block_PRIME = block.payload |
| 6670 |
local raNB = readArrNB.payload |
| 6671 |
readVec_PRIME = {tag = "SOME", payload = function(n) |
| 6672 |
if n < 0 then |
| 6673 |
_raise(_Size, "prim-io.sml:217:72") |
| 6674 |
end |
| 6675 |
local arr = tmp54({n, tmp68}) |
| 6676 |
local aslice = tmp58(arr) |
| 6677 |
local exp = raNB(aslice) |
| 6678 |
if exp.tag == "SOME" then |
| 6679 |
else |
| 6680 |
goto else1 |
| 6681 |
end |
| 6682 |
do |
| 6683 |
local tmp69 = tmp60({arr, 0, {tag = "SOME", payload = exp.payload}}) |
| 6684 |
return tmp61(tmp69) |
| 6685 |
end |
| 6686 |
::else1:: |
| 6687 |
if exp.tag == "NONE" then |
| 6688 |
else |
| 6689 |
_raise(_Match, "prim-io.sml:221:75") |
| 6690 |
end |
| 6691 |
do |
| 6692 |
block_PRIME(nil) |
| 6693 |
local exp1 = raNB(aslice) |
| 6694 |
if exp1.tag == "SOME" then |
| 6695 |
elseif exp1.tag == "NONE" then |
| 6696 |
return empty |
| 6697 |
else |
| 6698 |
_raise(_Match, "prim-io.sml:224:89") |
| 6699 |
end |
| 6700 |
do |
| 6701 |
local tmp69 = tmp60({arr, 0, {tag = "SOME", payload = exp1.payload}}) |
| 6702 |
return tmp61(tmp69) |
| 6703 |
end |
| 6704 |
end |
| 6705 |
end} |
| 6706 |
else |
| 6707 |
readVec_PRIME = NONE |
| 6708 |
end |
| 6709 |
else |
| 6710 |
_raise(_Match, "prim-io.sml:196:38") |
| 6711 |
end |
| 6712 |
else |
| 6713 |
_raise(_Match, "prim-io.sml:194:26") |
| 6714 |
end |
| 6715 |
end |
| 6716 |
::cont:: |
| 6717 |
local readArr_PRIME |
| 6718 |
if readArr.tag == "SOME" then |
| 6719 |
readArr_PRIME = readArr |
| 6720 |
goto cont1 |
| 6721 |
end |
| 6722 |
if readArr.tag == "NONE" then |
| 6723 |
if readVec.tag == "SOME" then |
| 6724 |
local rv = readVec.payload |
| 6725 |
readArr_PRIME = {tag = "SOME", payload = function(slice) |
| 6726 |
local tmp69 = tmp59(slice) |
| 6727 |
local v = rv(tmp69) |
| 6728 |
local exp = tmp56(slice) |
| 6729 |
tmp55({di = exp[2], dst = exp[1], src = v}) |
| 6730 |
return tmp63(v) |
| 6731 |
end} |
| 6732 |
goto cont1 |
| 6733 |
end |
| 6734 |
if readVec.tag == "NONE" then |
| 6735 |
if block.tag == "SOME" and readArrNB.tag == "SOME" then |
| 6736 |
local block_PRIME = block.payload |
| 6737 |
local raNB = readArrNB.payload |
| 6738 |
readArr_PRIME = {tag = "SOME", payload = function(slice) |
| 6739 |
local exp = raNB(slice) |
| 6740 |
if exp.tag == "SOME" then |
| 6741 |
return exp.payload |
| 6742 |
end |
| 6743 |
if exp.tag == "NONE" then |
| 6744 |
else |
| 6745 |
_raise(_Match, "prim-io.sml:242:72") |
| 6746 |
end |
| 6747 |
do |
| 6748 |
block_PRIME(nil) |
| 6749 |
local exp1 = raNB(slice) |
| 6750 |
if exp1.tag == "SOME" then |
| 6751 |
return exp1.payload |
| 6752 |
elseif exp1.tag == "NONE" then |
| 6753 |
return 0 |
| 6754 |
else |
| 6755 |
_raise(_Match, "prim-io.sml:245:86") |
| 6756 |
end |
| 6757 |
end |
| 6758 |
end} |
| 6759 |
elseif block.tag == "SOME" and (readVecNB.tag == "SOME" and readArrNB.tag == "NONE") then |
| 6760 |
local block_PRIME = block.payload |
| 6761 |
local rvNB = readVecNB.payload |
| 6762 |
readArr_PRIME = {tag = "SOME", payload = function(slice) |
| 6763 |
local n, base, start, exp |
| 6764 |
do |
| 6765 |
n = tmp59(slice) |
| 6766 |
local exp1 = tmp56(slice) |
| 6767 |
base = exp1[1] |
| 6768 |
start = exp1[2] |
| 6769 |
exp = rvNB(n) |
| 6770 |
if exp.tag == "SOME" then |
| 6771 |
else |
| 6772 |
goto else1 |
| 6773 |
end |
| 6774 |
do |
| 6775 |
local v = exp.payload |
| 6776 |
tmp55({di = start, dst = base, src = v}) |
| 6777 |
return tmp63(v) |
| 6778 |
end |
| 6779 |
end |
| 6780 |
::else1:: |
| 6781 |
if exp.tag == "NONE" then |
| 6782 |
else |
| 6783 |
_raise(_Match, "prim-io.sml:253:75") |
| 6784 |
end |
| 6785 |
do |
| 6786 |
block_PRIME(nil) |
| 6787 |
local exp1 = rvNB(n) |
| 6788 |
if exp1.tag == "SOME" then |
| 6789 |
elseif exp1.tag == "NONE" then |
| 6790 |
return 0 |
| 6791 |
else |
| 6792 |
_raise(_Match, "prim-io.sml:258:89") |
| 6793 |
end |
| 6794 |
do |
| 6795 |
local v = exp1.payload |
| 6796 |
tmp55({di = start, dst = base, src = v}) |
| 6797 |
return tmp63(v) |
| 6798 |
end |
| 6799 |
end |
| 6800 |
end} |
| 6801 |
else |
| 6802 |
readArr_PRIME = NONE |
| 6803 |
end |
| 6804 |
else |
| 6805 |
_raise(_Match, "prim-io.sml:233:38") |
| 6806 |
end |
| 6807 |
else |
| 6808 |
_raise(_Match, "prim-io.sml:231:26") |
| 6809 |
end |
| 6810 |
::cont1:: |
| 6811 |
local readVecNB_PRIME |
| 6812 |
if readVecNB.tag == "SOME" then |
| 6813 |
readVecNB_PRIME = readVecNB |
| 6814 |
goto cont2 |
| 6815 |
end |
| 6816 |
if readVecNB.tag == "NONE" then |
| 6817 |
if readArrNB.tag == "SOME" then |
| 6818 |
local raNB = readArrNB.payload |
| 6819 |
readVecNB_PRIME = {tag = "SOME", payload = function(n) |
| 6820 |
if n < 0 then |
| 6821 |
_raise(_Size, "prim-io.sml:271:75") |
| 6822 |
end |
| 6823 |
local arr = tmp54({n, tmp68}) |
| 6824 |
local tmp69 = tmp58(arr) |
| 6825 |
local exp = raNB(tmp69) |
| 6826 |
if exp.tag == "SOME" then |
| 6827 |
elseif exp.tag == "NONE" then |
| 6828 |
return NONE |
| 6829 |
else |
| 6830 |
_raise(_Match, "prim-io.sml:274:78") |
| 6831 |
end |
| 6832 |
do |
| 6833 |
local tmp70 = tmp60({arr, 0, {tag = "SOME", payload = exp.payload}}) |
| 6834 |
local tmp71 = tmp61(tmp70) |
| 6835 |
return {tag = "SOME", payload = tmp71} |
| 6836 |
end |
| 6837 |
end} |
| 6838 |
goto cont2 |
| 6839 |
end |
| 6840 |
if readArrNB.tag == "NONE" then |
| 6841 |
if canInput.tag == "SOME" and readVec.tag == "SOME" then |
| 6842 |
local canInput_PRIME = canInput.payload |
| 6843 |
local rv = readVec.payload |
| 6844 |
readVecNB_PRIME = {tag = "SOME", payload = function(n) |
| 6845 |
local tmp69 = canInput_PRIME(nil) |
| 6846 |
if tmp69 then |
| 6847 |
else |
| 6848 |
return NONE |
| 6849 |
end |
| 6850 |
do |
| 6851 |
local tmp70 = rv(n) |
| 6852 |
return {tag = "SOME", payload = tmp70} |
| 6853 |
end |
| 6854 |
end} |
| 6855 |
elseif canInput.tag == "SOME" and (readVec.tag == "NONE" and readArr.tag == "SOME") then |
| 6856 |
local canInput_PRIME = canInput.payload |
| 6857 |
local ra = readArr.payload |
| 6858 |
readVecNB_PRIME = {tag = "SOME", payload = function(n) |
| 6859 |
local tmp69 = canInput_PRIME(nil) |
| 6860 |
if tmp69 then |
| 6861 |
else |
| 6862 |
return NONE |
| 6863 |
end |
| 6864 |
do |
| 6865 |
if n < 0 then |
| 6866 |
_raise(_Size, "prim-io.sml:289:78") |
| 6867 |
end |
| 6868 |
local arr = tmp54({n, tmp68}) |
| 6869 |
local tmp70 = tmp58(arr) |
| 6870 |
local actual = ra(tmp70) |
| 6871 |
local tmp71 = tmp60({arr, 0, {tag = "SOME", payload = actual}}) |
| 6872 |
local tmp72 = tmp61(tmp71) |
| 6873 |
return {tag = "SOME", payload = tmp72} |
| 6874 |
end |
| 6875 |
end} |
| 6876 |
else |
| 6877 |
readVecNB_PRIME = NONE |
| 6878 |
end |
| 6879 |
else |
| 6880 |
_raise(_Match, "prim-io.sml:269:40") |
| 6881 |
end |
| 6882 |
else |
| 6883 |
_raise(_Match, "prim-io.sml:267:28") |
| 6884 |
end |
| 6885 |
::cont2:: |
| 6886 |
local readArrNB_PRIME |
| 6887 |
if readArrNB.tag == "SOME" then |
| 6888 |
readArrNB_PRIME = readArrNB |
| 6889 |
goto cont3 |
| 6890 |
end |
| 6891 |
if readArrNB.tag == "NONE" then |
| 6892 |
if readVecNB.tag == "SOME" then |
| 6893 |
local rvNB = readVecNB.payload |
| 6894 |
readArrNB_PRIME = {tag = "SOME", payload = function(slice) |
| 6895 |
local tmp69 = tmp59(slice) |
| 6896 |
local exp = rvNB(tmp69) |
| 6897 |
if exp.tag == "SOME" then |
| 6898 |
elseif exp.tag == "NONE" then |
| 6899 |
return NONE |
| 6900 |
else |
| 6901 |
_raise(_Match, "prim-io.sml:303:62") |
| 6902 |
end |
| 6903 |
do |
| 6904 |
local v = exp.payload |
| 6905 |
local exp1 = tmp56(slice) |
| 6906 |
tmp55({di = exp1[2], dst = exp1[1], src = v}) |
| 6907 |
local tmp70 = tmp63(v) |
| 6908 |
return {tag = "SOME", payload = tmp70} |
| 6909 |
end |
| 6910 |
end} |
| 6911 |
goto cont3 |
| 6912 |
end |
| 6913 |
if readVecNB.tag == "NONE" then |
| 6914 |
if canInput.tag == "SOME" and readArr.tag == "SOME" then |
| 6915 |
local canInput_PRIME = canInput.payload |
| 6916 |
local ra = readArr.payload |
| 6917 |
readArrNB_PRIME = {tag = "SOME", payload = function(slice) |
| 6918 |
local tmp69 = canInput_PRIME(nil) |
| 6919 |
if tmp69 then |
| 6920 |
else |
| 6921 |
return NONE |
| 6922 |
end |
| 6923 |
do |
| 6924 |
local tmp70 = ra(slice) |
| 6925 |
return {tag = "SOME", payload = tmp70} |
| 6926 |
end |
| 6927 |
end} |
| 6928 |
elseif canInput.tag == "SOME" and (readVec.tag == "SOME" and readArr.tag == "NONE") then |
| 6929 |
local canInput_PRIME = canInput.payload |
| 6930 |
local rv = readVec.payload |
| 6931 |
readArrNB_PRIME = {tag = "SOME", payload = function(slice) |
| 6932 |
local tmp69 = canInput_PRIME(nil) |
| 6933 |
if tmp69 then |
| 6934 |
else |
| 6935 |
return NONE |
| 6936 |
end |
| 6937 |
do |
| 6938 |
local tmp70 = tmp59(slice) |
| 6939 |
local v = rv(tmp70) |
| 6940 |
local exp = tmp56(slice) |
| 6941 |
tmp55({di = exp[2], dst = exp[1], src = v}) |
| 6942 |
local tmp71 = tmp63(v) |
| 6943 |
return {tag = "SOME", payload = tmp71} |
| 6944 |
end |
| 6945 |
end} |
| 6946 |
else |
| 6947 |
readArrNB_PRIME = NONE |
| 6948 |
end |
| 6949 |
else |
| 6950 |
_raise(_Match, "prim-io.sml:301:40") |
| 6951 |
end |
| 6952 |
else |
| 6953 |
_raise(_Match, "prim-io.sml:299:28") |
| 6954 |
end |
| 6955 |
::cont3:: |
| 6956 |
return {avail = avail, block = block, canInput = canInput, chunkSize = chunkSize, close = close, endPos = endPos, getPos = getPos, ioDesc = ioDesc, name = name, readArr = readArr_PRIME, readArrNB = readArrNB_PRIME, readVec = readVec_PRIME, readVecNB = readVecNB_PRIME, setPos = setPos, verifyPos = verifyPos} |
| 6957 |
end |
| 6958 |
return {RD = RD, WR = WR, augmentReader = augmentReader, augmentWriter = function(a) |
| 6959 |
local name = a.name |
| 6960 |
local chunkSize = a.chunkSize |
| 6961 |
local writeVec = a.writeVec |
| 6962 |
local writeArr = a.writeArr |
| 6963 |
local writeVecNB = a.writeVecNB |
| 6964 |
local writeArrNB = a.writeArrNB |
| 6965 |
local block = a.block |
| 6966 |
local canOutput = a.canOutput |
| 6967 |
local getPos = a.getPos |
| 6968 |
local setPos = a.setPos |
| 6969 |
local endPos = a.endPos |
| 6970 |
local verifyPos = a.verifyPos |
| 6971 |
local close = a.close |
| 6972 |
local ioDesc = a.ioDesc |
| 6973 |
local writeVec_PRIME |
| 6974 |
if writeVec.tag == "SOME" then |
| 6975 |
writeVec_PRIME = writeVec |
| 6976 |
goto cont |
| 6977 |
end |
| 6978 |
if writeVec.tag == "NONE" then |
| 6979 |
if writeArr.tag == "SOME" then |
| 6980 |
local wa = writeArr.payload |
| 6981 |
writeVec_PRIME = {tag = "SOME", payload = function(slice) |
| 6982 |
local tmp69 = tmp65(slice) |
| 6983 |
local arr = tmp54({tmp69, tmp68}) |
| 6984 |
tmp57({di = 0, dst = arr, src = slice}) |
| 6985 |
local tmp70 = tmp58(arr) |
| 6986 |
return wa(tmp70) |
| 6987 |
end} |
| 6988 |
goto cont |
| 6989 |
end |
| 6990 |
if writeArr.tag == "NONE" then |
| 6991 |
if block.tag == "SOME" and writeVecNB.tag == "SOME" then |
| 6992 |
local block_PRIME = block.payload |
| 6993 |
local wvNB = writeVecNB.payload |
| 6994 |
writeVec_PRIME = {tag = "SOME", payload = function(slice) |
| 6995 |
local exp = wvNB(slice) |
| 6996 |
if exp.tag == "SOME" then |
| 6997 |
return exp.payload |
| 6998 |
end |
| 6999 |
if exp.tag == "NONE" then |
| 7000 |
else |
| 7001 |
_raise(_Match, "prim-io.sml:359:64") |
| 7002 |
end |
| 7003 |
do |
| 7004 |
block_PRIME(nil) |
| 7005 |
local exp1 = wvNB(slice) |
| 7006 |
if exp1.tag == "SOME" then |
| 7007 |
return exp1.payload |
| 7008 |
elseif exp1.tag == "NONE" then |
| 7009 |
return 0 |
| 7010 |
else |
| 7011 |
_raise(_Match, "prim-io.sml:362:78") |
| 7012 |
end |
| 7013 |
end |
| 7014 |
end} |
| 7015 |
elseif block.tag == "SOME" and (writeVecNB.tag == "NONE" and writeArrNB.tag == "SOME") then |
| 7016 |
local block_PRIME = block.payload |
| 7017 |
local waNB = writeArrNB.payload |
| 7018 |
writeVec_PRIME = {tag = "SOME", payload = function(slice) |
| 7019 |
local tmp69 = tmp65(slice) |
| 7020 |
local arr = tmp54({tmp69, tmp68}) |
| 7021 |
local aslice = tmp58(arr) |
| 7022 |
tmp57({di = 0, dst = arr, src = slice}) |
| 7023 |
local exp = waNB(aslice) |
| 7024 |
if exp.tag == "SOME" then |
| 7025 |
return exp.payload |
| 7026 |
end |
| 7027 |
if exp.tag == "NONE" then |
| 7028 |
else |
| 7029 |
_raise(_Match, "prim-io.sml:372:67") |
| 7030 |
end |
| 7031 |
do |
| 7032 |
block_PRIME(nil) |
| 7033 |
local exp1 = waNB(aslice) |
| 7034 |
if exp1.tag == "SOME" then |
| 7035 |
return exp1.payload |
| 7036 |
elseif exp1.tag == "NONE" then |
| 7037 |
return 0 |
| 7038 |
else |
| 7039 |
_raise(_Match, "prim-io.sml:375:81") |
| 7040 |
end |
| 7041 |
end |
| 7042 |
end} |
| 7043 |
else |
| 7044 |
writeVec_PRIME = NONE |
| 7045 |
end |
| 7046 |
else |
| 7047 |
_raise(_Match, "prim-io.sml:348:39") |
| 7048 |
end |
| 7049 |
else |
| 7050 |
_raise(_Match, "prim-io.sml:346:27") |
| 7051 |
end |
| 7052 |
::cont:: |
| 7053 |
local writeArr_PRIME |
| 7054 |
if writeArr.tag == "SOME" then |
| 7055 |
writeArr_PRIME = writeArr |
| 7056 |
goto cont1 |
| 7057 |
end |
| 7058 |
if writeArr.tag == "NONE" then |
| 7059 |
if writeVec.tag == "SOME" then |
| 7060 |
local wv = writeVec.payload |
| 7061 |
writeArr_PRIME = {tag = "SOME", payload = function(slice) |
| 7062 |
local v = tmp61(slice) |
| 7063 |
local tmp69 = tmp64(v) |
| 7064 |
return wv(tmp69) |
| 7065 |
end} |
| 7066 |
goto cont1 |
| 7067 |
end |
| 7068 |
if writeVec.tag == "NONE" then |
| 7069 |
if block.tag == "SOME" and writeArrNB.tag == "SOME" then |
| 7070 |
local block_PRIME = block.payload |
| 7071 |
local waNB = writeArrNB.payload |
| 7072 |
writeArr_PRIME = {tag = "SOME", payload = function(slice) |
| 7073 |
local exp = waNB(slice) |
| 7074 |
if exp.tag == "SOME" then |
| 7075 |
return exp.payload |
| 7076 |
end |
| 7077 |
if exp.tag == "NONE" then |
| 7078 |
else |
| 7079 |
_raise(_Match, "prim-io.sml:393:64") |
| 7080 |
end |
| 7081 |
do |
| 7082 |
block_PRIME(nil) |
| 7083 |
local exp1 = waNB(slice) |
| 7084 |
if exp1.tag == "SOME" then |
| 7085 |
return exp1.payload |
| 7086 |
elseif exp1.tag == "NONE" then |
| 7087 |
return 0 |
| 7088 |
else |
| 7089 |
_raise(_Match, "prim-io.sml:396:78") |
| 7090 |
end |
| 7091 |
end |
| 7092 |
end} |
| 7093 |
elseif block.tag == "SOME" and (writeVecNB.tag == "SOME" and writeArrNB.tag == "NONE") then |
| 7094 |
local block_PRIME = block.payload |
| 7095 |
local wvNB = writeVecNB.payload |
| 7096 |
writeArr_PRIME = {tag = "SOME", payload = function(slice) |
| 7097 |
local tmp69 = tmp61(slice) |
| 7098 |
local vslice = tmp64(tmp69) |
| 7099 |
local exp = wvNB(vslice) |
| 7100 |
if exp.tag == "SOME" then |
| 7101 |
return exp.payload |
| 7102 |
end |
| 7103 |
if exp.tag == "NONE" then |
| 7104 |
else |
| 7105 |
_raise(_Match, "prim-io.sml:404:67") |
| 7106 |
end |
| 7107 |
do |
| 7108 |
block_PRIME(nil) |
| 7109 |
local exp1 = wvNB(vslice) |
| 7110 |
if exp1.tag == "SOME" then |
| 7111 |
return exp1.payload |
| 7112 |
elseif exp1.tag == "NONE" then |
| 7113 |
return 0 |
| 7114 |
else |
| 7115 |
_raise(_Match, "prim-io.sml:407:81") |
| 7116 |
end |
| 7117 |
end |
| 7118 |
end} |
| 7119 |
else |
| 7120 |
writeArr_PRIME = NONE |
| 7121 |
end |
| 7122 |
else |
| 7123 |
_raise(_Match, "prim-io.sml:384:39") |
| 7124 |
end |
| 7125 |
else |
| 7126 |
_raise(_Match, "prim-io.sml:382:27") |
| 7127 |
end |
| 7128 |
::cont1:: |
| 7129 |
local writeVecNB_PRIME |
| 7130 |
if writeVecNB.tag == "SOME" then |
| 7131 |
writeVecNB_PRIME = writeVecNB |
| 7132 |
goto cont2 |
| 7133 |
end |
| 7134 |
if writeVecNB.tag == "NONE" then |
| 7135 |
if writeArrNB.tag == "SOME" then |
| 7136 |
local waNB = writeArrNB.payload |
| 7137 |
writeVecNB_PRIME = {tag = "SOME", payload = function(slice) |
| 7138 |
local tmp69 = tmp65(slice) |
| 7139 |
local arr = tmp54({tmp69, tmp68}) |
| 7140 |
tmp57({di = 0, dst = arr, src = slice}) |
| 7141 |
local tmp70 = tmp58(arr) |
| 7142 |
return waNB(tmp70) |
| 7143 |
end} |
| 7144 |
goto cont2 |
| 7145 |
end |
| 7146 |
if writeArrNB.tag == "NONE" then |
| 7147 |
if canOutput.tag == "SOME" and writeVec.tag == "SOME" then |
| 7148 |
local canOutput_PRIME = canOutput.payload |
| 7149 |
local wv = writeVec.payload |
| 7150 |
writeVecNB_PRIME = {tag = "SOME", payload = function(slice) |
| 7151 |
local tmp69 = canOutput_PRIME(nil) |
| 7152 |
if tmp69 then |
| 7153 |
else |
| 7154 |
return NONE |
| 7155 |
end |
| 7156 |
do |
| 7157 |
local tmp70 = wv(slice) |
| 7158 |
return {tag = "SOME", payload = tmp70} |
| 7159 |
end |
| 7160 |
end} |
| 7161 |
elseif canOutput.tag == "SOME" and (writeVec.tag == "NONE" and writeArr.tag == "SOME") then |
| 7162 |
local canOutput_PRIME = canOutput.payload |
| 7163 |
local wa = writeArr.payload |
| 7164 |
writeVecNB_PRIME = {tag = "SOME", payload = function(slice) |
| 7165 |
local tmp69 = canOutput_PRIME(nil) |
| 7166 |
if tmp69 then |
| 7167 |
else |
| 7168 |
return NONE |
| 7169 |
end |
| 7170 |
do |
| 7171 |
local tmp70 = tmp65(slice) |
| 7172 |
local arr = tmp54({tmp70, tmp68}) |
| 7173 |
tmp57({di = 0, dst = arr, src = slice}) |
| 7174 |
local tmp71 = tmp58(arr) |
| 7175 |
local tmp72 = wa(tmp71) |
| 7176 |
return {tag = "SOME", payload = tmp72} |
| 7177 |
end |
| 7178 |
end} |
| 7179 |
else |
| 7180 |
writeVecNB_PRIME = NONE |
| 7181 |
end |
| 7182 |
else |
| 7183 |
_raise(_Match, "prim-io.sml:416:41") |
| 7184 |
end |
| 7185 |
else |
| 7186 |
_raise(_Match, "prim-io.sml:414:29") |
| 7187 |
end |
| 7188 |
::cont2:: |
| 7189 |
local writeArrNB_PRIME |
| 7190 |
if writeArrNB.tag == "SOME" then |
| 7191 |
writeArrNB_PRIME = writeArrNB |
| 7192 |
goto cont3 |
| 7193 |
end |
| 7194 |
if writeArrNB.tag == "NONE" then |
| 7195 |
if writeVecNB.tag == "SOME" then |
| 7196 |
local wvNB = writeVecNB.payload |
| 7197 |
writeArrNB_PRIME = {tag = "SOME", payload = function(slice) |
| 7198 |
local tmp69 = tmp61(slice) |
| 7199 |
local vslice = tmp64(tmp69) |
| 7200 |
return wvNB(vslice) |
| 7201 |
end} |
| 7202 |
goto cont3 |
| 7203 |
end |
| 7204 |
if writeVecNB.tag == "NONE" then |
| 7205 |
if canOutput.tag == "SOME" and writeArr.tag == "SOME" then |
| 7206 |
local canOutput_PRIME = canOutput.payload |
| 7207 |
local wa = writeArr.payload |
| 7208 |
writeArrNB_PRIME = {tag = "SOME", payload = function(slice) |
| 7209 |
local tmp69 = canOutput_PRIME(nil) |
| 7210 |
if tmp69 then |
| 7211 |
else |
| 7212 |
return NONE |
| 7213 |
end |
| 7214 |
do |
| 7215 |
local tmp70 = wa(slice) |
| 7216 |
return {tag = "SOME", payload = tmp70} |
| 7217 |
end |
| 7218 |
end} |
| 7219 |
elseif canOutput.tag == "SOME" and (writeVec.tag == "SOME" and writeArr.tag == "NONE") then |
| 7220 |
local canOutput_PRIME = canOutput.payload |
| 7221 |
local wv = writeVec.payload |
| 7222 |
writeArrNB_PRIME = {tag = "SOME", payload = function(slice) |
| 7223 |
local tmp69 = canOutput_PRIME(nil) |
| 7224 |
if tmp69 then |
| 7225 |
else |
| 7226 |
return NONE |
| 7227 |
end |
| 7228 |
do |
| 7229 |
local tmp70 = tmp61(slice) |
| 7230 |
local vslice = tmp64(tmp70) |
| 7231 |
local tmp71 = wv(vslice) |
| 7232 |
return {tag = "SOME", payload = tmp71} |
| 7233 |
end |
| 7234 |
end} |
| 7235 |
else |
| 7236 |
writeArrNB_PRIME = NONE |
| 7237 |
end |
| 7238 |
else |
| 7239 |
_raise(_Match, "prim-io.sml:445:41") |
| 7240 |
end |
| 7241 |
else |
| 7242 |
_raise(_Match, "prim-io.sml:443:29") |
| 7243 |
end |
| 7244 |
::cont3:: |
| 7245 |
return {block = block, canOutput = canOutput, chunkSize = chunkSize, close = close, endPos = endPos, getPos = getPos, ioDesc = ioDesc, name = name, setPos = setPos, verifyPos = verifyPos, writeArr = writeArr_PRIME, writeArrNB = writeArrNB_PRIME, writeVec = writeVec_PRIME, writeVecNB = writeVecNB_PRIME} |
| 7246 |
end, compare = compare1, nullRd = nullRd, nullWr = nullWr, openVector = openVector} |
| 7247 |
end |
| 7248 |
_L[80] = _L[79](_L[39], _L[40], _L[33], _L[34], _L[35], _L[36], _L[37], _L[38], tmp50, tmp51, tmp45, tmp46, tmp47, tmp48, compare, 0x0) |
| 7249 |
_L[81] = _L[80].RD |
| 7250 |
_L[82] = _L[80].WR |
| 7251 |
_L[83] = _L[79](_L[1], _L[2], tmp37, tmp38, tmp39, tmp40, tmp41, tmp42, tmp35, tmp36, tmp28, tmp29, tmp30, tmp31, compare, 0) |
| 7252 |
_L[84] = _L[83].RD |
| 7253 |
_L[85] = _L[83].WR |
| 7254 |
_L[86] = function(tmp54, tmp55, tmp56, tmp57, tmp58, tmp59, tmp60, tmp61, tmp62, tmp63, tmp64, tmp65, tmp66, tmp67, tmp68, tmp69, tmp70, tmp71, tmp72, tmp73, tmp74) |
| 7255 |
local input = function(a) |
| 7256 |
local exp = tmp65(a[1]) |
| 7257 |
local chunk = exp[1] |
| 7258 |
a[1] = exp[2] |
| 7259 |
return chunk |
| 7260 |
end |
| 7261 |
local input1 = function(a) |
| 7262 |
local exp = tmp66(a[1]) |
| 7263 |
if exp.tag == "NONE" then |
| 7264 |
return NONE |
| 7265 |
elseif exp.tag == "SOME" then |
| 7266 |
local e = exp.payload[1] |
| 7267 |
a[1] = exp.payload[2] |
| 7268 |
return {tag = "SOME", payload = e} |
| 7269 |
else |
| 7270 |
_raise(_Match, "imperative-io.sml:51:21") |
| 7271 |
end |
| 7272 |
end |
| 7273 |
local inputN = function(a) |
| 7274 |
local stream = a[1] |
| 7275 |
local n = a[2] |
| 7276 |
local exp = tmp68({stream[1], n}) |
| 7277 |
local chunk = exp[1] |
| 7278 |
stream[1] = exp[2] |
| 7279 |
return chunk |
| 7280 |
end |
| 7281 |
local inputAll = function(a) |
| 7282 |
local exp = tmp67(a[1]) |
| 7283 |
local chunk = exp[1] |
| 7284 |
a[1] = exp[2] |
| 7285 |
return chunk |
| 7286 |
end |
| 7287 |
local canInput = function(a) |
| 7288 |
local stream = a[1] |
| 7289 |
local n = a[2] |
| 7290 |
return tmp54({stream[1], n}) |
| 7291 |
end |
| 7292 |
local lookahead = function(a) |
| 7293 |
local exp = tmp66(a[1]) |
| 7294 |
if exp.tag == "NONE" then |
| 7295 |
return NONE |
| 7296 |
elseif exp.tag == "SOME" then |
| 7297 |
return {tag = "SOME", payload = exp.payload[1]} |
| 7298 |
else |
| 7299 |
_raise(_Match, "imperative-io.sml:65:24") |
| 7300 |
end |
| 7301 |
end |
| 7302 |
local closeIn = function(a) |
| 7303 |
return tmp55(a[1]) |
| 7304 |
end |
| 7305 |
local endOfStream = function(a) |
| 7306 |
return tmp57(a[1]) |
| 7307 |
end |
| 7308 |
local output = function(a) |
| 7309 |
local stream = a[1] |
| 7310 |
local chunk = a[2] |
| 7311 |
return tmp71({stream[1], chunk}) |
| 7312 |
end |
| 7313 |
local output1 = function(a) |
| 7314 |
local stream = a[1] |
| 7315 |
local elem = a[2] |
| 7316 |
return tmp72({stream[1], elem}) |
| 7317 |
end |
| 7318 |
local flushOut = function(a) |
| 7319 |
return tmp60(a[1]) |
| 7320 |
end |
| 7321 |
local closeOut = function(a) |
| 7322 |
return tmp56(a[1]) |
| 7323 |
end |
| 7324 |
local mkInstream = function(a) |
| 7325 |
return {a} |
| 7326 |
end |
| 7327 |
local getInstream = function(a) |
| 7328 |
return a[1] |
| 7329 |
end |
| 7330 |
local setInstream = function(a) |
| 7331 |
local stream = a[1] |
| 7332 |
stream[1] = a[2] |
| 7333 |
return nil |
| 7334 |
end |
| 7335 |
local getPosOut = function(a) |
| 7336 |
return tmp62(a[1]) |
| 7337 |
end |
| 7338 |
local setPosOut = function(a) |
| 7339 |
local stream = a[1] |
| 7340 |
local tmp75 = tmp74(a[2]) |
| 7341 |
stream[1] = tmp75 |
| 7342 |
return nil |
| 7343 |
end |
| 7344 |
return {_StreamIO = {canInput = tmp54, closeIn = tmp55, closeOut = tmp56, endOfStream = tmp57, filePosIn = tmp58, filePosOut = tmp59, flushOut = tmp60, getBufferMode = tmp61, getPosOut = tmp62, getReader = tmp63, getWriter = tmp64, input = tmp65, input1 = tmp66, inputAll = tmp67, inputN = tmp68, mkInstream = tmp69, mkOutstream = tmp70, output = tmp71, output1 = tmp72, setBufferMode = tmp73, setPosOut = tmp74}, canInput = canInput, closeIn = closeIn, closeOut = closeOut, endOfStream = endOfStream, flushOut = flushOut, getInstream = getInstream, getOutstream = _EXCLAM, getPosOut = getPosOut, input = input, input1 = input1, inputAll = inputAll, inputN = inputN, lookahead = lookahead, mkInstream = mkInstream, mkOutstream = ref, output = output, output1 = output1, setInstream = setInstream, setOutstream = _COLON_EQ, setPosOut = setPosOut} |
| 7345 |
end |
| 7346 |
_L[87] = function(a) |
| 7347 |
local rd = a[1] |
| 7348 |
local content = a[2] |
| 7349 |
local tip |
| 7350 |
if rd.ioDesc.tag == "SOME" then |
| 7351 |
local name = rd.name |
| 7352 |
tip = {{tag = "READABLE", payload = {name = name, readable = _L[56][rd.ioDesc.payload]}}} |
| 7353 |
else |
| 7354 |
tip = {{tag = "PRIM_READER", payload = rd}} |
| 7355 |
end |
| 7356 |
local tmp54 = tmp36(content) |
| 7357 |
if tmp54 > 0 then |
| 7358 |
return {{tag = "BUFFERED", payload = {buffer = content, initialPosition = NONE, next = tip, position = 0}}} |
| 7359 |
else |
| 7360 |
return tip |
| 7361 |
end |
| 7362 |
end |
| 7363 |
_L[88] = function(a) |
| 7364 |
local tmp54, tmp55 = a, nil |
| 7365 |
::cont:: |
| 7366 |
do |
| 7367 |
local ins, acc = tmp54, tmp55 |
| 7368 |
local x = ins[1] |
| 7369 |
if x.tag == "READABLE" then |
| 7370 |
else |
| 7371 |
goto else1 |
| 7372 |
end |
| 7373 |
do |
| 7374 |
local readable = x.payload.readable |
| 7375 |
local name = x.payload.name |
| 7376 |
ins[1] = {tag = "CLOSED", payload = name} |
| 7377 |
local tmp56 |
| 7378 |
do |
| 7379 |
local ioDesc = _L[59](readable) |
| 7380 |
local tmp57 = {tag = "SOME", payload = function(a1) |
| 7381 |
local exp |
| 7382 |
do |
| 7383 |
local tmp58 = readable:read(a1) |
| 7384 |
if not tmp58 then |
| 7385 |
exp = NONE |
| 7386 |
else |
| 7387 |
exp = {tag = "SOME", payload = tmp58} |
| 7388 |
end |
| 7389 |
end |
| 7390 |
if exp.tag == "NONE" then |
| 7391 |
return "" |
| 7392 |
elseif exp.tag == "SOME" then |
| 7393 |
return exp.payload |
| 7394 |
else |
| 7395 |
_raise(_Match, "text-io.sml:35:28") |
| 7396 |
end |
| 7397 |
end} |
| 7398 |
local tmp58 = function(a1) |
| 7399 |
return NONE |
| 7400 |
end |
| 7401 |
local tmp59 = function(a1) |
| 7402 |
_L[60](ioDesc) |
| 7403 |
readable:close() |
| 7404 |
return nil |
| 7405 |
end |
| 7406 |
tmp56 = _L[84]({avail = tmp58, block = NONE, canInput = NONE, chunkSize = 1024, close = tmp59, endPos = NONE, getPos = NONE, ioDesc = {tag = "SOME", payload = ioDesc}, name = name, readArr = NONE, readArrNB = NONE, readVec = tmp57, readVecNB = NONE, setPos = NONE, verifyPos = NONE}) |
| 7407 |
end |
| 7408 |
local tmp57 = revAppend(acc, nil) |
| 7409 |
local tmp58 = tmp27(tmp57) |
| 7410 |
return {tmp56, tmp58} |
| 7411 |
end |
| 7412 |
::else1:: |
| 7413 |
if x.tag == "PRIM_READER" then |
| 7414 |
else |
| 7415 |
goto else2 |
| 7416 |
end |
| 7417 |
do |
| 7418 |
local rd = x.payload |
| 7419 |
ins[1] = {tag = "CLOSED", payload = x.payload.name} |
| 7420 |
local tmp56 = revAppend(acc, nil) |
| 7421 |
local tmp57 = tmp27(tmp56) |
| 7422 |
return {rd, tmp57} |
| 7423 |
end |
| 7424 |
::else2:: |
| 7425 |
if x.tag == "BUFFERED" then |
| 7426 |
elseif x.tag == "CLOSED" then |
| 7427 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "getReader", name = x.payload}}, "text-io.sml:113:57") |
| 7428 |
else |
| 7429 |
_raise(_Match, "text-io.sml:109:38") |
| 7430 |
end |
| 7431 |
do |
| 7432 |
local buffer = x.payload.buffer |
| 7433 |
local position = x.payload.position |
| 7434 |
local next = x.payload.next |
| 7435 |
local tmp56 = tmp30({buffer, position, NONE}) |
| 7436 |
tmp54 = next |
| 7437 |
tmp55 = {tmp56, acc} |
| 7438 |
goto cont |
| 7439 |
end |
| 7440 |
end |
| 7441 |
end |
| 7442 |
_L[89] = function(a) |
| 7443 |
local x = a[1] |
| 7444 |
if x.tag == "READABLE" then |
| 7445 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "filePosIn", name = x.payload.name}}, "text-io.sml:118:55") |
| 7446 |
end |
| 7447 |
if x.tag == "PRIM_READER" and x.payload.getPos.tag == "NONE" then |
| 7448 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "filePosIn", name = x.payload.name}}, "text-io.sml:119:89") |
| 7449 |
end |
| 7450 |
if x.tag == "PRIM_READER" and x.payload.getPos.tag == "SOME" then |
| 7451 |
else |
| 7452 |
goto else1 |
| 7453 |
end |
| 7454 |
do |
| 7455 |
return x.payload.getPos.payload(nil) |
| 7456 |
end |
| 7457 |
::else1:: |
| 7458 |
if x.tag == "BUFFERED" and x.payload.initialPosition.tag == "NONE" then |
| 7459 |
local tmp54 |
| 7460 |
do |
| 7461 |
local tmp55 = x.payload.next |
| 7462 |
::cont:: |
| 7463 |
do |
| 7464 |
local a1 = tmp55 |
| 7465 |
local x1 = a1[1] |
| 7466 |
if x1.tag == "READABLE" then |
| 7467 |
tmp54 = x1.payload.name |
| 7468 |
elseif x1.tag == "PRIM_READER" then |
| 7469 |
tmp54 = x1.payload.name |
| 7470 |
elseif x1.tag == "BUFFERED" then |
| 7471 |
tmp55 = x1.payload.next |
| 7472 |
goto cont |
| 7473 |
elseif x1.tag == "CLOSED" then |
| 7474 |
tmp54 = x1.payload |
| 7475 |
else |
| 7476 |
_raise(_Match, "text-io.sml:93:23") |
| 7477 |
end |
| 7478 |
end |
| 7479 |
end |
| 7480 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "filePosIn", name = tmp54}}, "text-io.sml:121:92") |
| 7481 |
end |
| 7482 |
if x.tag == "BUFFERED" and x.payload.initialPosition.tag == "SOME" then |
| 7483 |
elseif x.tag == "CLOSED" then |
| 7484 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "filePosIn", name = x.payload}}, "text-io.sml:135:44") |
| 7485 |
else |
| 7486 |
_raise(_Match, "text-io.sml:117:25") |
| 7487 |
end |
| 7488 |
do |
| 7489 |
local position, initialPosition, tmp54 |
| 7490 |
do |
| 7491 |
position = x.payload.position |
| 7492 |
local next = x.payload.next |
| 7493 |
initialPosition = x.payload.initialPosition.payload |
| 7494 |
tmp54 = next[1] |
| 7495 |
end |
| 7496 |
::cont:: |
| 7497 |
do |
| 7498 |
local a1 = tmp54 |
| 7499 |
if a1.tag == "PRIM_READER" and (a1.payload.getPos.tag == "SOME" and (a1.payload.setPos.tag == "SOME" and a1.payload.readVec.tag == "SOME")) then |
| 7500 |
elseif a1.tag == "BUFFERED" then |
| 7501 |
tmp54 = a1.payload.next[1] |
| 7502 |
goto cont |
| 7503 |
elseif a1.tag == "CLOSED" then |
| 7504 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "filePosIn", name = a1.payload}}, "text-io.sml:130:56") |
| 7505 |
elseif a1.tag == "PRIM_READER" then |
| 7506 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "filePosIn", name = a1.payload.name}}, "text-io.sml:131:86") |
| 7507 |
elseif a1.tag == "READABLE" then |
| 7508 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "filePosIn", name = a1.payload.name}}, "text-io.sml:132:67") |
| 7509 |
else |
| 7510 |
_raise(_Match, "text-io.sml:123:37") |
| 7511 |
end |
| 7512 |
do |
| 7513 |
local getPos = a1.payload.getPos.payload |
| 7514 |
local setPos = a1.payload.setPos.payload |
| 7515 |
local readVec = a1.payload.readVec.payload |
| 7516 |
local savedPosition = getPos(nil) |
| 7517 |
setPos(initialPosition) |
| 7518 |
readVec(position) |
| 7519 |
local tmp55 = getPos(nil) |
| 7520 |
setPos(savedPosition) |
| 7521 |
return tmp55 |
| 7522 |
end |
| 7523 |
end |
| 7524 |
end |
| 7525 |
end |
| 7526 |
_L[90] = function(stream, f, n) |
| 7527 |
local exp |
| 7528 |
do |
| 7529 |
local tmp54 = stream.readable:read(n) |
| 7530 |
if not tmp54 then |
| 7531 |
exp = NONE |
| 7532 |
else |
| 7533 |
exp = {tag = "SOME", payload = tmp54} |
| 7534 |
end |
| 7535 |
end |
| 7536 |
if exp.tag == "SOME" then |
| 7537 |
local chunk = exp.payload |
| 7538 |
f[1] = {tag = "BUFFERED", payload = {buffer = chunk, initialPosition = NONE, next = {{tag = "READABLE", payload = stream}}, position = 0}} |
| 7539 |
return true |
| 7540 |
elseif exp.tag == "NONE" then |
| 7541 |
return false |
| 7542 |
else |
| 7543 |
_raise(_Match, "text-io.sml:137:11") |
| 7544 |
end |
| 7545 |
end |
| 7546 |
_L[91] = function(rd, f, n) |
| 7547 |
local name = rd.name |
| 7548 |
local readVec = rd.readVec |
| 7549 |
local readArr = rd.readArr |
| 7550 |
local readVecNB = rd.readVecNB |
| 7551 |
local readArrNB = rd.readArrNB |
| 7552 |
local block = rd.block |
| 7553 |
local initialPosition |
| 7554 |
do |
| 7555 |
if rd.getPos.tag == "SOME" then |
| 7556 |
else |
| 7557 |
initialPosition = NONE |
| 7558 |
goto cont |
| 7559 |
end |
| 7560 |
do |
| 7561 |
local tmp54 = rd.getPos.payload(nil) |
| 7562 |
initialPosition = {tag = "SOME", payload = tmp54} |
| 7563 |
end |
| 7564 |
end |
| 7565 |
::cont:: |
| 7566 |
local chunk |
| 7567 |
do |
| 7568 |
if readVec.tag == "SOME" then |
| 7569 |
else |
| 7570 |
goto else1 |
| 7571 |
end |
| 7572 |
chunk = readVec.payload(n) |
| 7573 |
goto cont1 |
| 7574 |
::else1:: |
| 7575 |
if readVec.tag == "NONE" then |
| 7576 |
else |
| 7577 |
_raise(_Match, "text-io.sml:152:27") |
| 7578 |
end |
| 7579 |
do |
| 7580 |
if readArr.tag == "SOME" then |
| 7581 |
else |
| 7582 |
goto else2 |
| 7583 |
end |
| 7584 |
do |
| 7585 |
local ra = readArr.payload |
| 7586 |
local arr = _L[1]({n, 0}) |
| 7587 |
local tmp54 = tmp39(arr) |
| 7588 |
local actual = ra(tmp54) |
| 7589 |
local tmp55 = tmp41({arr, 0, {tag = "SOME", payload = actual}}) |
| 7590 |
chunk = tmp42(tmp55) |
| 7591 |
goto cont1 |
| 7592 |
end |
| 7593 |
::else2:: |
| 7594 |
if readArr.tag == "NONE" then |
| 7595 |
else |
| 7596 |
_raise(_Match, "text-io.sml:154:39") |
| 7597 |
end |
| 7598 |
do |
| 7599 |
if block.tag == "SOME" and readVecNB.tag == "SOME" then |
| 7600 |
else |
| 7601 |
goto else3 |
| 7602 |
end |
| 7603 |
do |
| 7604 |
local block_PRIME = block.payload |
| 7605 |
local rvNB = readVecNB.payload |
| 7606 |
local exp = rvNB(n) |
| 7607 |
if exp.tag == "SOME" then |
| 7608 |
chunk = exp.payload |
| 7609 |
goto cont1 |
| 7610 |
end |
| 7611 |
if exp.tag == "NONE" then |
| 7612 |
else |
| 7613 |
_raise(_Match, "text-io.sml:161:56") |
| 7614 |
end |
| 7615 |
do |
| 7616 |
block_PRIME(nil) |
| 7617 |
local exp1 = rvNB(n) |
| 7618 |
if exp1.tag == "SOME" then |
| 7619 |
chunk = exp1.payload |
| 7620 |
goto cont1 |
| 7621 |
elseif exp1.tag == "NONE" then |
| 7622 |
chunk = "" |
| 7623 |
goto cont1 |
| 7624 |
else |
| 7625 |
_raise(_Match, "text-io.sml:164:70") |
| 7626 |
end |
| 7627 |
end |
| 7628 |
end |
| 7629 |
::else3:: |
| 7630 |
if block.tag == "SOME" and (readVecNB.tag == "NONE" and readArrNB.tag == "SOME") then |
| 7631 |
else |
| 7632 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "<unknown>", name = name}}, "text-io.sml:180:60") |
| 7633 |
end |
| 7634 |
do |
| 7635 |
local block_PRIME = block.payload |
| 7636 |
local raNB = readArrNB.payload |
| 7637 |
local arr = _L[1]({n, 0}) |
| 7638 |
local aslice = tmp39(arr) |
| 7639 |
local exp = raNB(aslice) |
| 7640 |
if exp.tag == "SOME" then |
| 7641 |
else |
| 7642 |
goto else4 |
| 7643 |
end |
| 7644 |
do |
| 7645 |
local tmp54 = tmp41({arr, 0, {tag = "SOME", payload = exp.payload}}) |
| 7646 |
chunk = tmp42(tmp54) |
| 7647 |
goto cont1 |
| 7648 |
end |
| 7649 |
::else4:: |
| 7650 |
if exp.tag == "NONE" then |
| 7651 |
else |
| 7652 |
_raise(_Match, "text-io.sml:172:58") |
| 7653 |
end |
| 7654 |
do |
| 7655 |
block_PRIME(nil) |
| 7656 |
local exp1 = raNB(aslice) |
| 7657 |
if exp1.tag == "SOME" then |
| 7658 |
elseif exp1.tag == "NONE" then |
| 7659 |
chunk = "" |
| 7660 |
goto cont1 |
| 7661 |
else |
| 7662 |
_raise(_Match, "text-io.sml:175:72") |
| 7663 |
end |
| 7664 |
do |
| 7665 |
local tmp54 = tmp41({arr, 0, {tag = "SOME", payload = exp1.payload}}) |
| 7666 |
chunk = tmp42(tmp54) |
| 7667 |
end |
| 7668 |
end |
| 7669 |
end |
| 7670 |
end |
| 7671 |
end |
| 7672 |
end |
| 7673 |
::cont1:: |
| 7674 |
f[1] = {tag = "BUFFERED", payload = {buffer = chunk, initialPosition = initialPosition, next = {{tag = "PRIM_READER", payload = rd}}, position = 0}} |
| 7675 |
return nil |
| 7676 |
end |
| 7677 |
_L[92] = function(a) |
| 7678 |
local tmp54 = a |
| 7679 |
::cont:: |
| 7680 |
do |
| 7681 |
local a1 = tmp54 |
| 7682 |
local x = a1[1] |
| 7683 |
if x.tag == "READABLE" then |
| 7684 |
else |
| 7685 |
goto else1 |
| 7686 |
end |
| 7687 |
do |
| 7688 |
local tmp55 = _L[90](x.payload, a1, 1) |
| 7689 |
if tmp55 then |
| 7690 |
tmp54 = a1 |
| 7691 |
goto cont |
| 7692 |
else |
| 7693 |
return {"", a1} |
| 7694 |
end |
| 7695 |
end |
| 7696 |
::else1:: |
| 7697 |
if x.tag == "PRIM_READER" then |
| 7698 |
else |
| 7699 |
goto else2 |
| 7700 |
end |
| 7701 |
do |
| 7702 |
local rd = x.payload |
| 7703 |
_L[91](rd, a1, x.payload.chunkSize) |
| 7704 |
tmp54 = a1 |
| 7705 |
goto cont |
| 7706 |
end |
| 7707 |
::else2:: |
| 7708 |
if x.tag == "BUFFERED" then |
| 7709 |
elseif x.tag == "CLOSED" then |
| 7710 |
return {"", a1} |
| 7711 |
else |
| 7712 |
_raise(_Match, "text-io.sml:183:32") |
| 7713 |
end |
| 7714 |
do |
| 7715 |
local buffer = x.payload.buffer |
| 7716 |
local position = x.payload.position |
| 7717 |
local next = x.payload.next |
| 7718 |
local tmp55 = extract(buffer, position, NONE) |
| 7719 |
return {tmp55, next} |
| 7720 |
end |
| 7721 |
end |
| 7722 |
end |
| 7723 |
_L[93] = function(buffer, position, next, initialPosition) |
| 7724 |
if position >= #buffer then |
| 7725 |
return next |
| 7726 |
else |
| 7727 |
return {{tag = "BUFFERED", payload = {buffer = buffer, initialPosition = initialPosition, next = next, position = position}}} |
| 7728 |
end |
| 7729 |
end |
| 7730 |
_L[94] = function(a) |
| 7731 |
local tmp54 = a |
| 7732 |
::cont:: |
| 7733 |
do |
| 7734 |
local a1 = tmp54 |
| 7735 |
local x = a1[1] |
| 7736 |
if x.tag == "READABLE" then |
| 7737 |
else |
| 7738 |
goto else1 |
| 7739 |
end |
| 7740 |
do |
| 7741 |
local tmp55 = _L[90](x.payload, a1, 1) |
| 7742 |
if tmp55 then |
| 7743 |
tmp54 = a1 |
| 7744 |
goto cont |
| 7745 |
else |
| 7746 |
return NONE |
| 7747 |
end |
| 7748 |
end |
| 7749 |
::else1:: |
| 7750 |
if x.tag == "PRIM_READER" then |
| 7751 |
else |
| 7752 |
goto else2 |
| 7753 |
end |
| 7754 |
do |
| 7755 |
local rd = x.payload |
| 7756 |
_L[91](rd, a1, x.payload.chunkSize) |
| 7757 |
tmp54 = a1 |
| 7758 |
goto cont |
| 7759 |
end |
| 7760 |
::else2:: |
| 7761 |
if x.tag == "BUFFERED" then |
| 7762 |
elseif x.tag == "CLOSED" then |
| 7763 |
return NONE |
| 7764 |
else |
| 7765 |
_raise(_Match, "text-io.sml:196:33") |
| 7766 |
end |
| 7767 |
do |
| 7768 |
local buffer = x.payload.buffer |
| 7769 |
local position = x.payload.position |
| 7770 |
local next = x.payload.next |
| 7771 |
local initialPosition = x.payload.initialPosition |
| 7772 |
local tmp55 = sub1({buffer, position}) |
| 7773 |
local tmp56 = _L[93](buffer, _Int_add(position, 1), next, initialPosition) |
| 7774 |
return {tag = "SOME", payload = {tmp55, tmp56}} |
| 7775 |
end |
| 7776 |
end |
| 7777 |
end |
| 7778 |
_L[95] = function(a) |
| 7779 |
local tmp54, tmp55 |
| 7780 |
do |
| 7781 |
local f = a[1] |
| 7782 |
tmp54 = f |
| 7783 |
tmp55 = a[2] |
| 7784 |
end |
| 7785 |
::cont:: |
| 7786 |
do |
| 7787 |
local f, n = tmp54, tmp55 |
| 7788 |
local x = f[1] |
| 7789 |
if x.tag == "READABLE" then |
| 7790 |
else |
| 7791 |
goto else1 |
| 7792 |
end |
| 7793 |
do |
| 7794 |
local tmp56 = _L[90](x.payload, f, n) |
| 7795 |
if tmp56 then |
| 7796 |
tmp54 = f |
| 7797 |
tmp55 = n |
| 7798 |
goto cont |
| 7799 |
else |
| 7800 |
return {"", f} |
| 7801 |
end |
| 7802 |
end |
| 7803 |
::else1:: |
| 7804 |
if x.tag == "PRIM_READER" then |
| 7805 |
else |
| 7806 |
goto else2 |
| 7807 |
end |
| 7808 |
_L[91](x.payload, f, n) |
| 7809 |
tmp54 = f |
| 7810 |
tmp55 = n |
| 7811 |
goto cont |
| 7812 |
::else2:: |
| 7813 |
if x.tag == "BUFFERED" then |
| 7814 |
elseif x.tag == "CLOSED" then |
| 7815 |
return {"", f} |
| 7816 |
else |
| 7817 |
_raise(_Match, "text-io.sml:204:36") |
| 7818 |
end |
| 7819 |
do |
| 7820 |
local buffer, position, next |
| 7821 |
do |
| 7822 |
buffer = x.payload.buffer |
| 7823 |
position = x.payload.position |
| 7824 |
next = x.payload.next |
| 7825 |
local initialPosition = x.payload.initialPosition |
| 7826 |
local tmp56 = _Int_add(position, n) |
| 7827 |
if tmp56 <= #buffer then |
| 7828 |
else |
| 7829 |
goto else3 |
| 7830 |
end |
| 7831 |
do |
| 7832 |
local tmp57 = substring(buffer, position, n) |
| 7833 |
local tmp58 = _L[93](buffer, tmp56, next, initialPosition) |
| 7834 |
return {tmp57, tmp58} |
| 7835 |
end |
| 7836 |
end |
| 7837 |
::else3:: |
| 7838 |
local buffer0 = extract(buffer, position, NONE) |
| 7839 |
local exp = _L[95]({next, _Int_sub(n, #buffer0)}) |
| 7840 |
local buffer1 = exp[1] |
| 7841 |
local next1 = exp[2] |
| 7842 |
return {buffer0 .. buffer1, next1} |
| 7843 |
end |
| 7844 |
end |
| 7845 |
end |
| 7846 |
_L[96] = function(a) |
| 7847 |
local tmp54 = a |
| 7848 |
::cont:: |
| 7849 |
do |
| 7850 |
local x |
| 7851 |
do |
| 7852 |
local a1 = tmp54 |
| 7853 |
x = a1[1] |
| 7854 |
if x.tag == "READABLE" then |
| 7855 |
local s = x.payload |
| 7856 |
local exp |
| 7857 |
do |
| 7858 |
local tmp55 = s.readable:read("L") |
| 7859 |
if not tmp55 then |
| 7860 |
exp = NONE |
| 7861 |
else |
| 7862 |
exp = {tag = "SOME", payload = tmp55} |
| 7863 |
end |
| 7864 |
end |
| 7865 |
if exp.tag == "SOME" then |
| 7866 |
local chunk = exp.payload |
| 7867 |
a1[1] = {tag = "BUFFERED", payload = {buffer = chunk, initialPosition = NONE, next = {{tag = "READABLE", payload = s}}, position = 0}} |
| 7868 |
tmp54 = a1 |
| 7869 |
goto cont |
| 7870 |
elseif exp.tag == "NONE" then |
| 7871 |
return NONE |
| 7872 |
else |
| 7873 |
_raise(_Match, "text-io.sml:141:11") |
| 7874 |
end |
| 7875 |
end |
| 7876 |
if x.tag == "PRIM_READER" then |
| 7877 |
else |
| 7878 |
goto else1 |
| 7879 |
end |
| 7880 |
do |
| 7881 |
local rd = x.payload |
| 7882 |
_L[91](rd, a1, x.payload.chunkSize) |
| 7883 |
tmp54 = a1 |
| 7884 |
goto cont |
| 7885 |
end |
| 7886 |
end |
| 7887 |
::else1:: |
| 7888 |
if x.tag == "BUFFERED" then |
| 7889 |
elseif x.tag == "CLOSED" then |
| 7890 |
return NONE |
| 7891 |
else |
| 7892 |
_raise(_Match, "text-io.sml:221:36") |
| 7893 |
end |
| 7894 |
do |
| 7895 |
local buffer = x.payload.buffer |
| 7896 |
local position = x.payload.position |
| 7897 |
local next = x.payload.next |
| 7898 |
local initialPosition = x.payload.initialPosition |
| 7899 |
local tmp55 = position |
| 7900 |
::cont1:: |
| 7901 |
do |
| 7902 |
local a1 = tmp55 |
| 7903 |
if a1 >= #buffer then |
| 7904 |
else |
| 7905 |
goto else2 |
| 7906 |
end |
| 7907 |
do |
| 7908 |
local exp = _L[96](next) |
| 7909 |
if exp.tag == "NONE" then |
| 7910 |
else |
| 7911 |
goto else3 |
| 7912 |
end |
| 7913 |
do |
| 7914 |
local tmp56 = extract(buffer, position, NONE) |
| 7915 |
return {tag = "SOME", payload = {tmp56 .. "\n", next}} |
| 7916 |
end |
| 7917 |
::else3:: |
| 7918 |
if exp.tag == "SOME" then |
| 7919 |
else |
| 7920 |
_raise(_Match, "text-io.sml:229:68") |
| 7921 |
end |
| 7922 |
do |
| 7923 |
local line = exp.payload[1] |
| 7924 |
local next1 = exp.payload[2] |
| 7925 |
local tmp56 = extract(buffer, position, NONE) |
| 7926 |
return {tag = "SOME", payload = {tmp56 .. line, next1}} |
| 7927 |
end |
| 7928 |
end |
| 7929 |
::else2:: |
| 7930 |
local tmp56 = sub1({buffer, a1}) |
| 7931 |
if tmp56 == 10 then |
| 7932 |
else |
| 7933 |
tmp55 = _Int_add(a1, 1) |
| 7934 |
goto cont1 |
| 7935 |
end |
| 7936 |
do |
| 7937 |
local tmp57 = _Int_add(a1, 1) |
| 7938 |
local tmp58 = substring(buffer, position, _Int_sub(tmp57, position)) |
| 7939 |
local tmp59 = _L[93](buffer, tmp57, next, initialPosition) |
| 7940 |
return {tag = "SOME", payload = {tmp58, tmp59}} |
| 7941 |
end |
| 7942 |
end |
| 7943 |
end |
| 7944 |
end |
| 7945 |
end |
| 7946 |
_L[97] = function(a) |
| 7947 |
local tmp54, tmp55 |
| 7948 |
do |
| 7949 |
local x = a[1] |
| 7950 |
if x.tag == "READABLE" then |
| 7951 |
local s = x.payload |
| 7952 |
local tmp56 = s.readable:read("a") |
| 7953 |
local tmp57 = {{tag = "READABLE", payload = s}} |
| 7954 |
a[1] = {tag = "BUFFERED", payload = {buffer = tmp56, initialPosition = NONE, next = tmp57, position = 0}} |
| 7955 |
return {tmp56, tmp57} |
| 7956 |
end |
| 7957 |
tmp55, tmp54 = nil, a |
| 7958 |
end |
| 7959 |
::cont:: |
| 7960 |
do |
| 7961 |
local contentsRev, f = tmp55, tmp54 |
| 7962 |
local exp = _L[92](f) |
| 7963 |
if exp[1] == "" then |
| 7964 |
else |
| 7965 |
local content = exp[1] |
| 7966 |
local f1 = exp[2] |
| 7967 |
tmp55 = {content, contentsRev} |
| 7968 |
tmp54 = f1 |
| 7969 |
goto cont |
| 7970 |
end |
| 7971 |
do |
| 7972 |
local f1 = exp[2] |
| 7973 |
local tmp56 = revAppend(contentsRev, nil) |
| 7974 |
return {table_concat(_VectorOrArray_fromList(tmp56)), f1} |
| 7975 |
end |
| 7976 |
end |
| 7977 |
end |
| 7978 |
_L[98] = function(a) |
| 7979 |
local n, x |
| 7980 |
do |
| 7981 |
local f = a[1] |
| 7982 |
n = a[2] |
| 7983 |
if n < 0 then |
| 7984 |
_raise(_Size, "text-io.sml:251:42") |
| 7985 |
end |
| 7986 |
x = f[1] |
| 7987 |
if x.tag == "READABLE" then |
| 7988 |
_raise({tag = _L[9], payload = {cause = _L[11], ["function"] = "canInput", name = x.payload.name}}, "text-io.sml:254:77") |
| 7989 |
end |
| 7990 |
if x.tag == "PRIM_READER" and x.payload.canInput.tag == "SOME" then |
| 7991 |
else |
| 7992 |
goto else1 |
| 7993 |
end |
| 7994 |
do |
| 7995 |
local tmp54 = x.payload.canInput.payload(nil) |
| 7996 |
if tmp54 then |
| 7997 |
return {tag = "SOME", payload = 1} |
| 7998 |
else |
| 7999 |
return NONE |
| 8000 |
end |
| 8001 |
end |
| 8002 |
end |
| 8003 |
::else1:: |
| 8004 |
if x.tag == "PRIM_READER" and x.payload.canInput.tag == "NONE" then |
| 8005 |
_raise({tag = _L[9], payload = {cause = _L[11], ["function"] = "canInput", name = x.payload.name}}, "text-io.sml:259:108") |
| 8006 |
end |
| 8007 |
if x.tag == "BUFFERED" then |
| 8008 |
local buffer = x.payload.buffer |
| 8009 |
local position = x.payload.position |
| 8010 |
local tmp54 = _Int_sub(#buffer, position) |
| 8011 |
if n < tmp54 then |
| 8012 |
return {tag = "SOME", payload = n} |
| 8013 |
else |
| 8014 |
return {tag = "SOME", payload = tmp54} |
| 8015 |
end |
| 8016 |
elseif x.tag == "CLOSED" then |
| 8017 |
return {tag = "SOME", payload = 0} |
| 8018 |
else |
| 8019 |
_raise(_Match, "text-io.sml:253:42") |
| 8020 |
end |
| 8021 |
end |
| 8022 |
_L[99] = function(a) |
| 8023 |
local tmp54 = a |
| 8024 |
::cont:: |
| 8025 |
do |
| 8026 |
local a1 = tmp54 |
| 8027 |
local x = a1[1] |
| 8028 |
if x.tag == "READABLE" then |
| 8029 |
local readable = x.payload.readable |
| 8030 |
local name = x.payload.name |
| 8031 |
readable:close() |
| 8032 |
a1[1] = {tag = "CLOSED", payload = name} |
| 8033 |
return nil |
| 8034 |
end |
| 8035 |
if x.tag == "PRIM_READER" then |
| 8036 |
elseif x.tag == "BUFFERED" then |
| 8037 |
tmp54 = x.payload.next |
| 8038 |
goto cont |
| 8039 |
elseif x.tag == "CLOSED" then |
| 8040 |
return nil |
| 8041 |
else |
| 8042 |
_raise(_Match, "text-io.sml:262:34") |
| 8043 |
end |
| 8044 |
do |
| 8045 |
local name = x.payload.name |
| 8046 |
x.payload.close(nil) |
| 8047 |
a1[1] = {tag = "CLOSED", payload = name} |
| 8048 |
return nil |
| 8049 |
end |
| 8050 |
end |
| 8051 |
end |
| 8052 |
_L[100] = function(a) |
| 8053 |
local tmp54 = a |
| 8054 |
::cont:: |
| 8055 |
do |
| 8056 |
local a1 = tmp54 |
| 8057 |
local x = a1[1] |
| 8058 |
if x.tag == "READABLE" then |
| 8059 |
return not x.payload.readable:read(0) |
| 8060 |
end |
| 8061 |
if x.tag == "PRIM_READER" then |
| 8062 |
elseif x.tag == "BUFFERED" then |
| 8063 |
return false |
| 8064 |
elseif x.tag == "CLOSED" then |
| 8065 |
return true |
| 8066 |
else |
| 8067 |
_raise(_Match, "text-io.sml:269:38") |
| 8068 |
end |
| 8069 |
do |
| 8070 |
local rd = x.payload |
| 8071 |
_L[91](rd, a1, x.payload.chunkSize) |
| 8072 |
tmp54 = a1 |
| 8073 |
goto cont |
| 8074 |
end |
| 8075 |
end |
| 8076 |
end |
| 8077 |
_L[101] = function(stream, name, s) |
| 8078 |
local tmp54, tmp55 = stream:write(s) |
| 8079 |
if not tmp54 then |
| 8080 |
else |
| 8081 |
return nil |
| 8082 |
end |
| 8083 |
do |
| 8084 |
local tmp56 = _Fail(tmp55) |
| 8085 |
_raise({tag = _L[9], payload = {cause = tmp56, ["function"] = "output", name = name}}, "text-io.sml:290:43") |
| 8086 |
end |
| 8087 |
end |
| 8088 |
_L[102] = function(a) |
| 8089 |
if a[1].tag == "LUA_WRITABLE" then |
| 8090 |
else |
| 8091 |
goto else1 |
| 8092 |
end |
| 8093 |
do |
| 8094 |
local writable = a[1].payload.writable |
| 8095 |
local name = a[1].payload.name |
| 8096 |
return _L[101](writable, name, a[2]) |
| 8097 |
end |
| 8098 |
::else1:: |
| 8099 |
if a[1].tag == "PRIM_WRITER" then |
| 8100 |
else |
| 8101 |
_raise(_Match, "text-io.sml:361:9") |
| 8102 |
end |
| 8103 |
do |
| 8104 |
local name, chunkSize, writeVec, buffer, content, x |
| 8105 |
do |
| 8106 |
name = a[1].payload.writer.name |
| 8107 |
chunkSize = a[1].payload.writer.chunkSize |
| 8108 |
writeVec = a[1].payload.writer.writeVec |
| 8109 |
local buffer_mode = a[1].payload.buffer_mode |
| 8110 |
buffer = a[1].payload.buffer |
| 8111 |
content = a[2] |
| 8112 |
x = buffer_mode[1] |
| 8113 |
if x == "NO_BUF" then |
| 8114 |
else |
| 8115 |
goto else2 |
| 8116 |
end |
| 8117 |
do |
| 8118 |
if writeVec.tag == "SOME" then |
| 8119 |
elseif writeVec.tag == "NONE" then |
| 8120 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "output", name = name}}, "text-io.sml:367:41") |
| 8121 |
else |
| 8122 |
_raise(_Match, "text-io.sml:365:29") |
| 8123 |
end |
| 8124 |
do |
| 8125 |
local writeVec1 = writeVec.payload |
| 8126 |
local tmp54 = tmp28(content) |
| 8127 |
writeVec1(tmp54) |
| 8128 |
return nil |
| 8129 |
end |
| 8130 |
end |
| 8131 |
end |
| 8132 |
::else2:: |
| 8133 |
if x == "LINE_BUF" then |
| 8134 |
else |
| 8135 |
goto else3 |
| 8136 |
end |
| 8137 |
do |
| 8138 |
local tmp54 = tmp34(function(c) |
| 8139 |
return c == 10 |
| 8140 |
end) |
| 8141 |
local tmp55 = tmp54(content) |
| 8142 |
if tmp55 then |
| 8143 |
else |
| 8144 |
buffer[1] = {content, buffer[1]} |
| 8145 |
return nil |
| 8146 |
end |
| 8147 |
do |
| 8148 |
local tmp56 = revAppend({content, buffer[1]}, nil) |
| 8149 |
local tmp57 = table_concat(_VectorOrArray_fromList(tmp56)) |
| 8150 |
if writeVec.tag == "SOME" then |
| 8151 |
elseif writeVec.tag == "NONE" then |
| 8152 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "output", name = name}}, "text-io.sml:373:49") |
| 8153 |
else |
| 8154 |
_raise(_Match, "text-io.sml:371:37") |
| 8155 |
end |
| 8156 |
do |
| 8157 |
local writeVec1 = writeVec.payload |
| 8158 |
local tmp58 = tmp28(tmp57) |
| 8159 |
writeVec1(tmp58) |
| 8160 |
buffer[1] = nil |
| 8161 |
return nil |
| 8162 |
end |
| 8163 |
end |
| 8164 |
end |
| 8165 |
::else3:: |
| 8166 |
if x == "BLOCK_BUF" then |
| 8167 |
else |
| 8168 |
_raise(_Match, "text-io.sml:364:11") |
| 8169 |
end |
| 8170 |
do |
| 8171 |
local x1 = buffer[1] |
| 8172 |
local tmp54 = foldl(function(a1) |
| 8173 |
local z = a1[1] |
| 8174 |
return _Int_add(a1[2], #z) |
| 8175 |
end) |
| 8176 |
local tmp55 = tmp54(#content) |
| 8177 |
local bufSize = tmp55(x1) |
| 8178 |
if bufSize >= chunkSize then |
| 8179 |
else |
| 8180 |
buffer[1] = {content, buffer[1]} |
| 8181 |
return nil |
| 8182 |
end |
| 8183 |
do |
| 8184 |
local tmp56 = revAppend({content, buffer[1]}, nil) |
| 8185 |
local tmp57 = table_concat(_VectorOrArray_fromList(tmp56)) |
| 8186 |
if writeVec.tag == "SOME" then |
| 8187 |
elseif writeVec.tag == "NONE" then |
| 8188 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "output", name = name}}, "text-io.sml:384:53") |
| 8189 |
else |
| 8190 |
_raise(_Match, "text-io.sml:382:41") |
| 8191 |
end |
| 8192 |
do |
| 8193 |
local writeVec1 = writeVec.payload |
| 8194 |
local tmp58 = tmp28(tmp57) |
| 8195 |
writeVec1(tmp58) |
| 8196 |
buffer[1] = nil |
| 8197 |
return nil |
| 8198 |
end |
| 8199 |
end |
| 8200 |
end |
| 8201 |
end |
| 8202 |
end |
| 8203 |
_L[103] = function(a) |
| 8204 |
local stream = a[1] |
| 8205 |
return _L[102]({stream, string_char(a[2])}) |
| 8206 |
end |
| 8207 |
_L[104] = function(name, writeVec, buffer) |
| 8208 |
local tmp54 = revAppend(buffer[1], nil) |
| 8209 |
local tmp55 = table_concat(_VectorOrArray_fromList(tmp54)) |
| 8210 |
buffer[1] = nil |
| 8211 |
if tmp55 ~= "" then |
| 8212 |
else |
| 8213 |
return nil |
| 8214 |
end |
| 8215 |
do |
| 8216 |
if writeVec.tag == "SOME" then |
| 8217 |
elseif writeVec.tag == "NONE" then |
| 8218 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "flushOut", name = name}}, "text-io.sml:406:30") |
| 8219 |
else |
| 8220 |
_raise(_Match, "text-io.sml:404:18") |
| 8221 |
end |
| 8222 |
do |
| 8223 |
local writeVec1 = writeVec.payload |
| 8224 |
local tmp56 = tmp28(tmp55) |
| 8225 |
writeVec1(tmp56) |
| 8226 |
return nil |
| 8227 |
end |
| 8228 |
end |
| 8229 |
end |
| 8230 |
_L[105] = function(a) |
| 8231 |
if a.tag == "LUA_WRITABLE" then |
| 8232 |
a.payload.writable:flush() |
| 8233 |
return nil |
| 8234 |
else |
| 8235 |
if a.tag == "PRIM_WRITER" then |
| 8236 |
else |
| 8237 |
_raise(_Match, "text-io.sml:410:9") |
| 8238 |
end |
| 8239 |
do |
| 8240 |
local name = a.payload.writer.name |
| 8241 |
local writeVec = a.payload.writer.writeVec |
| 8242 |
return _L[104](name, writeVec, a.payload.buffer) |
| 8243 |
end |
| 8244 |
end |
| 8245 |
end |
| 8246 |
_L[106] = function(a) |
| 8247 |
if a.tag == "LUA_WRITABLE" then |
| 8248 |
a.payload.writable:close() |
| 8249 |
return nil |
| 8250 |
end |
| 8251 |
if a.tag == "PRIM_WRITER" then |
| 8252 |
else |
| 8253 |
_raise(_Match, "text-io.sml:413:9") |
| 8254 |
end |
| 8255 |
do |
| 8256 |
local name = a.payload.writer.name |
| 8257 |
local writeVec = a.payload.writer.writeVec |
| 8258 |
local close = a.payload.writer.close |
| 8259 |
_L[104](name, writeVec, a.payload.buffer) |
| 8260 |
return close(nil) |
| 8261 |
end |
| 8262 |
end |
| 8263 |
_L[107] = function(a) |
| 8264 |
if a[1].tag == "LUA_WRITABLE" then |
| 8265 |
local writable = a[1].payload.writable |
| 8266 |
local buffer_mode = a[1].payload.buffer_mode |
| 8267 |
local mode = a[2] |
| 8268 |
local modeString |
| 8269 |
if mode == "NO_BUF" then |
| 8270 |
modeString = "no" |
| 8271 |
elseif mode == "BLOCK_BUF" then |
| 8272 |
modeString = "full" |
| 8273 |
elseif mode == "LINE_BUF" then |
| 8274 |
modeString = "line" |
| 8275 |
else |
| 8276 |
_raise(_Match, "text-io.sml:295:61") |
| 8277 |
end |
| 8278 |
writable:setvbuf(modeString) |
| 8279 |
buffer_mode[1] = mode |
| 8280 |
return nil |
| 8281 |
end |
| 8282 |
if a[1].tag == "PRIM_WRITER" then |
| 8283 |
else |
| 8284 |
_raise(_Match, "text-io.sml:418:9") |
| 8285 |
end |
| 8286 |
do |
| 8287 |
local name = a[1].payload.writer.name |
| 8288 |
local writeVec = a[1].payload.writer.writeVec |
| 8289 |
local buffer_mode = a[1].payload.buffer_mode |
| 8290 |
local buffer = a[1].payload.buffer |
| 8291 |
local mode = a[2] |
| 8292 |
local tmp54 = _L[17](mode, _L[14]) |
| 8293 |
if tmp54 then |
| 8294 |
else |
| 8295 |
buffer_mode[1] = mode |
| 8296 |
return nil |
| 8297 |
end |
| 8298 |
do |
| 8299 |
_L[104](name, writeVec, buffer) |
| 8300 |
buffer_mode[1] = mode |
| 8301 |
return nil |
| 8302 |
end |
| 8303 |
end |
| 8304 |
end |
| 8305 |
_L[108] = function(a) |
| 8306 |
if a.tag == "LUA_WRITABLE" then |
| 8307 |
return a.payload.buffer_mode[1] |
| 8308 |
elseif a.tag == "PRIM_WRITER" then |
| 8309 |
return a.payload.buffer_mode[1] |
| 8310 |
else |
| 8311 |
_raise(_Match, "text-io.sml:429:9") |
| 8312 |
end |
| 8313 |
end |
| 8314 |
_L[109] = function(a) |
| 8315 |
if a[1].ioDesc.tag == "SOME" then |
| 8316 |
local name = a[1].name |
| 8317 |
local ioDesc = a[1].ioDesc.payload |
| 8318 |
local mode = a[2] |
| 8319 |
local tmp54 = _L[56][ioDesc] |
| 8320 |
return {tag = "LUA_WRITABLE", payload = {buffer_mode = {mode}, name = name, writable = tmp54}} |
| 8321 |
else |
| 8322 |
local w = a[1] |
| 8323 |
local tmp54 = {a[2]} |
| 8324 |
return {tag = "PRIM_WRITER", payload = {buffer = {nil}, buffer_mode = tmp54, writer = w}} |
| 8325 |
end |
| 8326 |
end |
| 8327 |
_L[110] = function(a) |
| 8328 |
if a.tag == "LUA_WRITABLE" then |
| 8329 |
else |
| 8330 |
goto else1 |
| 8331 |
end |
| 8332 |
do |
| 8333 |
local writable = a.payload.writable |
| 8334 |
local buffer_mode = a.payload.buffer_mode |
| 8335 |
local name = a.payload.name |
| 8336 |
writable:flush() |
| 8337 |
local tmp54 |
| 8338 |
do |
| 8339 |
local ioDesc = _L[59](writable) |
| 8340 |
local tmp55 = {tag = "SOME", payload = function(slice) |
| 8341 |
local tmp56 = tmp31(slice) |
| 8342 |
_L[101](writable, name, tmp56) |
| 8343 |
writable:flush() |
| 8344 |
return tmp29(slice) |
| 8345 |
end} |
| 8346 |
local tmp56 = function(a1) |
| 8347 |
_L[60](ioDesc) |
| 8348 |
writable:close() |
| 8349 |
return nil |
| 8350 |
end |
| 8351 |
tmp54 = _L[85]({block = NONE, canOutput = NONE, chunkSize = 1024, close = tmp56, endPos = NONE, getPos = NONE, ioDesc = {tag = "SOME", payload = ioDesc}, name = name, setPos = NONE, verifyPos = NONE, writeArr = NONE, writeArrNB = NONE, writeVec = tmp55, writeVecNB = NONE}) |
| 8352 |
end |
| 8353 |
return {tmp54, buffer_mode[1]} |
| 8354 |
end |
| 8355 |
::else1:: |
| 8356 |
if a.tag == "PRIM_WRITER" then |
| 8357 |
else |
| 8358 |
_raise(_Match, "text-io.sml:436:9") |
| 8359 |
end |
| 8360 |
do |
| 8361 |
local writer = a.payload.writer |
| 8362 |
local name = a.payload.writer.name |
| 8363 |
local writeVec = a.payload.writer.writeVec |
| 8364 |
local buffer_mode = a.payload.buffer_mode |
| 8365 |
_L[104](name, writeVec, a.payload.buffer) |
| 8366 |
return {writer, buffer_mode[1]} |
| 8367 |
end |
| 8368 |
end |
| 8369 |
_L[111] = function(a) |
| 8370 |
if a.tag == "LUA_WRITABLE" then |
| 8371 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "getPosOut", name = a.payload.name}}, "text-io.sml:443:50") |
| 8372 |
end |
| 8373 |
if a.tag == "PRIM_WRITER" then |
| 8374 |
else |
| 8375 |
_raise(_Match, "text-io.sml:443:9") |
| 8376 |
end |
| 8377 |
do |
| 8378 |
local writer = a.payload.writer |
| 8379 |
local name = a.payload.writer.name |
| 8380 |
local writeVec = a.payload.writer.writeVec |
| 8381 |
local getPos = a.payload.writer.getPos |
| 8382 |
local buffer_mode = a.payload.buffer_mode |
| 8383 |
local buffer = a.payload.buffer |
| 8384 |
if getPos.tag == "SOME" then |
| 8385 |
elseif getPos.tag == "NONE" then |
| 8386 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "getPosOut", name = name}}, "text-io.sml:449:23") |
| 8387 |
else |
| 8388 |
_raise(_Match, "text-io.sml:445:11") |
| 8389 |
end |
| 8390 |
do |
| 8391 |
local getPos1 = getPos.payload |
| 8392 |
_L[104](name, writeVec, buffer) |
| 8393 |
local tmp54 = getPos1(nil) |
| 8394 |
return {buffer = buffer, buffer_mode = buffer_mode, pos = tmp54, writer = writer} |
| 8395 |
end |
| 8396 |
end |
| 8397 |
end |
| 8398 |
_L[112] = function(a) |
| 8399 |
local writer = a.writer |
| 8400 |
local name = a.writer.name |
| 8401 |
local setPos = a.writer.setPos |
| 8402 |
local buffer_mode = a.buffer_mode |
| 8403 |
local buffer = a.buffer |
| 8404 |
local pos = a.pos |
| 8405 |
if setPos.tag == "SOME" then |
| 8406 |
elseif setPos.tag == "NONE" then |
| 8407 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "setPosOut", name = name}}, "text-io.sml:455:23") |
| 8408 |
else |
| 8409 |
_raise(_Match, "text-io.sml:451:11") |
| 8410 |
end |
| 8411 |
do |
| 8412 |
setPos.payload(pos) |
| 8413 |
return {tag = "PRIM_WRITER", payload = {buffer = buffer, buffer_mode = buffer_mode, writer = writer}} |
| 8414 |
end |
| 8415 |
end |
| 8416 |
_L[113] = _L[86](_L[98], _L[99], _L[106], _L[100], _L[89], function(a) |
| 8417 |
return a.pos |
| 8418 |
end, _L[105], _L[108], _L[111], _L[88], _L[110], _L[92], _L[94], _L[97], _L[95], _L[87], _L[109], _L[102], _L[103], _L[107], _L[112]) |
| 8419 |
_L[114] = function(a) |
| 8420 |
local tmp54 = _L[113].getInstream(a) |
| 8421 |
local exp = _L[96](tmp54) |
| 8422 |
if exp.tag == "NONE" then |
| 8423 |
return NONE |
| 8424 |
end |
| 8425 |
if exp.tag == "SOME" then |
| 8426 |
else |
| 8427 |
_raise(_Match, "text-io.sml:472:24") |
| 8428 |
end |
| 8429 |
do |
| 8430 |
local line = exp.payload[1] |
| 8431 |
local stream_PRIME = exp.payload[2] |
| 8432 |
local tmp55 = _L[113].setInstream |
| 8433 |
tmp55({a, stream_PRIME}) |
| 8434 |
return {tag = "SOME", payload = line} |
| 8435 |
end |
| 8436 |
end |
| 8437 |
_L[115] = function(a) |
| 8438 |
local tmp54, tmp55 = tmp7(a, "r") |
| 8439 |
if tmp54 == nil then |
| 8440 |
else |
| 8441 |
local tmp56 = _L[113].mkInstream |
| 8442 |
return tmp56({{tag = "READABLE", payload = {name = a, readable = tmp54}}}) |
| 8443 |
end |
| 8444 |
do |
| 8445 |
local tmp56 = _Fail(tmp55) |
| 8446 |
_raise({tag = _L[9], payload = {cause = tmp56, ["function"] = "TextIO.openIn", name = a}}, "text-io.sml:479:26") |
| 8447 |
end |
| 8448 |
end |
| 8449 |
do |
| 8450 |
_L[117] = _L[113].mkOutstream |
| 8451 |
_L[116] = _L[117]({tag = "LUA_WRITABLE", payload = {buffer_mode = {_L[15]}, name = "<stdout>", writable = tmp10}}) |
| 8452 |
end |
| 8453 |
do |
| 8454 |
_L[119] = _L[113].mkOutstream |
| 8455 |
_L[118] = _L[119]({tag = "LUA_WRITABLE", payload = {buffer_mode = {_L[14]}, name = "<stderr>", writable = tmp9}}) |
| 8456 |
end |
| 8457 |
_L[120] = _L[113].closeIn |
| 8458 |
_L[121] = _L[113].closeOut |
| 8459 |
_L[122] = _L[113].getInstream |
| 8460 |
_L[123] = _L[113].inputAll |
| 8461 |
_L[124] = _L[113].output |
| 8462 |
_L[125] = function(a) |
| 8463 |
local rd = a[1] |
| 8464 |
local content = a[2] |
| 8465 |
local tip |
| 8466 |
if rd.ioDesc.tag == "SOME" then |
| 8467 |
local name = rd.name |
| 8468 |
tip = {{tag = "READABLE", payload = {name = name, readable = _L[56][rd.ioDesc.payload]}}} |
| 8469 |
else |
| 8470 |
tip = {{tag = "PRIM_READER", payload = rd}} |
| 8471 |
end |
| 8472 |
local tmp54 = tmp51(content) |
| 8473 |
if tmp54 > 0 then |
| 8474 |
return {{tag = "BUFFERED", payload = {buffer = content, initialPosition = NONE, next = tip, position = 0}}} |
| 8475 |
else |
| 8476 |
return tip |
| 8477 |
end |
| 8478 |
end |
| 8479 |
_L[126] = function(a) |
| 8480 |
local tmp54, tmp55 = a, nil |
| 8481 |
::cont:: |
| 8482 |
do |
| 8483 |
local ins, acc = tmp54, tmp55 |
| 8484 |
local x = ins[1] |
| 8485 |
if x.tag == "READABLE" then |
| 8486 |
else |
| 8487 |
goto else1 |
| 8488 |
end |
| 8489 |
do |
| 8490 |
local readable = x.payload.readable |
| 8491 |
local name = x.payload.name |
| 8492 |
ins[1] = {tag = "CLOSED", payload = name} |
| 8493 |
local tmp56 |
| 8494 |
do |
| 8495 |
local ioDesc = _L[59](readable) |
| 8496 |
local tmp57 = {tag = "SOME", payload = function(a1) |
| 8497 |
local exp |
| 8498 |
do |
| 8499 |
local tmp58 = readable:read(a1) |
| 8500 |
if not tmp58 then |
| 8501 |
exp = NONE |
| 8502 |
else |
| 8503 |
exp = {tag = "SOME", payload = tmp58} |
| 8504 |
end |
| 8505 |
end |
| 8506 |
if exp.tag == "NONE" then |
| 8507 |
elseif exp.tag == "SOME" then |
| 8508 |
return exp.payload |
| 8509 |
else |
| 8510 |
_raise(_Match, "bin-io.sml:28:28") |
| 8511 |
end |
| 8512 |
do |
| 8513 |
return tmp50(nil) |
| 8514 |
end |
| 8515 |
end} |
| 8516 |
local tmp58 = function(a1) |
| 8517 |
return NONE |
| 8518 |
end |
| 8519 |
local tmp59 = function(a1) |
| 8520 |
_L[60](ioDesc) |
| 8521 |
readable:close() |
| 8522 |
return nil |
| 8523 |
end |
| 8524 |
tmp56 = _L[81]({avail = tmp58, block = NONE, canInput = NONE, chunkSize = 1024, close = tmp59, endPos = NONE, getPos = NONE, ioDesc = {tag = "SOME", payload = ioDesc}, name = name, readArr = NONE, readArrNB = NONE, readVec = tmp57, readVecNB = NONE, setPos = NONE, verifyPos = NONE}) |
| 8525 |
end |
| 8526 |
local tmp57 = revAppend(acc, nil) |
| 8527 |
local tmp58 = tmp44(tmp57) |
| 8528 |
return {tmp56, tmp58} |
| 8529 |
end |
| 8530 |
::else1:: |
| 8531 |
if x.tag == "PRIM_READER" then |
| 8532 |
else |
| 8533 |
goto else2 |
| 8534 |
end |
| 8535 |
do |
| 8536 |
local rd = x.payload |
| 8537 |
ins[1] = {tag = "CLOSED", payload = x.payload.name} |
| 8538 |
local tmp56 = revAppend(acc, nil) |
| 8539 |
local tmp57 = tmp44(tmp56) |
| 8540 |
return {rd, tmp57} |
| 8541 |
end |
| 8542 |
::else2:: |
| 8543 |
if x.tag == "BUFFERED" then |
| 8544 |
elseif x.tag == "CLOSED" then |
| 8545 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "getReader", name = x.payload}}, "bin-io.sml:103:57") |
| 8546 |
else |
| 8547 |
_raise(_Match, "bin-io.sml:99:38") |
| 8548 |
end |
| 8549 |
do |
| 8550 |
local buffer = x.payload.buffer |
| 8551 |
local position = x.payload.position |
| 8552 |
local next = x.payload.next |
| 8553 |
local tmp56 = tmp47({buffer, position, NONE}) |
| 8554 |
tmp54 = next |
| 8555 |
tmp55 = {tmp56, acc} |
| 8556 |
goto cont |
| 8557 |
end |
| 8558 |
end |
| 8559 |
end |
| 8560 |
_L[127] = function(a) |
| 8561 |
local x = a[1] |
| 8562 |
if x.tag == "READABLE" then |
| 8563 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "filePosIn", name = x.payload.name}}, "bin-io.sml:108:55") |
| 8564 |
end |
| 8565 |
if x.tag == "PRIM_READER" and x.payload.getPos.tag == "NONE" then |
| 8566 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "filePosIn", name = x.payload.name}}, "bin-io.sml:109:88") |
| 8567 |
end |
| 8568 |
if x.tag == "PRIM_READER" and x.payload.getPos.tag == "SOME" then |
| 8569 |
else |
| 8570 |
goto else1 |
| 8571 |
end |
| 8572 |
do |
| 8573 |
return x.payload.getPos.payload(nil) |
| 8574 |
end |
| 8575 |
::else1:: |
| 8576 |
if x.tag == "BUFFERED" and x.payload.initialPosition.tag == "NONE" then |
| 8577 |
local tmp54 |
| 8578 |
do |
| 8579 |
local tmp55 = x.payload.next |
| 8580 |
::cont:: |
| 8581 |
do |
| 8582 |
local a1 = tmp55 |
| 8583 |
local x1 = a1[1] |
| 8584 |
if x1.tag == "READABLE" then |
| 8585 |
tmp54 = x1.payload.name |
| 8586 |
elseif x1.tag == "PRIM_READER" then |
| 8587 |
tmp54 = x1.payload.name |
| 8588 |
elseif x1.tag == "BUFFERED" then |
| 8589 |
tmp55 = x1.payload.next |
| 8590 |
goto cont |
| 8591 |
elseif x1.tag == "CLOSED" then |
| 8592 |
tmp54 = x1.payload |
| 8593 |
else |
| 8594 |
_raise(_Match, "bin-io.sml:84:23") |
| 8595 |
end |
| 8596 |
end |
| 8597 |
end |
| 8598 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "filePosIn", name = tmp54}}, "bin-io.sml:111:92") |
| 8599 |
elseif x.tag == "BUFFERED" and x.payload.initialPosition.tag == "SOME" then |
| 8600 |
local position = x.payload.position |
| 8601 |
return _Int_add(x.payload.initialPosition.payload, position) |
| 8602 |
elseif x.tag == "CLOSED" then |
| 8603 |
_raise({tag = _L[9], payload = {cause = _L[13], ["function"] = "filePosIn", name = x.payload}}, "bin-io.sml:113:44") |
| 8604 |
else |
| 8605 |
_raise(_Match, "bin-io.sml:107:25") |
| 8606 |
end |
| 8607 |
end |
| 8608 |
_L[128] = function(stream, f, n) |
| 8609 |
local exp |
| 8610 |
do |
| 8611 |
local tmp54 = stream.readable:read(n) |
| 8612 |
if not tmp54 then |
| 8613 |
exp = NONE |
| 8614 |
else |
| 8615 |
exp = {tag = "SOME", payload = tmp54} |
| 8616 |
end |
| 8617 |
end |
| 8618 |
if exp.tag == "SOME" then |
| 8619 |
local chunk = exp.payload |
| 8620 |
f[1] = {tag = "BUFFERED", payload = {buffer = chunk, initialPosition = NONE, next = {{tag = "READABLE", payload = stream}}, position = 0}} |
| 8621 |
return true |
| 8622 |
elseif exp.tag == "NONE" then |
| 8623 |
return false |
| 8624 |
else |
| 8625 |
_raise(_Match, "bin-io.sml:115:11") |
| 8626 |
end |
| 8627 |
end |
| 8628 |
_L[129] = function(rd, f, n) |
| 8629 |
local name = rd.name |
| 8630 |
local readVec = rd.readVec |
| 8631 |
local readArr = rd.readArr |
| 8632 |
local readVecNB = rd.readVecNB |
| 8633 |
local readArrNB = rd.readArrNB |
| 8634 |
local block = rd.block |
| 8635 |
local initialPosition |
| 8636 |
do |
| 8637 |
if rd.getPos.tag == "SOME" then |
| 8638 |
else |
| 8639 |
initialPosition = NONE |
| 8640 |
goto cont |
| 8641 |
end |
| 8642 |
do |
| 8643 |
local tmp54 = rd.getPos.payload(nil) |
| 8644 |
initialPosition = {tag = "SOME", payload = tmp54} |
| 8645 |
end |
| 8646 |
end |
| 8647 |
::cont:: |
| 8648 |
local chunk |
| 8649 |
do |
| 8650 |
if readVec.tag == "SOME" then |
| 8651 |
else |
| 8652 |
goto else1 |
| 8653 |
end |
| 8654 |
chunk = readVec.payload(n) |
| 8655 |
goto cont1 |
| 8656 |
::else1:: |
| 8657 |
if readVec.tag == "NONE" then |
| 8658 |
else |
| 8659 |
_raise(_Match, "bin-io.sml:126:27") |
| 8660 |
end |
| 8661 |
do |
| 8662 |
if readArr.tag == "SOME" then |
| 8663 |
else |
| 8664 |
goto else2 |
| 8665 |
end |
| 8666 |
do |
| 8667 |
local ra = readArr.payload |
| 8668 |
local arr = _L[39]({n, 0x0}) |
| 8669 |
local tmp54 = _L[35](arr) |
| 8670 |
local actual = ra(tmp54) |
| 8671 |
local tmp55 = _L[37]({arr, 0, {tag = "SOME", payload = actual}}) |
| 8672 |
chunk = _L[38](tmp55) |
| 8673 |
goto cont1 |
| 8674 |
end |
| 8675 |
::else2:: |
| 8676 |
if readArr.tag == "NONE" then |
| 8677 |
else |
| 8678 |
_raise(_Match, "bin-io.sml:128:39") |
| 8679 |
end |
| 8680 |
do |
| 8681 |
if block.tag == "SOME" and readVecNB.tag == "SOME" then |
| 8682 |
else |
| 8683 |
goto else3 |
| 8684 |
end |
| 8685 |
do |
| 8686 |
local block_PRIME = block.payload |
| 8687 |
local rvNB = readVecNB.payload |
| 8688 |
local exp = rvNB(n) |
| 8689 |
if exp.tag == "SOME" then |
| 8690 |
chunk = exp.payload |
| 8691 |
goto cont1 |
| 8692 |
end |
| 8693 |
if exp.tag == "NONE" then |
| 8694 |
else |
| 8695 |
_raise(_Match, "bin-io.sml:135:56") |
| 8696 |
end |
| 8697 |
do |
| 8698 |
block_PRIME(nil) |
| 8699 |
local exp1 = rvNB(n) |
| 8700 |
if exp1.tag == "SOME" then |
| 8701 |
chunk = exp1.payload |
| 8702 |
goto cont1 |
| 8703 |
else |
| 8704 |
if exp1.tag == "NONE" then |
| 8705 |
else |
| 8706 |
_raise(_Match, "bin-io.sml:138:70") |
| 8707 |
end |
| 8708 |
chunk = tmp50(nil) |
| 8709 |
goto cont1 |
| 8710 |
end |
| 8711 |
end |
| 8712 |
end |
| 8713 |
::else3:: |
| 8714 |
if block.tag == "SOME" and (readVecNB.tag == "NONE" and readArrNB.tag == "SOME") then |
| 8715 |
else |
| 8716 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "<unknown>", name = name}}, "bin-io.sml:154:60") |
| 8717 |
end |
| 8718 |
do |
| 8719 |
local block_PRIME = block.payload |
| 8720 |
local raNB = readArrNB.payload |
| 8721 |
local arr = _L[39]({n, 0x0}) |
| 8722 |
local aslice = _L[35](arr) |
| 8723 |
local exp = raNB(aslice) |
| 8724 |
if exp.tag == "SOME" then |
| 8725 |
else |
| 8726 |
goto else4 |
| 8727 |
end |
| 8728 |
do |
| 8729 |
local tmp54 = _L[37]({arr, 0, {tag = "SOME", payload = exp.payload}}) |
| 8730 |
chunk = _L[38](tmp54) |
| 8731 |
goto cont1 |
| 8732 |
end |
| 8733 |
::else4:: |
| 8734 |
if exp.tag == "NONE" then |
| 8735 |
else |
| 8736 |
_raise(_Match, "bin-io.sml:146:58") |
| 8737 |
end |
| 8738 |
do |
| 8739 |
block_PRIME(nil) |
| 8740 |
local exp1 = raNB(aslice) |
| 8741 |
if exp1.tag == "SOME" then |
| 8742 |
else |
| 8743 |
if exp1.tag == "NONE" then |
| 8744 |
else |
| 8745 |
_raise(_Match, "bin-io.sml:149:72") |
| 8746 |
end |
| 8747 |
chunk = tmp50(nil) |
| 8748 |
goto cont1 |
| 8749 |
end |
| 8750 |
do |
| 8751 |
local tmp54 = _L[37]({arr, 0, {tag = "SOME", payload = exp1.payload}}) |
| 8752 |
chunk = _L[38](tmp54) |
| 8753 |
end |
| 8754 |
end |
| 8755 |
end |
| 8756 |
end |
| 8757 |
end |
| 8758 |
end |
| 8759 |
::cont1:: |
| 8760 |
f[1] = {tag = "BUFFERED", payload = {buffer = chunk, initialPosition = initialPosition, next = {{tag = "PRIM_READER", payload = rd}}, position = 0}} |
| 8761 |
return nil |
| 8762 |
end |
| 8763 |
_L[130] = function(a) |
| 8764 |
local tmp54 = a |
| 8765 |
::cont:: |
| 8766 |
do |
| 8767 |
local a1 = tmp54 |
| 8768 |
local x = a1[1] |
| 8769 |
if x.tag == "READABLE" then |
| 8770 |
else |
| 8771 |
goto else1 |
| 8772 |
end |
| 8773 |
do |
| 8774 |
local tmp55 = _L[128](x.payload, a1, 1) |
| 8775 |
if tmp55 then |
| 8776 |
tmp54 = a1 |
| 8777 |
goto cont |
| 8778 |
end |
| 8779 |
local tmp56 = tmp50(nil) |
| 8780 |
return {tmp56, a1} |
| 8781 |
end |
| 8782 |
::else1:: |
| 8783 |
if x.tag == "PRIM_READER" then |
| 8784 |
else |
| 8785 |
goto else2 |
| 8786 |
end |
| 8787 |
do |
| 8788 |
local rd = x.payload |
| 8789 |
_L[129](rd, a1, x.payload.chunkSize) |
| 8790 |
tmp54 = a1 |
| 8791 |
goto cont |
| 8792 |
end |
| 8793 |
::else2:: |
| 8794 |
if x.tag == "BUFFERED" then |
| 8795 |
else |
| 8796 |
goto else3 |
| 8797 |
end |
| 8798 |
do |
| 8799 |
local buffer = x.payload.buffer |
| 8800 |
local position = x.payload.position |
| 8801 |
local next = x.payload.next |
| 8802 |
local tmp55 = tmp47({buffer, position, NONE}) |
| 8803 |
local tmp56 = tmp48(tmp55) |
| 8804 |
return {tmp56, next} |
| 8805 |
end |
| 8806 |
::else3:: |
| 8807 |
if x.tag == "CLOSED" then |
| 8808 |
else |
| 8809 |
_raise(_Match, "bin-io.sml:157:32") |
| 8810 |
end |
| 8811 |
do |
| 8812 |
local tmp55 = tmp50(nil) |
| 8813 |
return {tmp55, a1} |
| 8814 |
end |
| 8815 |
end |
| 8816 |
end |
| 8817 |
_L[131] = function(buffer, position, next, initialPosition) |
| 8818 |
local tmp54 = tmp51(buffer) |
| 8819 |
if position >= tmp54 then |
| 8820 |
return next |
| 8821 |
else |
| 8822 |
return {{tag = "BUFFERED", payload = {buffer = buffer, initialPosition = initialPosition, next = next, position = position}}} |
| 8823 |
end |
| 8824 |
end |
| 8825 |
_L[132] = function(a) |
| 8826 |
local tmp54 = a |
| 8827 |
::cont:: |
| 8828 |
do |
| 8829 |
local a1 = tmp54 |
| 8830 |
local x = a1[1] |
| 8831 |
if x.tag == "READABLE" then |
| 8832 |
else |
| 8833 |
goto else1 |
| 8834 |
end |
| 8835 |
do |
| 8836 |
local tmp55 = _L[128](x.payload, a1, 1) |
| 8837 |
if tmp55 then |
| 8838 |
tmp54 = a1 |
| 8839 |
goto cont |
| 8840 |
else |
| 8841 |
return NONE |
| 8842 |
end |
| 8843 |
end |
| 8844 |
::else1:: |
| 8845 |
if x.tag == "PRIM_READER" then |
| 8846 |
else |
| 8847 |
goto else2 |
| 8848 |
end |
| 8849 |
do |
| 8850 |
local rd = x.payload |
| 8851 |
_L[129](rd, a1, x.payload.chunkSize) |
| 8852 |
tmp54 = a1 |
| 8853 |
goto cont |
| 8854 |
end |
| 8855 |
::else2:: |
| 8856 |
if x.tag == "BUFFERED" then |
| 8857 |
elseif x.tag == "CLOSED" then |
| 8858 |
return NONE |
| 8859 |
else |
| 8860 |
_raise(_Match, "bin-io.sml:170:33") |
| 8861 |
end |
| 8862 |
do |
| 8863 |
local buffer = x.payload.buffer |
| 8864 |
local position = x.payload.position |
| 8865 |
local next = x.payload.next |
| 8866 |
local initialPosition = x.payload.initialPosition |
| 8867 |
local tmp55 = tmp52({buffer, position}) |
| 8868 |
local tmp56 = _L[131](buffer, _Int_add(position, 1), next, initialPosition) |
| 8869 |
return {tag = "SOME", payload = {tmp55, tmp56}} |
| 8870 |
end |
| 8871 |
end |
| 8872 |
end |
| 8873 |
_L[133] = function(a) |
| 8874 |
local tmp54, tmp55 |
| 8875 |
do |
| 8876 |
local f = a[1] |
| 8877 |
tmp54 = f |
| 8878 |
tmp55 = a[2] |
| 8879 |
end |
| 8880 |
::cont:: |
| 8881 |
do |
| 8882 |
local f, n = tmp54, tmp55 |
| 8883 |
local x = f[1] |
| 8884 |
if x.tag == "READABLE" then |
| 8885 |
else |
| 8886 |
goto else1 |
| 8887 |
end |
| 8888 |
do |
| 8889 |
local tmp56 = _L[128](x.payload, f, n) |
| 8890 |
if tmp56 then |
| 8891 |
tmp54 = f |
| 8892 |
tmp55 = n |
| 8893 |
goto cont |
| 8894 |
end |
| 8895 |
local tmp57 = tmp50(nil) |
| 8896 |
return {tmp57, f} |
| 8897 |
end |
| 8898 |
::else1:: |
| 8899 |
if x.tag == "PRIM_READER" then |
| 8900 |
else |
| 8901 |
goto else2 |
| 8902 |
end |
| 8903 |
_L[129](x.payload, f, n) |
| 8904 |
tmp54 = f |
| 8905 |
tmp55 = n |
| 8906 |
goto cont |
| 8907 |
::else2:: |
| 8908 |
if x.tag == "BUFFERED" then |
| 8909 |
else |
| 8910 |
goto else3 |
| 8911 |
end |
| 8912 |
do |
| 8913 |
local buffer, position, next |
| 8914 |
do |
| 8915 |
buffer = x.payload.buffer |
| 8916 |
position = x.payload.position |
| 8917 |
next = x.payload.next |
| 8918 |
local initialPosition = x.payload.initialPosition |
| 8919 |
local tmp56 = _Int_add(position, n) |
| 8920 |
local tmp57 = tmp51(buffer) |
| 8921 |
if tmp56 <= tmp57 then |
| 8922 |
else |
| 8923 |
goto else4 |
| 8924 |
end |
| 8925 |
do |
| 8926 |
local tmp58 = tmp47({buffer, position, {tag = "SOME", payload = n}}) |
| 8927 |
local tmp59 = tmp48(tmp58) |
| 8928 |
local tmp60 = _L[131](buffer, tmp56, next, initialPosition) |
| 8929 |
return {tmp59, tmp60} |
| 8930 |
end |
| 8931 |
end |
| 8932 |
::else4:: |
| 8933 |
local buffer0 = tmp47({buffer, position, NONE}) |
| 8934 |
local tmp56 = tmp46(buffer0) |
| 8935 |
local exp = _L[133]({next, _Int_sub(n, tmp56)}) |
| 8936 |
local buffer1 = exp[1] |
| 8937 |
local next1 = exp[2] |
| 8938 |
local tmp57 = tmp45(buffer1) |
| 8939 |
local tmp58 = tmp44({buffer0, {tmp57, nil}}) |
| 8940 |
return {tmp58, next1} |
| 8941 |
end |
| 8942 |
::else3:: |
| 8943 |
if x.tag == "CLOSED" then |
| 8944 |
else |
| 8945 |
_raise(_Match, "bin-io.sml:178:36") |
| 8946 |
end |
| 8947 |
do |
| 8948 |
local tmp56 = tmp50(nil) |
| 8949 |
return {tmp56, f} |
| 8950 |
end |
| 8951 |
end |
| 8952 |
end |
| 8953 |
_L[134] = function(a) |
| 8954 |
local tmp54, tmp55 |
| 8955 |
do |
| 8956 |
local x = a[1] |
| 8957 |
if x.tag == "READABLE" then |
| 8958 |
local s = x.payload |
| 8959 |
local tmp56 = s.readable:read("a") |
| 8960 |
local tmp57 = {{tag = "READABLE", payload = s}} |
| 8961 |
a[1] = {tag = "BUFFERED", payload = {buffer = tmp56, initialPosition = NONE, next = tmp57, position = 0}} |
| 8962 |
return {tmp56, tmp57} |
| 8963 |
end |
| 8964 |
tmp55, tmp54 = nil, a |
| 8965 |
end |
| 8966 |
::cont:: |
| 8967 |
do |
| 8968 |
local contentsRev, f = tmp55, tmp54 |
| 8969 |
local exp = _L[130](f) |
| 8970 |
local content = exp[1] |
| 8971 |
local f1 = exp[2] |
| 8972 |
local tmp56 = tmp51(content) |
| 8973 |
if tmp56 == 0 then |
| 8974 |
else |
| 8975 |
tmp55 = {content, contentsRev} |
| 8976 |
tmp54 = f1 |
| 8977 |
goto cont |
| 8978 |
end |
| 8979 |
do |
| 8980 |
local tmp57 = revAppend(contentsRev, nil) |
| 8981 |
local tmp58 = tmp49(tmp57) |
| 8982 |
return {tmp58, f1} |
| 8983 |
end |
| 8984 |
end |
| 8985 |
end |
| 8986 |
_L[135] = function(a) |
| 8987 |
local n, x |
| 8988 |
do |
| 8989 |
local f = a[1] |
| 8990 |
n = a[2] |
| 8991 |
if n < 0 then |
| 8992 |
_raise(_Size, "bin-io.sml:208:42") |
| 8993 |
end |
| 8994 |
x = f[1] |
| 8995 |
if x.tag == "READABLE" then |
| 8996 |
_raise({tag = _L[9], payload = {cause = _L[11], ["function"] = "canInput", name = x.payload.name}}, "bin-io.sml:211:77") |
| 8997 |
end |
| 8998 |
if x.tag == "PRIM_READER" and x.payload.canInput.tag == "SOME" then |
| 8999 |
else |
| 9000 |
goto else1 |
| 9001 |
end |
| 9002 |
do |
| 9003 |
local tmp54 = x.payload.canInput.payload(nil) |
| 9004 |
if tmp54 then |
| 9005 |
return {tag = "SOME", payload = 1} |
| 9006 |
else |
| 9007 |
return NONE |
| 9008 |
end |
| 9009 |
end |
| 9010 |
end |
| 9011 |
::else1:: |
| 9012 |
if x.tag == "PRIM_READER" and x.payload.canInput.tag == "NONE" then |
| 9013 |
_raise({tag = _L[9], payload = {cause = _L[11], ["function"] = "canInput", name = x.payload.name}}, "bin-io.sml:216:107") |
| 9014 |
end |
| 9015 |
if x.tag == "BUFFERED" then |
| 9016 |
elseif x.tag == "CLOSED" then |
| 9017 |
return {tag = "SOME", payload = 0} |
| 9018 |
else |
| 9019 |
_raise(_Match, "bin-io.sml:210:42") |
| 9020 |
end |
| 9021 |
do |
| 9022 |
local buffer = x.payload.buffer |
| 9023 |
local position = x.payload.position |
| 9024 |
local tmp54 = tmp51(buffer) |
| 9025 |
local tmp55 = _Int_sub(tmp54, position) |
| 9026 |
if n < tmp55 then |
| 9027 |
return {tag = "SOME", payload = n} |
| 9028 |
else |
| 9029 |
return {tag = "SOME", payload = tmp55} |
| 9030 |
end |
| 9031 |
end |
| 9032 |
end |
| 9033 |
_L[136] = function(a) |
| 9034 |
local tmp54 = a |
| 9035 |
::cont:: |
| 9036 |
do |
| 9037 |
local a1 = tmp54 |
| 9038 |
local x = a1[1] |
| 9039 |
if x.tag == "READABLE" then |
| 9040 |
local readable = x.payload.readable |
| 9041 |
local name = x.payload.name |
| 9042 |
readable:close() |
| 9043 |
a1[1] = {tag = "CLOSED", payload = name} |
| 9044 |
return nil |
| 9045 |
end |
| 9046 |
if x.tag == "PRIM_READER" then |
| 9047 |
elseif x.tag == "BUFFERED" then |
| 9048 |
tmp54 = x.payload.next |
| 9049 |
goto cont |
| 9050 |
elseif x.tag == "CLOSED" then |
| 9051 |
return nil |
| 9052 |
else |
| 9053 |
_raise(_Match, "bin-io.sml:219:34") |
| 9054 |
end |
| 9055 |
do |
| 9056 |
local name = x.payload.name |
| 9057 |
x.payload.close(nil) |
| 9058 |
a1[1] = {tag = "CLOSED", payload = name} |
| 9059 |
return nil |
| 9060 |
end |
| 9061 |
end |
| 9062 |
end |
| 9063 |
_L[137] = function(a) |
| 9064 |
local tmp54 = a |
| 9065 |
::cont:: |
| 9066 |
do |
| 9067 |
local a1 = tmp54 |
| 9068 |
local x = a1[1] |
| 9069 |
if x.tag == "READABLE" then |
| 9070 |
return not x.payload.readable:read(0) |
| 9071 |
end |
| 9072 |
if x.tag == "PRIM_READER" then |
| 9073 |
elseif x.tag == "BUFFERED" then |
| 9074 |
return false |
| 9075 |
elseif x.tag == "CLOSED" then |
| 9076 |
return true |
| 9077 |
else |
| 9078 |
_raise(_Match, "bin-io.sml:226:38") |
| 9079 |
end |
| 9080 |
do |
| 9081 |
local rd = x.payload |
| 9082 |
_L[129](rd, a1, x.payload.chunkSize) |
| 9083 |
tmp54 = a1 |
| 9084 |
goto cont |
| 9085 |
end |
| 9086 |
end |
| 9087 |
end |
| 9088 |
_L[138] = function(stream, name, s) |
| 9089 |
local tmp54, tmp55 = stream:write(s) |
| 9090 |
if not tmp54 then |
| 9091 |
else |
| 9092 |
return nil |
| 9093 |
end |
| 9094 |
do |
| 9095 |
local tmp56 = _Fail(tmp55) |
| 9096 |
_raise({tag = _L[9], payload = {cause = tmp56, ["function"] = "output", name = name}}, "bin-io.sml:248:18") |
| 9097 |
end |
| 9098 |
end |
| 9099 |
_L[139] = function(a) |
| 9100 |
if a[1].tag == "LUA_WRITABLE" then |
| 9101 |
else |
| 9102 |
goto else1 |
| 9103 |
end |
| 9104 |
do |
| 9105 |
local writable = a[1].payload.writable |
| 9106 |
local name = a[1].payload.name |
| 9107 |
return _L[138](writable, name, a[2]) |
| 9108 |
end |
| 9109 |
::else1:: |
| 9110 |
if a[1].tag == "PRIM_WRITER" then |
| 9111 |
else |
| 9112 |
_raise(_Match, "bin-io.sml:317:9") |
| 9113 |
end |
| 9114 |
do |
| 9115 |
local name, chunkSize, writeVec, buffer, content |
| 9116 |
do |
| 9117 |
name = a[1].payload.writer.name |
| 9118 |
chunkSize = a[1].payload.writer.chunkSize |
| 9119 |
writeVec = a[1].payload.writer.writeVec |
| 9120 |
local buffer_mode = a[1].payload.buffer_mode |
| 9121 |
buffer = a[1].payload.buffer |
| 9122 |
content = a[2] |
| 9123 |
if buffer_mode[1] == "NO_BUF" then |
| 9124 |
else |
| 9125 |
goto else2 |
| 9126 |
end |
| 9127 |
do |
| 9128 |
if writeVec.tag == "SOME" then |
| 9129 |
elseif writeVec.tag == "NONE" then |
| 9130 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "output", name = name}}, "bin-io.sml:323:41") |
| 9131 |
else |
| 9132 |
_raise(_Match, "bin-io.sml:321:29") |
| 9133 |
end |
| 9134 |
do |
| 9135 |
local writeVec1 = writeVec.payload |
| 9136 |
local tmp54 = tmp45(content) |
| 9137 |
writeVec1(tmp54) |
| 9138 |
return nil |
| 9139 |
end |
| 9140 |
end |
| 9141 |
end |
| 9142 |
::else2:: |
| 9143 |
local x = buffer[1] |
| 9144 |
local tmp54 = foldl(function(a1) |
| 9145 |
local z = a1[1] |
| 9146 |
local acc = a1[2] |
| 9147 |
local tmp55 = tmp51(z) |
| 9148 |
return _Int_add(acc, tmp55) |
| 9149 |
end) |
| 9150 |
local tmp55 = tmp51(content) |
| 9151 |
local tmp56 = tmp54(tmp55) |
| 9152 |
local bufSize = tmp56(x) |
| 9153 |
if bufSize >= chunkSize then |
| 9154 |
else |
| 9155 |
buffer[1] = {content, buffer[1]} |
| 9156 |
return nil |
| 9157 |
end |
| 9158 |
do |
| 9159 |
local tmp57 = revAppend({content, buffer[1]}, nil) |
| 9160 |
local content_PRIME = tmp49(tmp57) |
| 9161 |
if writeVec.tag == "SOME" then |
| 9162 |
elseif writeVec.tag == "NONE" then |
| 9163 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "output", name = name}}, "bin-io.sml:332:37") |
| 9164 |
else |
| 9165 |
_raise(_Match, "bin-io.sml:330:25") |
| 9166 |
end |
| 9167 |
do |
| 9168 |
local writeVec1 = writeVec.payload |
| 9169 |
local tmp58 = tmp45(content_PRIME) |
| 9170 |
writeVec1(tmp58) |
| 9171 |
buffer[1] = nil |
| 9172 |
return nil |
| 9173 |
end |
| 9174 |
end |
| 9175 |
end |
| 9176 |
end |
| 9177 |
_L[140] = function(a) |
| 9178 |
local stream = a[1] |
| 9179 |
local tmp54 = tmp50({a[2], nil}) |
| 9180 |
return _L[139]({stream, tmp54}) |
| 9181 |
end |
| 9182 |
_L[141] = function(name, writeVec, buffer) |
| 9183 |
local tmp54 = revAppend(buffer[1], nil) |
| 9184 |
local content = tmp49(tmp54) |
| 9185 |
buffer[1] = nil |
| 9186 |
local tmp55 = tmp51(content) |
| 9187 |
if tmp55 > 0 then |
| 9188 |
else |
| 9189 |
return nil |
| 9190 |
end |
| 9191 |
do |
| 9192 |
if writeVec.tag == "SOME" then |
| 9193 |
elseif writeVec.tag == "NONE" then |
| 9194 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "flushOut", name = name}}, "bin-io.sml:353:30") |
| 9195 |
else |
| 9196 |
_raise(_Match, "bin-io.sml:351:18") |
| 9197 |
end |
| 9198 |
do |
| 9199 |
local writeVec1 = writeVec.payload |
| 9200 |
local tmp56 = tmp45(content) |
| 9201 |
writeVec1(tmp56) |
| 9202 |
return nil |
| 9203 |
end |
| 9204 |
end |
| 9205 |
end |
| 9206 |
_L[142] = function(a) |
| 9207 |
if a.tag == "LUA_WRITABLE" then |
| 9208 |
a.payload.writable:flush() |
| 9209 |
return nil |
| 9210 |
else |
| 9211 |
if a.tag == "PRIM_WRITER" then |
| 9212 |
else |
| 9213 |
_raise(_Match, "bin-io.sml:357:9") |
| 9214 |
end |
| 9215 |
do |
| 9216 |
local name = a.payload.writer.name |
| 9217 |
local writeVec = a.payload.writer.writeVec |
| 9218 |
return _L[141](name, writeVec, a.payload.buffer) |
| 9219 |
end |
| 9220 |
end |
| 9221 |
end |
| 9222 |
_L[143] = function(a) |
| 9223 |
if a.tag == "LUA_WRITABLE" then |
| 9224 |
a.payload.writable:close() |
| 9225 |
return nil |
| 9226 |
end |
| 9227 |
if a.tag == "PRIM_WRITER" then |
| 9228 |
else |
| 9229 |
_raise(_Match, "bin-io.sml:360:9") |
| 9230 |
end |
| 9231 |
do |
| 9232 |
local name = a.payload.writer.name |
| 9233 |
local writeVec = a.payload.writer.writeVec |
| 9234 |
local close = a.payload.writer.close |
| 9235 |
_L[141](name, writeVec, a.payload.buffer) |
| 9236 |
return close(nil) |
| 9237 |
end |
| 9238 |
end |
| 9239 |
_L[144] = function(a) |
| 9240 |
if a[1].tag == "LUA_WRITABLE" then |
| 9241 |
local writable = a[1].payload.writable |
| 9242 |
local buffer_mode = a[1].payload.buffer_mode |
| 9243 |
local mode = a[2] |
| 9244 |
local modeString |
| 9245 |
if mode == "NO_BUF" then |
| 9246 |
modeString = "no" |
| 9247 |
else |
| 9248 |
modeString = "full" |
| 9249 |
end |
| 9250 |
writable:setvbuf(modeString) |
| 9251 |
buffer_mode[1] = mode |
| 9252 |
return nil |
| 9253 |
end |
| 9254 |
if a[1].tag == "PRIM_WRITER" then |
| 9255 |
else |
| 9256 |
_raise(_Match, "bin-io.sml:365:9") |
| 9257 |
end |
| 9258 |
do |
| 9259 |
local name = a[1].payload.writer.name |
| 9260 |
local writeVec = a[1].payload.writer.writeVec |
| 9261 |
local buffer_mode = a[1].payload.buffer_mode |
| 9262 |
local buffer = a[1].payload.buffer |
| 9263 |
local mode = a[2] |
| 9264 |
local tmp54 = _L[17](mode, _L[14]) |
| 9265 |
if tmp54 then |
| 9266 |
else |
| 9267 |
buffer_mode[1] = mode |
| 9268 |
return nil |
| 9269 |
end |
| 9270 |
do |
| 9271 |
_L[141](name, writeVec, buffer) |
| 9272 |
buffer_mode[1] = mode |
| 9273 |
return nil |
| 9274 |
end |
| 9275 |
end |
| 9276 |
end |
| 9277 |
_L[145] = function(a) |
| 9278 |
if a.tag == "LUA_WRITABLE" then |
| 9279 |
return a.payload.buffer_mode[1] |
| 9280 |
elseif a.tag == "PRIM_WRITER" then |
| 9281 |
return a.payload.buffer_mode[1] |
| 9282 |
else |
| 9283 |
_raise(_Match, "bin-io.sml:376:9") |
| 9284 |
end |
| 9285 |
end |
| 9286 |
_L[146] = function(a) |
| 9287 |
if a[1].ioDesc.tag == "SOME" then |
| 9288 |
local name = a[1].name |
| 9289 |
local ioDesc = a[1].ioDesc.payload |
| 9290 |
local mode = a[2] |
| 9291 |
local tmp54 = _L[56][ioDesc] |
| 9292 |
return {tag = "LUA_WRITABLE", payload = {buffer_mode = {mode}, name = name, writable = tmp54}} |
| 9293 |
else |
| 9294 |
local w = a[1] |
| 9295 |
local tmp54 = {a[2]} |
| 9296 |
return {tag = "PRIM_WRITER", payload = {buffer = {nil}, buffer_mode = tmp54, writer = w}} |
| 9297 |
end |
| 9298 |
end |
| 9299 |
_L[147] = function(a) |
| 9300 |
if a.tag == "LUA_WRITABLE" then |
| 9301 |
else |
| 9302 |
goto else1 |
| 9303 |
end |
| 9304 |
do |
| 9305 |
local writable = a.payload.writable |
| 9306 |
local buffer_mode = a.payload.buffer_mode |
| 9307 |
local name = a.payload.name |
| 9308 |
writable:flush() |
| 9309 |
local tmp54 |
| 9310 |
do |
| 9311 |
local ioDesc = _L[59](writable) |
| 9312 |
local tmp55 = {tag = "SOME", payload = function(slice) |
| 9313 |
local tmp56 = tmp48(slice) |
| 9314 |
_L[138](writable, name, tmp56) |
| 9315 |
writable:flush() |
| 9316 |
return tmp46(slice) |
| 9317 |
end} |
| 9318 |
local tmp56 = function(a1) |
| 9319 |
_L[60](ioDesc) |
| 9320 |
writable:close() |
| 9321 |
return nil |
| 9322 |
end |
| 9323 |
tmp54 = _L[82]({block = NONE, canOutput = NONE, chunkSize = 1024, close = tmp56, endPos = NONE, getPos = NONE, ioDesc = {tag = "SOME", payload = ioDesc}, name = name, setPos = NONE, verifyPos = NONE, writeArr = NONE, writeArrNB = NONE, writeVec = tmp55, writeVecNB = NONE}) |
| 9324 |
end |
| 9325 |
return {tmp54, buffer_mode[1]} |
| 9326 |
end |
| 9327 |
::else1:: |
| 9328 |
if a.tag == "PRIM_WRITER" then |
| 9329 |
else |
| 9330 |
_raise(_Match, "bin-io.sml:383:9") |
| 9331 |
end |
| 9332 |
do |
| 9333 |
local writer = a.payload.writer |
| 9334 |
local name = a.payload.writer.name |
| 9335 |
local writeVec = a.payload.writer.writeVec |
| 9336 |
local buffer_mode = a.payload.buffer_mode |
| 9337 |
_L[141](name, writeVec, a.payload.buffer) |
| 9338 |
return {writer, buffer_mode[1]} |
| 9339 |
end |
| 9340 |
end |
| 9341 |
_L[148] = function(a) |
| 9342 |
if a.tag == "LUA_WRITABLE" then |
| 9343 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "getPosOut", name = a.payload.name}}, "bin-io.sml:390:50") |
| 9344 |
end |
| 9345 |
if a.tag == "PRIM_WRITER" then |
| 9346 |
else |
| 9347 |
_raise(_Match, "bin-io.sml:390:9") |
| 9348 |
end |
| 9349 |
do |
| 9350 |
local writer = a.payload.writer |
| 9351 |
local name = a.payload.writer.name |
| 9352 |
local writeVec = a.payload.writer.writeVec |
| 9353 |
local getPos = a.payload.writer.getPos |
| 9354 |
local buffer_mode = a.payload.buffer_mode |
| 9355 |
local buffer = a.payload.buffer |
| 9356 |
if getPos.tag == "SOME" then |
| 9357 |
elseif getPos.tag == "NONE" then |
| 9358 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "getPosOut", name = name}}, "bin-io.sml:396:23") |
| 9359 |
else |
| 9360 |
_raise(_Match, "bin-io.sml:392:11") |
| 9361 |
end |
| 9362 |
do |
| 9363 |
local getPos1 = getPos.payload |
| 9364 |
_L[141](name, writeVec, buffer) |
| 9365 |
local tmp54 = getPos1(nil) |
| 9366 |
return {buffer = buffer, buffer_mode = buffer_mode, pos = tmp54, writer = writer} |
| 9367 |
end |
| 9368 |
end |
| 9369 |
end |
| 9370 |
_L[149] = function(a) |
| 9371 |
local writer = a.writer |
| 9372 |
local name = a.writer.name |
| 9373 |
local setPos = a.writer.setPos |
| 9374 |
local buffer_mode = a.buffer_mode |
| 9375 |
local buffer = a.buffer |
| 9376 |
local pos = a.pos |
| 9377 |
if setPos.tag == "SOME" then |
| 9378 |
elseif setPos.tag == "NONE" then |
| 9379 |
_raise({tag = _L[9], payload = {cause = _L[12], ["function"] = "setPosOut", name = name}}, "bin-io.sml:402:23") |
| 9380 |
else |
| 9381 |
_raise(_Match, "bin-io.sml:398:11") |
| 9382 |
end |
| 9383 |
do |
| 9384 |
setPos.payload(pos) |
| 9385 |
return {tag = "PRIM_WRITER", payload = {buffer = buffer, buffer_mode = buffer_mode, writer = writer}} |
| 9386 |
end |
| 9387 |
end |
| 9388 |
_L[150] = _L[86](_L[135], _L[136], _L[143], _L[137], _L[127], function(a) |
| 9389 |
return a.pos |
| 9390 |
end, _L[142], _L[145], _L[148], _L[126], _L[147], _L[130], _L[132], _L[134], _L[133], _L[125], _L[146], _L[139], _L[140], _L[144], _L[149]) |
| 9391 |
_L[151] = function(a) |
| 9392 |
local tmp54, tmp55 = tmp7(a, "rb") |
| 9393 |
if tmp54 == nil then |
| 9394 |
else |
| 9395 |
local tmp56 = _L[150].mkInstream |
| 9396 |
return tmp56({{tag = "READABLE", payload = {name = a, readable = tmp54}}}) |
| 9397 |
end |
| 9398 |
do |
| 9399 |
local tmp56 = _Fail(tmp55) |
| 9400 |
_raise({tag = _L[9], payload = {cause = tmp56, ["function"] = "BinIO.openIn", name = a}}, "bin-io.sml:421:26") |
| 9401 |
end |
| 9402 |
end |
| 9403 |
_L[152] = _L[150].closeIn |
| 9404 |
_L[153] = _L[150].inputAll |
| 9405 |
_L[154] = _ENV.arg |
| 9406 |
_Array_array(64, nil) |
| 9407 |
_L[155] = function(a) |
| 9408 |
local status, exn = _handle(function() |
| 9409 |
local tmp54 = _Int_add(a, a) |
| 9410 |
if tmp54 < math_maxinteger then |
| 9411 |
else |
| 9412 |
return a |
| 9413 |
end |
| 9414 |
do |
| 9415 |
return _L[155](tmp54) |
| 9416 |
end |
| 9417 |
end) |
| 9418 |
if not status then |
| 9419 |
if __exn_instanceof(exn, _Overflow_tag) then |
| 9420 |
return a |
| 9421 |
else |
| 9422 |
_raise(exn, nil) |
| 9423 |
end |
| 9424 |
else |
| 9425 |
return exn |
| 9426 |
end |
| 9427 |
end |
| 9428 |
_L[155](65536) |
| 9429 |
_L[156] = _L[39]({256, 0xFF}) |
| 9430 |
_L[45]({_L[156], 9, 0x41}) |
| 9431 |
_L[45]({_L[156], 10, 0x41}) |
| 9432 |
_L[45]({_L[156], 13, 0x41}) |
| 9433 |
_L[45]({_L[156], 32, 0x41}) |
| 9434 |
_L[157] = tmp33(function(a) |
| 9435 |
local i = a[1] |
| 9436 |
local c = a[2] |
| 9437 |
return _L[45]({_L[156], c, i & 0xFF}) |
| 9438 |
end) |
| 9439 |
_L[157]("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") |
| 9440 |
tmp53({256, function(i) |
| 9441 |
return _L[43]({_L[156], i}) |
| 9442 |
end}) |
| 9443 |
_L[158] = _L[39]({256, 0xFF}) |
| 9444 |
_L[159] = tmp33(function(a) |
| 9445 |
local i = a[1] |
| 9446 |
local c = a[2] |
| 9447 |
return _L[45]({_L[158], c, i & 0xFF}) |
| 9448 |
end) |
| 9449 |
_L[159]("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") |
| 9450 |
tmp53({256, function(i) |
| 9451 |
return _L[43]({_L[158], i}) |
| 9452 |
end}) |
| 9453 |
tmp50(_list({n = 9, 0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF})) |
| 9454 |
tmp50(_list({n = 9, 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x0})) |
| 9455 |
do |
| 9456 |
_L[160], _L[161] = _handle(function() |
| 9457 |
_Int_mul(8, _L[42]) |
| 9458 |
return nil |
| 9459 |
end) |
| 9460 |
if not _L[160] then |
| 9461 |
if __exn_instanceof(_L[161], _Overflow_tag) then |
| 9462 |
else |
| 9463 |
_raise(_L[161], nil) |
| 9464 |
end |
| 9465 |
end |
| 9466 |
end |
| 9467 |
do |
| 9468 |
_L[162] = _L[22](2147483646) |
| 9469 |
if _L[162].tag == "ZERO" then |
| 9470 |
elseif _L[162].tag == "POSITIVE" then |
| 9471 |
elseif _L[162].tag == "NEGATIVE" then |
| 9472 |
else |
| 9473 |
_raise(_Match, "int-inf.sml:130:5") |
| 9474 |
end |
| 9475 |
end |
| 9476 |
_L[163] = _L[22](2147483647) |
| 9477 |
do |
| 9478 |
if _L[163].tag == "ZERO" then |
| 9479 |
goto cont2 |
| 9480 |
end |
| 9481 |
if _L[163].tag == "POSITIVE" then |
| 9482 |
else |
| 9483 |
goto else1 |
| 9484 |
end |
| 9485 |
toRealAbs(_L[163].payload) |
| 9486 |
goto cont2 |
| 9487 |
::else1:: |
| 9488 |
if _L[163].tag == "NEGATIVE" then |
| 9489 |
else |
| 9490 |
_raise(_Match, "int-inf.sml:1082:5") |
| 9491 |
end |
| 9492 |
do |
| 9493 |
_L[164] = toRealAbs(_L[163].payload) |
| 9494 |
end |
| 9495 |
end |
| 9496 |
::cont2:: |
| 9497 |
_id(32768 * 1.0) |
| 9498 |
_id(32768 * 1.0) |
| 9499 |
_Int_add(3, 48) |
| 9500 |
do |
| 9501 |
_L[165] = 123 & 0x7FFFFFFF |
| 9502 |
if not math_ult(0x1, tmp24) then |
| 9503 |
_L[166] = 0x0 |
| 9504 |
else |
| 9505 |
_L[166] = _L[165] << 0x1 |
| 9506 |
end |
| 9507 |
_L[167], _L[168], _L[169], _L[170] = 48, nil, _L[166] + 0x1, 73256 |
| 9508 |
::cont5:: |
| 9509 |
do |
| 9510 |
local _L1 = {} |
| 9511 |
_L1[1], _L1[2], _L1[3], _L1[4] = _L[167], _L[168], _L[169], _L[170] |
| 9512 |
if _L1[1] == 0 then |
| 9513 |
goto cont3 |
| 9514 |
end |
| 9515 |
_L1[5], _L1[6], _L1[7], _L1[8] = 31, 0x0, _L1[3], _L1[4] |
| 9516 |
::cont6:: |
| 9517 |
do |
| 9518 |
local _L2 = {} |
| 9519 |
_L2[1], _L2[2], _L2[3], _L2[4] = _L1[5], _L1[6], _L1[7], _L1[8] |
| 9520 |
if _L2[1] == 0 then |
| 9521 |
_L2[5] = _Int_sub(_L1[1], 1) |
| 9522 |
_L[167] = _L2[5] |
| 9523 |
_L[168] = {_L2[2], _L1[2]} |
| 9524 |
_L[169] = _L2[3] |
| 9525 |
_L[170] = _L2[4] |
| 9526 |
goto cont5 |
| 9527 |
end |
| 9528 |
_L2[6] = _Int_sub(_L2[1], 1) |
| 9529 |
do |
| 9530 |
_L2[8] = 0xBC8F * _Word_mod(_L2[3], 0xADC8) |
| 9531 |
_L2[9] = 0xD47 * ((_L2[3] >> 3) // 5561) |
| 9532 |
if math_ult(_L2[9], _L2[8]) then |
| 9533 |
_L2[7] = _L2[8] - _L2[9] |
| 9534 |
else |
| 9535 |
_L2[7] = 0x7FFFFFFF - _L2[9] + _L2[8] |
| 9536 |
end |
| 9537 |
end |
| 9538 |
if not math_ult(0x12, tmp24) then |
| 9539 |
_L2[10] = 0x0 |
| 9540 |
else |
| 9541 |
_L2[10] = _L2[4] << 0x12 |
| 9542 |
end |
| 9543 |
_L2[11] = _L2[4] ~ _L2[10] |
| 9544 |
if not math_ult(0xD, tmp24) then |
| 9545 |
_L2[12] = 0x0 |
| 9546 |
else |
| 9547 |
_L2[12] = _L2[11] >> 0xD |
| 9548 |
end |
| 9549 |
_L2[13] = _L2[11] ~ _L2[12] |
| 9550 |
if not math_ult(0x1, tmp24) then |
| 9551 |
_L2[14] = 0x0 |
| 9552 |
else |
| 9553 |
_L2[14] = _L2[2] >> 0x1 |
| 9554 |
end |
| 9555 |
_L2[15] = 0x3FFFFFFF & _L2[14] |
| 9556 |
_L1[5] = _L2[6] |
| 9557 |
_L1[6] = _L2[15] | 0x40000000 & (_L2[7] ~ _L2[13]) |
| 9558 |
_L1[7] = _L2[7] |
| 9559 |
_L1[8] = _L2[13] |
| 9560 |
goto cont6 |
| 9561 |
end |
| 9562 |
end |
| 9563 |
end |
| 9564 |
::cont3:: |
| 9565 |
_L[171] = {"InvalidUtf8"} |
| 9566 |
_L[172] = {tag = _L[171]} |
| 9567 |
_L[173] = "START" |
| 9568 |
_L[174] = "MID_1_OF_3_E0" |
| 9569 |
_L[175] = "MID_1_OF_3_ED" |
| 9570 |
_L[176] = "MID_1_OF_4_F0" |
| 9571 |
_L[177] = "MID_1_OF_4_F4" |
| 9572 |
_L[178] = "TAIL_1" |
| 9573 |
_L[179] = "TAIL_2" |
| 9574 |
_L[180] = "TAIL_3" |
| 9575 |
_L[181] = {tag = "PREFIX_ZERO"} |
| 9576 |
_L[182] = {tag = "INVALID_UNICODE_SCALAR"} |
| 9577 |
_L[183] = {tag = "INVALID_DATE"} |
| 9578 |
_L[184] = {tag = "INVALID_TIME"} |
| 9579 |
_L[185] = function(a) |
| 9580 |
if a == "" then |
| 9581 |
return "\"\"" |
| 9582 |
end |
| 9583 |
local tmp54 = tmp32(function(c) |
| 9584 |
local tmp55 |
| 9585 |
do |
| 9586 |
local tmp56 |
| 9587 |
if 65 <= c and c <= 90 then |
| 9588 |
tmp55 = true |
| 9589 |
goto cont |
| 9590 |
else |
| 9591 |
tmp56 = 97 <= c and c <= 122 |
| 9592 |
end |
| 9593 |
tmp55 = tmp56 or 48 <= c and c <= 57 |
| 9594 |
end |
| 9595 |
::cont:: |
| 9596 |
return tmp55 or (c == 45 or c == 95) |
| 9597 |
end) |
| 9598 |
local tmp55 = tmp54(a) |
| 9599 |
if tmp55 then |
| 9600 |
return a |
| 9601 |
else |
| 9602 |
return "\"" .. a .. "\"" |
| 9603 |
end |
| 9604 |
end |
| 9605 |
_L[186] = {"ParseError"} |
| 9606 |
_L[187] = function(i, accum) |
| 9607 |
if math_ult(i, 0x80) then |
| 9608 |
if i < 0x0 then |
| 9609 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9610 |
elseif i < 0 then |
| 9611 |
_raise(Chr, "char-1.sml:47:37") |
| 9612 |
elseif i > 255 then |
| 9613 |
_raise(Chr, "char-1.sml:47:37") |
| 9614 |
else |
| 9615 |
return {i, accum} |
| 9616 |
end |
| 9617 |
end |
| 9618 |
if math_ult(i, 0x800) then |
| 9619 |
local tmp54 |
| 9620 |
if not math_ult(0x6, tmp24) then |
| 9621 |
tmp54 = 0x0 |
| 9622 |
else |
| 9623 |
tmp54 = i >> 0x6 |
| 9624 |
end |
| 9625 |
local tmp55 = 0xC0 | tmp54 |
| 9626 |
local tmp56 = 0x80 | i & 0x3F |
| 9627 |
local tmp57 |
| 9628 |
if tmp56 < 0x0 then |
| 9629 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9630 |
else |
| 9631 |
tmp57 = tmp56 |
| 9632 |
end |
| 9633 |
local tmp58 |
| 9634 |
if tmp57 < 0 then |
| 9635 |
_raise(Chr, "char-1.sml:47:37") |
| 9636 |
elseif tmp57 > 255 then |
| 9637 |
_raise(Chr, "char-1.sml:47:37") |
| 9638 |
else |
| 9639 |
tmp58 = tmp57 |
| 9640 |
end |
| 9641 |
if tmp55 < 0x0 then |
| 9642 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9643 |
elseif tmp55 < 0 then |
| 9644 |
_raise(Chr, "char-1.sml:47:37") |
| 9645 |
elseif tmp55 > 255 then |
| 9646 |
_raise(Chr, "char-1.sml:47:37") |
| 9647 |
else |
| 9648 |
return {tmp58, {tmp55, accum}} |
| 9649 |
end |
| 9650 |
end |
| 9651 |
if math_ult(i, 0x10000) then |
| 9652 |
if not math_ult(i, 0xD800) and math_ult(i, 0xE000) then |
| 9653 |
_raise({tag = _L[186], payload = _L[182]}, "parse_toml_util.sml:33:9") |
| 9654 |
end |
| 9655 |
local tmp54 |
| 9656 |
if not math_ult(0xC, tmp24) then |
| 9657 |
tmp54 = 0x0 |
| 9658 |
else |
| 9659 |
tmp54 = i >> 0xC |
| 9660 |
end |
| 9661 |
local tmp55 = 0xE0 | tmp54 |
| 9662 |
local tmp56 |
| 9663 |
if not math_ult(0x6, tmp24) then |
| 9664 |
tmp56 = 0x0 |
| 9665 |
else |
| 9666 |
tmp56 = i >> 0x6 |
| 9667 |
end |
| 9668 |
local tmp57 = 0x80 | tmp56 & 0x3F |
| 9669 |
local tmp58 = 0x80 | i & 0x3F |
| 9670 |
local tmp59 |
| 9671 |
if tmp58 < 0x0 then |
| 9672 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9673 |
else |
| 9674 |
tmp59 = tmp58 |
| 9675 |
end |
| 9676 |
local tmp60 |
| 9677 |
if tmp59 < 0 then |
| 9678 |
_raise(Chr, "char-1.sml:47:37") |
| 9679 |
elseif tmp59 > 255 then |
| 9680 |
_raise(Chr, "char-1.sml:47:37") |
| 9681 |
else |
| 9682 |
tmp60 = tmp59 |
| 9683 |
end |
| 9684 |
local tmp61 |
| 9685 |
if tmp57 < 0x0 then |
| 9686 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9687 |
else |
| 9688 |
tmp61 = tmp57 |
| 9689 |
end |
| 9690 |
local tmp62 |
| 9691 |
if tmp61 < 0 then |
| 9692 |
_raise(Chr, "char-1.sml:47:37") |
| 9693 |
elseif tmp61 > 255 then |
| 9694 |
_raise(Chr, "char-1.sml:47:37") |
| 9695 |
else |
| 9696 |
tmp62 = tmp61 |
| 9697 |
end |
| 9698 |
local tmp63 |
| 9699 |
if tmp55 < 0x0 then |
| 9700 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9701 |
else |
| 9702 |
tmp63 = tmp55 |
| 9703 |
end |
| 9704 |
if tmp63 < 0 then |
| 9705 |
_raise(Chr, "char-1.sml:47:37") |
| 9706 |
elseif tmp63 > 255 then |
| 9707 |
_raise(Chr, "char-1.sml:47:37") |
| 9708 |
else |
| 9709 |
return {tmp60, {tmp62, {tmp63, accum}}} |
| 9710 |
end |
| 9711 |
end |
| 9712 |
if math_ult(i, 0x110000) then |
| 9713 |
local tmp54, tmp55, tmp56, tmp57 |
| 9714 |
do |
| 9715 |
local tmp58 |
| 9716 |
if not math_ult(0x12, tmp24) then |
| 9717 |
tmp58 = 0x0 |
| 9718 |
else |
| 9719 |
tmp58 = i >> 0x12 |
| 9720 |
end |
| 9721 |
local tmp59 = 0xF0 | tmp58 |
| 9722 |
local tmp60 |
| 9723 |
if not math_ult(0xC, tmp24) then |
| 9724 |
tmp60 = 0x0 |
| 9725 |
else |
| 9726 |
tmp60 = i >> 0xC |
| 9727 |
end |
| 9728 |
local tmp61 = 0x80 | tmp60 & 0x3F |
| 9729 |
local tmp62 |
| 9730 |
if not math_ult(0x6, tmp24) then |
| 9731 |
tmp62 = 0x0 |
| 9732 |
else |
| 9733 |
tmp62 = i >> 0x6 |
| 9734 |
end |
| 9735 |
local tmp63 = 0x80 | tmp62 & 0x3F |
| 9736 |
local tmp64 = 0x80 | i & 0x3F |
| 9737 |
local tmp65 |
| 9738 |
if tmp64 < 0x0 then |
| 9739 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9740 |
else |
| 9741 |
tmp65 = tmp64 |
| 9742 |
end |
| 9743 |
if tmp65 < 0 then |
| 9744 |
_raise(Chr, "char-1.sml:47:37") |
| 9745 |
elseif tmp65 > 255 then |
| 9746 |
_raise(Chr, "char-1.sml:47:37") |
| 9747 |
else |
| 9748 |
tmp54 = tmp65 |
| 9749 |
end |
| 9750 |
local tmp66 |
| 9751 |
if tmp63 < 0x0 then |
| 9752 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9753 |
else |
| 9754 |
tmp66 = tmp63 |
| 9755 |
end |
| 9756 |
if tmp66 < 0 then |
| 9757 |
_raise(Chr, "char-1.sml:47:37") |
| 9758 |
elseif tmp66 > 255 then |
| 9759 |
_raise(Chr, "char-1.sml:47:37") |
| 9760 |
else |
| 9761 |
tmp55 = tmp66 |
| 9762 |
end |
| 9763 |
local tmp67 |
| 9764 |
if tmp61 < 0x0 then |
| 9765 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9766 |
else |
| 9767 |
tmp67 = tmp61 |
| 9768 |
end |
| 9769 |
if tmp67 < 0 then |
| 9770 |
_raise(Chr, "char-1.sml:47:37") |
| 9771 |
elseif tmp67 > 255 then |
| 9772 |
_raise(Chr, "char-1.sml:47:37") |
| 9773 |
else |
| 9774 |
tmp56 = tmp67 |
| 9775 |
end |
| 9776 |
if tmp59 < 0x0 then |
| 9777 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9778 |
else |
| 9779 |
tmp57 = tmp59 |
| 9780 |
end |
| 9781 |
end |
| 9782 |
if tmp57 < 0 then |
| 9783 |
_raise(Chr, "char-1.sml:47:37") |
| 9784 |
elseif tmp57 > 255 then |
| 9785 |
_raise(Chr, "char-1.sml:47:37") |
| 9786 |
else |
| 9787 |
return {tmp54, {tmp55, {tmp56, {tmp57, accum}}}} |
| 9788 |
end |
| 9789 |
else |
| 9790 |
_raise({tag = _L[186], payload = _L[182]}, "parse_toml_util.sml:54:7") |
| 9791 |
end |
| 9792 |
end |
| 9793 |
_L[188] = function(a) |
| 9794 |
local tmp54 |
| 9795 |
do |
| 9796 |
local tmp55 = scanString(_L[8]) |
| 9797 |
tmp54 = tmp55(a) |
| 9798 |
end |
| 9799 |
if tmp54.tag == "SOME" then |
| 9800 |
return {tag = "FLOAT", payload = tmp54.payload} |
| 9801 |
elseif tmp54.tag == "NONE" then |
| 9802 |
_raise(Option, "option.sml:24:18") |
| 9803 |
else |
| 9804 |
_raise(_Match, "option.sml:23:5") |
| 9805 |
end |
| 9806 |
end |
| 9807 |
_L[189] = function(x, y) |
| 9808 |
local tmp54 |
| 9809 |
if not math_ult(y, tmp24) then |
| 9810 |
tmp54 = 0x0 |
| 9811 |
else |
| 9812 |
tmp54 = x << y & 0xFFFFFFFF |
| 9813 |
end |
| 9814 |
local tmp55 = 0x20 - y |
| 9815 |
if not math_ult(tmp55, tmp24) then |
| 9816 |
return tmp54 |
| 9817 |
else |
| 9818 |
return tmp54 | x >> tmp55 |
| 9819 |
end |
| 9820 |
end |
| 9821 |
_L[190] = function(a) |
| 9822 |
local tmp54 |
| 9823 |
if not math_ult(0x4, tmp24) then |
| 9824 |
tmp54 = 0x0 |
| 9825 |
else |
| 9826 |
tmp54 = a >> 0x4 |
| 9827 |
end |
| 9828 |
local tmp55 |
| 9829 |
if tmp54 < 0x0 then |
| 9830 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9831 |
else |
| 9832 |
tmp55 = sub1({"0123456789abcdef", tmp54}) |
| 9833 |
end |
| 9834 |
local tmp56 = a & 0xF |
| 9835 |
local tmp57 |
| 9836 |
if tmp56 < 0x0 then |
| 9837 |
_raise(_Overflow, "word-1.sml:52:39") |
| 9838 |
else |
| 9839 |
tmp57 = sub1({"0123456789abcdef", tmp56}) |
| 9840 |
end |
| 9841 |
return implode({tmp55, {tmp57, nil}}) |
| 9842 |
end |
| 9843 |
_L[191] = function(a) |
| 9844 |
local content8 |
| 9845 |
do |
| 9846 |
local origLen = tmp51(a) |
| 9847 |
local tmp54 = tmp51(a) |
| 9848 |
local tmp55 = tmp54 % 64 |
| 9849 |
local tmp56 = tmp50({0x80, nil}) |
| 9850 |
local tmp57 |
| 9851 |
if tmp55 < 56 then |
| 9852 |
tmp57 = _Int_sub(63, tmp55) |
| 9853 |
else |
| 9854 |
tmp57 = _Int_sub(127, tmp55) |
| 9855 |
end |
| 9856 |
local tmp58 = tmp53({tmp57, function(a1) |
| 9857 |
return 0x0 |
| 9858 |
end}) |
| 9859 |
local padded = tmp49({a, {tmp56, {tmp58, nil}}}) |
| 9860 |
local paddedLen = tmp51(padded) |
| 9861 |
content8 = _L[44]({paddedLen, function(i) |
| 9862 |
return tmp52({padded, i}) |
| 9863 |
end}) |
| 9864 |
local tmp59 = _Int_sub(paddedLen // 8, 1) |
| 9865 |
local tmp60 = _Int_mul(8, origLen) |
| 9866 |
do |
| 9867 |
local ii |
| 9868 |
do |
| 9869 |
ii = _L[48](content8, tmp59, 8) |
| 9870 |
_L[47]({content8, ii, tmp60 & 0xFF}) |
| 9871 |
local tmp61 = _Int_add(ii, 1) |
| 9872 |
local tmp62 |
| 9873 |
if not math_ult(0x8, tmp24) then |
| 9874 |
tmp62 = 0x0 |
| 9875 |
else |
| 9876 |
tmp62 = tmp60 >> 0x8 |
| 9877 |
end |
| 9878 |
_L[47]({content8, tmp61, tmp62 & 0xFF}) |
| 9879 |
local tmp63 = _Int_add(ii, 2) |
| 9880 |
local tmp64 |
| 9881 |
if not math_ult(0x10, tmp24) then |
| 9882 |
tmp64 = 0x0 |
| 9883 |
else |
| 9884 |
tmp64 = tmp60 >> 0x10 |
| 9885 |
end |
| 9886 |
_L[47]({content8, tmp63, tmp64 & 0xFF}) |
| 9887 |
local tmp65 = _Int_add(ii, 3) |
| 9888 |
local tmp66 |
| 9889 |
if not math_ult(0x18, tmp24) then |
| 9890 |
tmp66 = 0x0 |
| 9891 |
else |
| 9892 |
tmp66 = tmp60 >> 0x18 |
| 9893 |
end |
| 9894 |
_L[47]({content8, tmp65, tmp66 & 0xFF}) |
| 9895 |
local tmp67 = _Int_add(ii, 4) |
| 9896 |
local tmp68 |
| 9897 |
if not math_ult(0x20, tmp24) then |
| 9898 |
tmp68 = 0x0 |
| 9899 |
else |
| 9900 |
tmp68 = tmp60 >> 0x20 |
| 9901 |
end |
| 9902 |
_L[47]({content8, tmp67, tmp68 & 0xFF}) |
| 9903 |
local tmp69 = _Int_add(ii, 5) |
| 9904 |
local tmp70 |
| 9905 |
if not math_ult(0x28, tmp24) then |
| 9906 |
tmp70 = 0x0 |
| 9907 |
else |
| 9908 |
tmp70 = tmp60 >> 0x28 |
| 9909 |
end |
| 9910 |
_L[47]({content8, tmp69, tmp70 & 0xFF}) |
| 9911 |
end |
| 9912 |
local tmp61 = _Int_add(ii, 6) |
| 9913 |
local tmp62 |
| 9914 |
if not math_ult(0x30, tmp24) then |
| 9915 |
tmp62 = 0x0 |
| 9916 |
else |
| 9917 |
tmp62 = tmp60 >> 0x30 |
| 9918 |
end |
| 9919 |
_L[47]({content8, tmp61, tmp62 & 0xFF}) |
| 9920 |
local tmp63 = _Int_add(ii, 7) |
| 9921 |
local tmp64 |
| 9922 |
if not math_ult(0x38, tmp24) then |
| 9923 |
tmp64 = 0x0 |
| 9924 |
else |
| 9925 |
tmp64 = tmp60 >> 0x38 |
| 9926 |
end |
| 9927 |
_L[47]({content8, tmp63, tmp64 & 0xFF}) |
| 9928 |
end |
| 9929 |
end |
| 9930 |
local content32, tmp54, tmp55, tmp56, tmp57, tmp58, tmp59 |
| 9931 |
do |
| 9932 |
local tmp60 = _L[41](content8) |
| 9933 |
local tmp61 = tmp60 // 4 |
| 9934 |
content32 = _VectorOrArray_tabulate({tmp61, function(i) |
| 9935 |
local ii = _L[48](content8, i, 4) |
| 9936 |
local x0 = _L[46]({content8, ii}) |
| 9937 |
local x1 = _L[46]({content8, _Int_add(ii, 1)}) |
| 9938 |
local x2 = _L[46]({content8, _Int_add(ii, 2)}) |
| 9939 |
local x3 = _L[46]({content8, _Int_add(ii, 3)}) |
| 9940 |
local tmp62 |
| 9941 |
if not math_ult(0x18, tmp24) then |
| 9942 |
tmp62 = 0x0 |
| 9943 |
else |
| 9944 |
tmp62 = x3 << 0x18 |
| 9945 |
end |
| 9946 |
local tmp63 |
| 9947 |
if not math_ult(0x10, tmp24) then |
| 9948 |
tmp63 = 0x0 |
| 9949 |
else |
| 9950 |
tmp63 = x2 << 0x10 |
| 9951 |
end |
| 9952 |
local tmp64 = tmp62 | tmp63 |
| 9953 |
local tmp65 |
| 9954 |
if not math_ult(0x8, tmp24) then |
| 9955 |
tmp65 = 0x0 |
| 9956 |
else |
| 9957 |
tmp65 = x1 << 0x8 |
| 9958 |
end |
| 9959 |
return (tmp64 | tmp65 | x0) & 0xFFFFFFFF |
| 9960 |
end}) |
| 9961 |
tmp54 = content32.n // 16 |
| 9962 |
tmp59, tmp58, tmp57, tmp56, tmp55 = 0, 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476 |
| 9963 |
end |
| 9964 |
::cont:: |
| 9965 |
do |
| 9966 |
local d, c, b, b_PRIME, c_PRIME, d_PRIME, tmp60, tmp61 |
| 9967 |
do |
| 9968 |
local i, a1 |
| 9969 |
i, a1, b, c, d = tmp59, tmp58, tmp57, tmp56, tmp55 |
| 9970 |
if i >= tmp54 then |
| 9971 |
return {a1, b, c, d} |
| 9972 |
end |
| 9973 |
local tmp62 = _Int_mul(i, 16) |
| 9974 |
local X = _L[19](content32, tmp62, {tag = "SOME", payload = 16}) |
| 9975 |
local tmp63 = {a1, b, c, d} |
| 9976 |
local tmp64 |
| 9977 |
do |
| 9978 |
local ABCD, DABC, CDAB, BCDA, tmp65 |
| 9979 |
do |
| 9980 |
ABCD = function(k, t) |
| 9981 |
return function(a2) |
| 9982 |
local a3 = a2[1] |
| 9983 |
local b1 = a2[2] |
| 9984 |
local c1 = a2[3] |
| 9985 |
local d1 = a2[4] |
| 9986 |
local tmp66 = a3 + (b1 & c1 | ~ b1 & 0xFFFFFFFF & d1) & 0xFFFFFFFF |
| 9987 |
local tmp67 |
| 9988 |
do |
| 9989 |
local base = X.base |
| 9990 |
tmp67 = _L[18](base, X.length, X.start, k) |
| 9991 |
end |
| 9992 |
local tmp68 = _L[189]((tmp66 + tmp67 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x7) |
| 9993 |
return {b1 + tmp68 & 0xFFFFFFFF, b1, c1, d1} |
| 9994 |
end |
| 9995 |
end |
| 9996 |
DABC = function(k, t) |
| 9997 |
return function(a2) |
| 9998 |
local b1 = a2[1] |
| 9999 |
local c1 = a2[2] |
| 10000 |
local d1 = a2[3] |
| 10001 |
local a3 = a2[4] |
| 10002 |
local tmp66 = a3 + (b1 & c1 | ~ b1 & 0xFFFFFFFF & d1) & 0xFFFFFFFF |
| 10003 |
local tmp67 |
| 10004 |
do |
| 10005 |
local base = X.base |
| 10006 |
tmp67 = _L[18](base, X.length, X.start, k) |
| 10007 |
end |
| 10008 |
local tmp68 = _L[189]((tmp66 + tmp67 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0xC) |
| 10009 |
return {b1, c1, d1, b1 + tmp68 & 0xFFFFFFFF} |
| 10010 |
end |
| 10011 |
end |
| 10012 |
CDAB = function(k, t) |
| 10013 |
return function(a2) |
| 10014 |
local c1 = a2[1] |
| 10015 |
local d1 = a2[2] |
| 10016 |
local a3 = a2[3] |
| 10017 |
local b1 = a2[4] |
| 10018 |
local tmp66 = a3 + (b1 & c1 | ~ b1 & 0xFFFFFFFF & d1) & 0xFFFFFFFF |
| 10019 |
local tmp67 |
| 10020 |
do |
| 10021 |
local base = X.base |
| 10022 |
tmp67 = _L[18](base, X.length, X.start, k) |
| 10023 |
end |
| 10024 |
local tmp68 = _L[189]((tmp66 + tmp67 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x11) |
| 10025 |
return {c1, d1, b1 + tmp68 & 0xFFFFFFFF, b1} |
| 10026 |
end |
| 10027 |
end |
| 10028 |
BCDA = function(k, t) |
| 10029 |
return function(a2) |
| 10030 |
local d1 = a2[1] |
| 10031 |
local a3 = a2[2] |
| 10032 |
local b1 = a2[3] |
| 10033 |
local c1 = a2[4] |
| 10034 |
local tmp66 = a3 + (b1 & c1 | ~ b1 & 0xFFFFFFFF & d1) & 0xFFFFFFFF |
| 10035 |
local tmp67 |
| 10036 |
do |
| 10037 |
local base = X.base |
| 10038 |
tmp67 = _L[18](base, X.length, X.start, k) |
| 10039 |
end |
| 10040 |
local tmp68 = _L[189]((tmp66 + tmp67 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x16) |
| 10041 |
return {d1, b1 + tmp68 & 0xFFFFFFFF, b1, c1} |
| 10042 |
end |
| 10043 |
end |
| 10044 |
local tmp66 = ABCD(0, 0xD76AA478) |
| 10045 |
local tmp67 = tmp66(tmp63) |
| 10046 |
local tmp68 = DABC(1, 0xE8C7B756) |
| 10047 |
local tmp69 = tmp68(tmp67) |
| 10048 |
local tmp70 = CDAB(2, 0x242070DB) |
| 10049 |
local tmp71 = tmp70(tmp69) |
| 10050 |
local tmp72 = BCDA(3, 0xC1BDCEEE) |
| 10051 |
local tmp73 = tmp72(tmp71) |
| 10052 |
local tmp74 = ABCD(4, 0xF57C0FAF) |
| 10053 |
local tmp75 = tmp74(tmp73) |
| 10054 |
local tmp76 = DABC(5, 0x4787C62A) |
| 10055 |
tmp65 = tmp76(tmp75) |
| 10056 |
end |
| 10057 |
local tmp66 |
| 10058 |
do |
| 10059 |
local tmp67 = CDAB(6, 0xA8304613) |
| 10060 |
local tmp68 = tmp67(tmp65) |
| 10061 |
local tmp69 = BCDA(7, 0xFD469501) |
| 10062 |
local tmp70 = tmp69(tmp68) |
| 10063 |
local tmp71 = ABCD(8, 0x698098D8) |
| 10064 |
local tmp72 = tmp71(tmp70) |
| 10065 |
local tmp73 = DABC(9, 0x8B44F7AF) |
| 10066 |
local tmp74 = tmp73(tmp72) |
| 10067 |
local tmp75 = CDAB(10, 0xFFFF5BB1) |
| 10068 |
local tmp76 = tmp75(tmp74) |
| 10069 |
local tmp77 = BCDA(11, 0x895CD7BE) |
| 10070 |
tmp66 = tmp77(tmp76) |
| 10071 |
end |
| 10072 |
local tmp67 = ABCD(12, 0x6B901122) |
| 10073 |
local tmp68 = tmp67(tmp66) |
| 10074 |
local tmp69 = DABC(13, 0xFD987193) |
| 10075 |
local tmp70 = tmp69(tmp68) |
| 10076 |
local tmp71 = CDAB(14, 0xA679438E) |
| 10077 |
local tmp72 = tmp71(tmp70) |
| 10078 |
local tmp73 = BCDA(15, 0x49B40821) |
| 10079 |
tmp64 = tmp73(tmp72) |
| 10080 |
end |
| 10081 |
local tmp65 |
| 10082 |
do |
| 10083 |
local ABCD, DABC, CDAB, BCDA, tmp66 |
| 10084 |
do |
| 10085 |
ABCD = function(k, t) |
| 10086 |
return function(a2) |
| 10087 |
local a3 = a2[1] |
| 10088 |
local b1 = a2[2] |
| 10089 |
local c1 = a2[3] |
| 10090 |
local d1 = a2[4] |
| 10091 |
local tmp67 = a3 + (b1 & d1 | c1 & (~ d1 & 0xFFFFFFFF)) & 0xFFFFFFFF |
| 10092 |
local tmp68 |
| 10093 |
do |
| 10094 |
local base = X.base |
| 10095 |
tmp68 = _L[18](base, X.length, X.start, k) |
| 10096 |
end |
| 10097 |
local tmp69 = _L[189]((tmp67 + tmp68 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x5) |
| 10098 |
return {b1 + tmp69 & 0xFFFFFFFF, b1, c1, d1} |
| 10099 |
end |
| 10100 |
end |
| 10101 |
DABC = function(k, t) |
| 10102 |
return function(a2) |
| 10103 |
local b1 = a2[1] |
| 10104 |
local c1 = a2[2] |
| 10105 |
local d1 = a2[3] |
| 10106 |
local a3 = a2[4] |
| 10107 |
local tmp67 = a3 + (b1 & d1 | c1 & (~ d1 & 0xFFFFFFFF)) & 0xFFFFFFFF |
| 10108 |
local tmp68 |
| 10109 |
do |
| 10110 |
local base = X.base |
| 10111 |
tmp68 = _L[18](base, X.length, X.start, k) |
| 10112 |
end |
| 10113 |
local tmp69 = _L[189]((tmp67 + tmp68 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x9) |
| 10114 |
return {b1, c1, d1, b1 + tmp69 & 0xFFFFFFFF} |
| 10115 |
end |
| 10116 |
end |
| 10117 |
CDAB = function(k, t) |
| 10118 |
return function(a2) |
| 10119 |
local c1 = a2[1] |
| 10120 |
local d1 = a2[2] |
| 10121 |
local a3 = a2[3] |
| 10122 |
local b1 = a2[4] |
| 10123 |
local tmp67 = a3 + (b1 & d1 | c1 & (~ d1 & 0xFFFFFFFF)) & 0xFFFFFFFF |
| 10124 |
local tmp68 |
| 10125 |
do |
| 10126 |
local base = X.base |
| 10127 |
tmp68 = _L[18](base, X.length, X.start, k) |
| 10128 |
end |
| 10129 |
local tmp69 = _L[189]((tmp67 + tmp68 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0xE) |
| 10130 |
return {c1, d1, b1 + tmp69 & 0xFFFFFFFF, b1} |
| 10131 |
end |
| 10132 |
end |
| 10133 |
BCDA = function(k, t) |
| 10134 |
return function(a2) |
| 10135 |
local d1 = a2[1] |
| 10136 |
local a3 = a2[2] |
| 10137 |
local b1 = a2[3] |
| 10138 |
local c1 = a2[4] |
| 10139 |
local tmp67 = a3 + (b1 & d1 | c1 & (~ d1 & 0xFFFFFFFF)) & 0xFFFFFFFF |
| 10140 |
local tmp68 |
| 10141 |
do |
| 10142 |
local base = X.base |
| 10143 |
tmp68 = _L[18](base, X.length, X.start, k) |
| 10144 |
end |
| 10145 |
local tmp69 = _L[189]((tmp67 + tmp68 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x14) |
| 10146 |
return {d1, b1 + tmp69 & 0xFFFFFFFF, b1, c1} |
| 10147 |
end |
| 10148 |
end |
| 10149 |
local tmp67 = ABCD(1, 0xF61E2562) |
| 10150 |
local tmp68 = tmp67(tmp64) |
| 10151 |
local tmp69 = DABC(6, 0xC040B340) |
| 10152 |
local tmp70 = tmp69(tmp68) |
| 10153 |
local tmp71 = CDAB(11, 0x265E5A51) |
| 10154 |
local tmp72 = tmp71(tmp70) |
| 10155 |
local tmp73 = BCDA(0, 0xE9B6C7AA) |
| 10156 |
local tmp74 = tmp73(tmp72) |
| 10157 |
local tmp75 = ABCD(5, 0xD62F105D) |
| 10158 |
local tmp76 = tmp75(tmp74) |
| 10159 |
local tmp77 = DABC(10, 0x2441453) |
| 10160 |
tmp66 = tmp77(tmp76) |
| 10161 |
end |
| 10162 |
local tmp67 |
| 10163 |
do |
| 10164 |
local tmp68 = CDAB(15, 0xD8A1E681) |
| 10165 |
local tmp69 = tmp68(tmp66) |
| 10166 |
local tmp70 = BCDA(4, 0xE7D3FBC8) |
| 10167 |
local tmp71 = tmp70(tmp69) |
| 10168 |
local tmp72 = ABCD(9, 0x21E1CDE6) |
| 10169 |
local tmp73 = tmp72(tmp71) |
| 10170 |
local tmp74 = DABC(14, 0xC33707D6) |
| 10171 |
local tmp75 = tmp74(tmp73) |
| 10172 |
local tmp76 = CDAB(3, 0xF4D50D87) |
| 10173 |
local tmp77 = tmp76(tmp75) |
| 10174 |
local tmp78 = BCDA(8, 0x455A14ED) |
| 10175 |
tmp67 = tmp78(tmp77) |
| 10176 |
end |
| 10177 |
local tmp68 = ABCD(13, 0xA9E3E905) |
| 10178 |
local tmp69 = tmp68(tmp67) |
| 10179 |
local tmp70 = DABC(2, 0xFCEFA3F8) |
| 10180 |
local tmp71 = tmp70(tmp69) |
| 10181 |
local tmp72 = CDAB(7, 0x676F02D9) |
| 10182 |
local tmp73 = tmp72(tmp71) |
| 10183 |
local tmp74 = BCDA(12, 0x8D2A4C8A) |
| 10184 |
tmp65 = tmp74(tmp73) |
| 10185 |
end |
| 10186 |
local tmp66 |
| 10187 |
do |
| 10188 |
local ABCD, DABC, CDAB, BCDA, tmp67 |
| 10189 |
do |
| 10190 |
ABCD = function(k, t) |
| 10191 |
return function(a2) |
| 10192 |
local a3 = a2[1] |
| 10193 |
local b1 = a2[2] |
| 10194 |
local c1 = a2[3] |
| 10195 |
local d1 = a2[4] |
| 10196 |
local tmp68 = a3 + (b1 ~ (c1 ~ d1)) & 0xFFFFFFFF |
| 10197 |
local tmp69 |
| 10198 |
do |
| 10199 |
local base = X.base |
| 10200 |
tmp69 = _L[18](base, X.length, X.start, k) |
| 10201 |
end |
| 10202 |
local tmp70 = _L[189]((tmp68 + tmp69 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x4) |
| 10203 |
return {b1 + tmp70 & 0xFFFFFFFF, b1, c1, d1} |
| 10204 |
end |
| 10205 |
end |
| 10206 |
DABC = function(k, t) |
| 10207 |
return function(a2) |
| 10208 |
local b1 = a2[1] |
| 10209 |
local c1 = a2[2] |
| 10210 |
local d1 = a2[3] |
| 10211 |
local tmp68 = a2[4] + (b1 ~ (c1 ~ d1)) & 0xFFFFFFFF |
| 10212 |
local tmp69 |
| 10213 |
do |
| 10214 |
local base = X.base |
| 10215 |
tmp69 = _L[18](base, X.length, X.start, k) |
| 10216 |
end |
| 10217 |
local tmp70 = _L[189]((tmp68 + tmp69 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0xB) |
| 10218 |
return {b1, c1, d1, b1 + tmp70 & 0xFFFFFFFF} |
| 10219 |
end |
| 10220 |
end |
| 10221 |
CDAB = function(k, t) |
| 10222 |
return function(a2) |
| 10223 |
local c1 = a2[1] |
| 10224 |
local d1 = a2[2] |
| 10225 |
local a3 = a2[3] |
| 10226 |
local b1 = a2[4] |
| 10227 |
local tmp68 = a3 + (b1 ~ (c1 ~ d1)) & 0xFFFFFFFF |
| 10228 |
local tmp69 |
| 10229 |
do |
| 10230 |
local base = X.base |
| 10231 |
tmp69 = _L[18](base, X.length, X.start, k) |
| 10232 |
end |
| 10233 |
local tmp70 = _L[189]((tmp68 + tmp69 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x10) |
| 10234 |
return {c1, d1, b1 + tmp70 & 0xFFFFFFFF, b1} |
| 10235 |
end |
| 10236 |
end |
| 10237 |
BCDA = function(k, t) |
| 10238 |
return function(a2) |
| 10239 |
local d1 = a2[1] |
| 10240 |
local a3 = a2[2] |
| 10241 |
local b1 = a2[3] |
| 10242 |
local c1 = a2[4] |
| 10243 |
local tmp68 = a3 + (b1 ~ (c1 ~ d1)) & 0xFFFFFFFF |
| 10244 |
local tmp69 |
| 10245 |
do |
| 10246 |
local base = X.base |
| 10247 |
tmp69 = _L[18](base, X.length, X.start, k) |
| 10248 |
end |
| 10249 |
local tmp70 = _L[189]((tmp68 + tmp69 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x17) |
| 10250 |
return {d1, b1 + tmp70 & 0xFFFFFFFF, b1, c1} |
| 10251 |
end |
| 10252 |
end |
| 10253 |
local tmp68 = ABCD(5, 0xFFFA3942) |
| 10254 |
local tmp69 = tmp68(tmp65) |
| 10255 |
local tmp70 = DABC(8, 0x8771F681) |
| 10256 |
local tmp71 = tmp70(tmp69) |
| 10257 |
local tmp72 = CDAB(11, 0x6D9D6122) |
| 10258 |
local tmp73 = tmp72(tmp71) |
| 10259 |
local tmp74 = BCDA(14, 0xFDE5380C) |
| 10260 |
local tmp75 = tmp74(tmp73) |
| 10261 |
local tmp76 = ABCD(1, 0xA4BEEA44) |
| 10262 |
local tmp77 = tmp76(tmp75) |
| 10263 |
local tmp78 = DABC(4, 0x4BDECFA9) |
| 10264 |
tmp67 = tmp78(tmp77) |
| 10265 |
end |
| 10266 |
local tmp68 |
| 10267 |
do |
| 10268 |
local tmp69 = CDAB(7, 0xF6BB4B60) |
| 10269 |
local tmp70 = tmp69(tmp67) |
| 10270 |
local tmp71 = BCDA(10, 0xBEBFBC70) |
| 10271 |
local tmp72 = tmp71(tmp70) |
| 10272 |
local tmp73 = ABCD(13, 0x289B7EC6) |
| 10273 |
local tmp74 = tmp73(tmp72) |
| 10274 |
local tmp75 = DABC(0, 0xEAA127FA) |
| 10275 |
local tmp76 = tmp75(tmp74) |
| 10276 |
local tmp77 = CDAB(3, 0xD4EF3085) |
| 10277 |
local tmp78 = tmp77(tmp76) |
| 10278 |
local tmp79 = BCDA(6, 0x4881D05) |
| 10279 |
tmp68 = tmp79(tmp78) |
| 10280 |
end |
| 10281 |
local tmp69 = ABCD(9, 0xD9D4D039) |
| 10282 |
local tmp70 = tmp69(tmp68) |
| 10283 |
local tmp71 = DABC(12, 0xE6DB99E5) |
| 10284 |
local tmp72 = tmp71(tmp70) |
| 10285 |
local tmp73 = CDAB(15, 0x1FA27CF8) |
| 10286 |
local tmp74 = tmp73(tmp72) |
| 10287 |
local tmp75 = BCDA(2, 0xC4AC5665) |
| 10288 |
tmp66 = tmp75(tmp74) |
| 10289 |
end |
| 10290 |
local exp |
| 10291 |
do |
| 10292 |
local ABCD, DABC, CDAB, BCDA, tmp67 |
| 10293 |
do |
| 10294 |
ABCD = function(k, t) |
| 10295 |
return function(a2) |
| 10296 |
local a3 = a2[1] |
| 10297 |
local b1 = a2[2] |
| 10298 |
local c1 = a2[3] |
| 10299 |
local d1 = a2[4] |
| 10300 |
local tmp68 = a3 + (c1 ~ (b1 | ~ d1 & 0xFFFFFFFF)) & 0xFFFFFFFF |
| 10301 |
local tmp69 |
| 10302 |
do |
| 10303 |
local base = X.base |
| 10304 |
tmp69 = _L[18](base, X.length, X.start, k) |
| 10305 |
end |
| 10306 |
local tmp70 = _L[189]((tmp68 + tmp69 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x6) |
| 10307 |
return {b1 + tmp70 & 0xFFFFFFFF, b1, c1, d1} |
| 10308 |
end |
| 10309 |
end |
| 10310 |
DABC = function(k, t) |
| 10311 |
return function(a2) |
| 10312 |
local b1 = a2[1] |
| 10313 |
local c1 = a2[2] |
| 10314 |
local d1 = a2[3] |
| 10315 |
local tmp68 = a2[4] + (c1 ~ (b1 | ~ d1 & 0xFFFFFFFF)) & 0xFFFFFFFF |
| 10316 |
local tmp69 |
| 10317 |
do |
| 10318 |
local base = X.base |
| 10319 |
tmp69 = _L[18](base, X.length, X.start, k) |
| 10320 |
end |
| 10321 |
local tmp70 = _L[189]((tmp68 + tmp69 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0xA) |
| 10322 |
return {b1, c1, d1, b1 + tmp70 & 0xFFFFFFFF} |
| 10323 |
end |
| 10324 |
end |
| 10325 |
CDAB = function(k, t) |
| 10326 |
return function(a2) |
| 10327 |
local c1 = a2[1] |
| 10328 |
local d1 = a2[2] |
| 10329 |
local a3 = a2[3] |
| 10330 |
local b1 = a2[4] |
| 10331 |
local tmp68 = a3 + (c1 ~ (b1 | ~ d1 & 0xFFFFFFFF)) & 0xFFFFFFFF |
| 10332 |
local tmp69 |
| 10333 |
do |
| 10334 |
local base = X.base |
| 10335 |
tmp69 = _L[18](base, X.length, X.start, k) |
| 10336 |
end |
| 10337 |
local tmp70 = _L[189]((tmp68 + tmp69 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0xF) |
| 10338 |
return {c1, d1, b1 + tmp70 & 0xFFFFFFFF, b1} |
| 10339 |
end |
| 10340 |
end |
| 10341 |
BCDA = function(k, t) |
| 10342 |
return function(a2) |
| 10343 |
local d1 = a2[1] |
| 10344 |
local a3 = a2[2] |
| 10345 |
local b1 = a2[3] |
| 10346 |
local c1 = a2[4] |
| 10347 |
local tmp68 = a3 + (c1 ~ (b1 | ~ d1 & 0xFFFFFFFF)) & 0xFFFFFFFF |
| 10348 |
local tmp69 |
| 10349 |
do |
| 10350 |
local base = X.base |
| 10351 |
tmp69 = _L[18](base, X.length, X.start, k) |
| 10352 |
end |
| 10353 |
local tmp70 = _L[189]((tmp68 + tmp69 & 0xFFFFFFFF) + t & 0xFFFFFFFF, 0x15) |
| 10354 |
return {d1, b1 + tmp70 & 0xFFFFFFFF, b1, c1} |
| 10355 |
end |
| 10356 |
end |
| 10357 |
local tmp68 = ABCD(0, 0xF4292244) |
| 10358 |
local tmp69 = tmp68(tmp66) |
| 10359 |
local tmp70 = DABC(7, 0x432AFF97) |
| 10360 |
local tmp71 = tmp70(tmp69) |
| 10361 |
local tmp72 = CDAB(14, 0xAB9423A7) |
| 10362 |
local tmp73 = tmp72(tmp71) |
| 10363 |
local tmp74 = BCDA(5, 0xFC93A039) |
| 10364 |
local tmp75 = tmp74(tmp73) |
| 10365 |
local tmp76 = ABCD(12, 0x655B59C3) |
| 10366 |
local tmp77 = tmp76(tmp75) |
| 10367 |
local tmp78 = DABC(3, 0x8F0CCC92) |
| 10368 |
tmp67 = tmp78(tmp77) |
| 10369 |
end |
| 10370 |
local tmp68 |
| 10371 |
do |
| 10372 |
local tmp69 = CDAB(10, 0xFFEFF47D) |
| 10373 |
local tmp70 = tmp69(tmp67) |
| 10374 |
local tmp71 = BCDA(1, 0x85845DD1) |
| 10375 |
local tmp72 = tmp71(tmp70) |
| 10376 |
local tmp73 = ABCD(8, 0x6FA87E4F) |
| 10377 |
local tmp74 = tmp73(tmp72) |
| 10378 |
local tmp75 = DABC(15, 0xFE2CE6E0) |
| 10379 |
local tmp76 = tmp75(tmp74) |
| 10380 |
local tmp77 = CDAB(6, 0xA3014314) |
| 10381 |
local tmp78 = tmp77(tmp76) |
| 10382 |
local tmp79 = BCDA(13, 0x4E0811A1) |
| 10383 |
tmp68 = tmp79(tmp78) |
| 10384 |
end |
| 10385 |
local tmp69 = ABCD(4, 0xF7537E82) |
| 10386 |
local tmp70 = tmp69(tmp68) |
| 10387 |
local tmp71 = DABC(11, 0xBD3AF235) |
| 10388 |
local tmp72 = tmp71(tmp70) |
| 10389 |
local tmp73 = CDAB(2, 0x2AD7D2BB) |
| 10390 |
local tmp74 = tmp73(tmp72) |
| 10391 |
local tmp75 = BCDA(9, 0xEB86D391) |
| 10392 |
exp = tmp75(tmp74) |
| 10393 |
end |
| 10394 |
local a_PRIME = exp[1] |
| 10395 |
b_PRIME = exp[2] |
| 10396 |
c_PRIME = exp[3] |
| 10397 |
d_PRIME = exp[4] |
| 10398 |
tmp60 = _Int_add(i, 1) |
| 10399 |
tmp61 = a1 + a_PRIME & 0xFFFFFFFF |
| 10400 |
end |
| 10401 |
local tmp62 = b + b_PRIME & 0xFFFFFFFF |
| 10402 |
local tmp63 = c + c_PRIME & 0xFFFFFFFF |
| 10403 |
tmp59 = tmp60 |
| 10404 |
tmp58 = tmp61 |
| 10405 |
tmp57 = tmp62 |
| 10406 |
tmp56 = tmp63 |
| 10407 |
tmp55 = d + d_PRIME & 0xFFFFFFFF |
| 10408 |
goto cont |
| 10409 |
end |
| 10410 |
end |
| 10411 |
_L[192] = function(a) |
| 10412 |
local tmp54 = _L[190](a & 0xFF) |
| 10413 |
local tmp55 |
| 10414 |
if not math_ult(0x8, tmp24) then |
| 10415 |
tmp55 = 0x0 |
| 10416 |
else |
| 10417 |
tmp55 = a >> 0x8 |
| 10418 |
end |
| 10419 |
local tmp56 = _L[190](tmp55 & 0xFF) |
| 10420 |
local tmp57 |
| 10421 |
if not math_ult(0x10, tmp24) then |
| 10422 |
tmp57 = 0x0 |
| 10423 |
else |
| 10424 |
tmp57 = a >> 0x10 |
| 10425 |
end |
| 10426 |
local tmp58 = _L[190](tmp57 & 0xFF) |
| 10427 |
local tmp59 |
| 10428 |
if not math_ult(0x18, tmp24) then |
| 10429 |
tmp59 = 0x0 |
| 10430 |
else |
| 10431 |
tmp59 = a >> 0x18 |
| 10432 |
end |
| 10433 |
local tmp60 = _L[190](tmp59) |
| 10434 |
return table_concat({n = 4, tmp54, tmp56, tmp58, tmp60}) |
| 10435 |
end |
| 10436 |
_L[193] = function(a, b, c, d) |
| 10437 |
local tmp54 = _L[192](a) |
| 10438 |
local tmp55 = _L[192](b) |
| 10439 |
local tmp56 = tmp54 .. tmp55 |
| 10440 |
local tmp57 = _L[192](c) |
| 10441 |
local tmp58 = tmp56 .. tmp57 |
| 10442 |
local tmp59 = _L[192](d) |
| 10443 |
return tmp58 .. tmp59 |
| 10444 |
end |
| 10445 |
_L[194] = "R" |
| 10446 |
_L[195] = "B" |
| 10447 |
_L[196] = {tag = "E"} |
| 10448 |
_L[197] = {0, _L[196]} |
| 10449 |
_L[198] = function(tmp54, x) |
| 10450 |
local nItems = tmp54[1] |
| 10451 |
local m = tmp54[2] |
| 10452 |
local tmp55 = {nItems} |
| 10453 |
local function ins(a) |
| 10454 |
if a.tag == "E" then |
| 10455 |
tmp55[1] = _Int_add(nItems, 1) |
| 10456 |
return {tag = "T", payload = {_L[194], _L[196], x, _L[196]}} |
| 10457 |
end |
| 10458 |
if a.tag == "T" then |
| 10459 |
else |
| 10460 |
_raise(_Match, "redblack-set-fn.sml:64:8") |
| 10461 |
end |
| 10462 |
do |
| 10463 |
local color = a.payload[1] |
| 10464 |
local a1 = a.payload[2] |
| 10465 |
local y = a.payload[3] |
| 10466 |
local b = a.payload[4] |
| 10467 |
local exp |
| 10468 |
if x == y then |
| 10469 |
exp = EQUAL |
| 10470 |
elseif x < y then |
| 10471 |
exp = LESS |
| 10472 |
else |
| 10473 |
exp = GREATER |
| 10474 |
end |
| 10475 |
if exp == "LESS" then |
| 10476 |
else |
| 10477 |
goto else1 |
| 10478 |
end |
| 10479 |
do |
| 10480 |
if a1.tag == "T" and a1.payload[1] == "R" then |
| 10481 |
else |
| 10482 |
goto else2 |
| 10483 |
end |
| 10484 |
do |
| 10485 |
local c = a1.payload[2] |
| 10486 |
local z = a1.payload[3] |
| 10487 |
local d = a1.payload[4] |
| 10488 |
local exp1 |
| 10489 |
if x == z then |
| 10490 |
exp1 = EQUAL |
| 10491 |
elseif x < z then |
| 10492 |
exp1 = LESS |
| 10493 |
else |
| 10494 |
exp1 = GREATER |
| 10495 |
end |
| 10496 |
if exp1 == "LESS" then |
| 10497 |
else |
| 10498 |
goto else3 |
| 10499 |
end |
| 10500 |
do |
| 10501 |
local exp2 = ins(c) |
| 10502 |
if exp2.tag == "T" and exp2.payload[1] == "R" then |
| 10503 |
local e = exp2.payload[2] |
| 10504 |
local w = exp2.payload[3] |
| 10505 |
local tmp56 = {tag = "T", payload = {_L[195], e, w, exp2.payload[4]}} |
| 10506 |
return {tag = "T", payload = {_L[194], tmp56, z, {tag = "T", payload = {_L[195], d, y, b}}}} |
| 10507 |
else |
| 10508 |
return {tag = "T", payload = {_L[195], {tag = "T", payload = {_L[194], exp2, z, d}}, y, b}} |
| 10509 |
end |
| 10510 |
end |
| 10511 |
::else3:: |
| 10512 |
if exp1 == "EQUAL" then |
| 10513 |
return {tag = "T", payload = {color, {tag = "T", payload = {_L[194], c, x, d}}, y, b}} |
| 10514 |
end |
| 10515 |
if exp1 == "GREATER" then |
| 10516 |
else |
| 10517 |
_raise(_Match, "redblack-set-fn.sml:67:31") |
| 10518 |
end |
| 10519 |
do |
| 10520 |
local exp2 = ins(d) |
| 10521 |
if exp2.tag == "T" and exp2.payload[1] == "R" then |
| 10522 |
local e = exp2.payload[2] |
| 10523 |
local w = exp2.payload[3] |
| 10524 |
local f = exp2.payload[4] |
| 10525 |
local tmp56 = {tag = "T", payload = {_L[195], c, z, e}} |
| 10526 |
return {tag = "T", payload = {_L[194], tmp56, w, {tag = "T", payload = {_L[195], f, y, b}}}} |
| 10527 |
else |
| 10528 |
return {tag = "T", payload = {_L[195], {tag = "T", payload = {_L[194], c, z, exp2}}, y, b}} |
| 10529 |
end |
| 10530 |
end |
| 10531 |
end |
| 10532 |
::else2:: |
| 10533 |
local tmp56 = ins(a1) |
| 10534 |
return {tag = "T", payload = {_L[195], tmp56, y, b}} |
| 10535 |
end |
| 10536 |
::else1:: |
| 10537 |
if exp == "EQUAL" then |
| 10538 |
return {tag = "T", payload = {color, a1, x, b}} |
| 10539 |
end |
| 10540 |
if exp == "GREATER" then |
| 10541 |
else |
| 10542 |
_raise(_Match, "redblack-set-fn.sml:65:47") |
| 10543 |
end |
| 10544 |
do |
| 10545 |
if b.tag == "T" and b.payload[1] == "R" then |
| 10546 |
else |
| 10547 |
goto else2 |
| 10548 |
end |
| 10549 |
do |
| 10550 |
local c = b.payload[2] |
| 10551 |
local z = b.payload[3] |
| 10552 |
local d = b.payload[4] |
| 10553 |
local exp1 |
| 10554 |
if x == z then |
| 10555 |
exp1 = EQUAL |
| 10556 |
elseif x < z then |
| 10557 |
exp1 = LESS |
| 10558 |
else |
| 10559 |
exp1 = GREATER |
| 10560 |
end |
| 10561 |
if exp1 == "LESS" then |
| 10562 |
else |
| 10563 |
goto else3 |
| 10564 |
end |
| 10565 |
do |
| 10566 |
local exp2 = ins(c) |
| 10567 |
if exp2.tag == "T" and exp2.payload[1] == "R" then |
| 10568 |
local e = exp2.payload[2] |
| 10569 |
local w = exp2.payload[3] |
| 10570 |
local f = exp2.payload[4] |
| 10571 |
local tmp56 = {tag = "T", payload = {_L[195], a1, y, e}} |
| 10572 |
return {tag = "T", payload = {_L[194], tmp56, w, {tag = "T", payload = {_L[195], f, z, d}}}} |
| 10573 |
else |
| 10574 |
return {tag = "T", payload = {_L[195], a1, y, {tag = "T", payload = {_L[194], exp2, z, d}}}} |
| 10575 |
end |
| 10576 |
end |
| 10577 |
::else3:: |
| 10578 |
if exp1 == "EQUAL" then |
| 10579 |
return {tag = "T", payload = {color, a1, y, {tag = "T", payload = {_L[194], c, x, d}}}} |
| 10580 |
end |
| 10581 |
if exp1 == "GREATER" then |
| 10582 |
else |
| 10583 |
_raise(_Match, "redblack-set-fn.sml:82:31") |
| 10584 |
end |
| 10585 |
do |
| 10586 |
local exp2 = ins(d) |
| 10587 |
if exp2.tag == "T" and exp2.payload[1] == "R" then |
| 10588 |
local e = exp2.payload[2] |
| 10589 |
local w = exp2.payload[3] |
| 10590 |
local f = exp2.payload[4] |
| 10591 |
local tmp56 = {tag = "T", payload = {_L[195], a1, y, c}} |
| 10592 |
return {tag = "T", payload = {_L[194], tmp56, z, {tag = "T", payload = {_L[195], e, w, f}}}} |
| 10593 |
else |
| 10594 |
return {tag = "T", payload = {_L[195], a1, y, {tag = "T", payload = {_L[194], c, z, exp2}}}} |
| 10595 |
end |
| 10596 |
end |
| 10597 |
end |
| 10598 |
::else2:: |
| 10599 |
local tmp56 = ins(b) |
| 10600 |
return {tag = "T", payload = {_L[195], a1, y, tmp56}} |
| 10601 |
end |
| 10602 |
end |
| 10603 |
end |
| 10604 |
local exp = ins(m) |
| 10605 |
if exp.tag == "T" then |
| 10606 |
local a = exp.payload[2] |
| 10607 |
local y = exp.payload[3] |
| 10608 |
local b = exp.payload[4] |
| 10609 |
local x1 = tmp55[1] |
| 10610 |
return {x1, {tag = "T", payload = {_L[195], a, y, b}}} |
| 10611 |
else |
| 10612 |
_raise(_Bind, "redblack-set-fn.sml:96:8") |
| 10613 |
end |
| 10614 |
end |
| 10615 |
_L[199] = function(tmp54, k) |
| 10616 |
local tmp55 = tmp54[2] |
| 10617 |
::cont:: |
| 10618 |
do |
| 10619 |
local a = tmp55 |
| 10620 |
if a.tag == "E" then |
| 10621 |
return false |
| 10622 |
end |
| 10623 |
if a.tag == "T" then |
| 10624 |
local a1 = a.payload[2] |
| 10625 |
local y = a.payload[3] |
| 10626 |
local b = a.payload[4] |
| 10627 |
local exp |
| 10628 |
if k == y then |
| 10629 |
exp = EQUAL |
| 10630 |
elseif k < y then |
| 10631 |
exp = LESS |
| 10632 |
else |
| 10633 |
exp = GREATER |
| 10634 |
end |
| 10635 |
if exp == "LESS" then |
| 10636 |
tmp55 = a1 |
| 10637 |
goto cont |
| 10638 |
elseif exp == "EQUAL" then |
| 10639 |
return true |
| 10640 |
elseif exp == "GREATER" then |
| 10641 |
tmp55 = b |
| 10642 |
goto cont |
| 10643 |
else |
| 10644 |
_raise(_Match, "redblack-set-fn.sml:226:33") |
| 10645 |
end |
| 10646 |
else |
| 10647 |
_raise(_Match, "redblack-set-fn.sml:225:8") |
| 10648 |
end |
| 10649 |
end |
| 10650 |
end |
| 10651 |
_L[200] = "R" |
| 10652 |
_L[201] = "B" |
| 10653 |
_L[202] = {tag = "E"} |
| 10654 |
_L[203] = {0, _L[202]} |
| 10655 |
_L[204] = function(tmp54, xk, x) |
| 10656 |
local nItems = tmp54[1] |
| 10657 |
local m = tmp54[2] |
| 10658 |
local tmp55 = {nItems} |
| 10659 |
local function ins(a) |
| 10660 |
if a.tag == "E" then |
| 10661 |
tmp55[1] = _Int_add(nItems, 1) |
| 10662 |
return {tag = "T", payload = {_L[200], _L[202], xk, x, _L[202]}} |
| 10663 |
end |
| 10664 |
if a.tag == "T" then |
| 10665 |
else |
| 10666 |
_raise(_Match, "redblack-map-fn.sml:46:8") |
| 10667 |
end |
| 10668 |
do |
| 10669 |
local color = a.payload[1] |
| 10670 |
local a1 = a.payload[2] |
| 10671 |
local yk = a.payload[3] |
| 10672 |
local y = a.payload[4] |
| 10673 |
local b = a.payload[5] |
| 10674 |
local exp |
| 10675 |
if xk == yk then |
| 10676 |
exp = EQUAL |
| 10677 |
elseif xk < yk then |
| 10678 |
exp = LESS |
| 10679 |
else |
| 10680 |
exp = GREATER |
| 10681 |
end |
| 10682 |
if exp == "LESS" then |
| 10683 |
else |
| 10684 |
goto else1 |
| 10685 |
end |
| 10686 |
do |
| 10687 |
if a1.tag == "T" and a1.payload[1] == "R" then |
| 10688 |
else |
| 10689 |
goto else2 |
| 10690 |
end |
| 10691 |
do |
| 10692 |
local c = a1.payload[2] |
| 10693 |
local zk = a1.payload[3] |
| 10694 |
local z = a1.payload[4] |
| 10695 |
local d = a1.payload[5] |
| 10696 |
local exp1 |
| 10697 |
if xk == zk then |
| 10698 |
exp1 = EQUAL |
| 10699 |
elseif xk < zk then |
| 10700 |
exp1 = LESS |
| 10701 |
else |
| 10702 |
exp1 = GREATER |
| 10703 |
end |
| 10704 |
if exp1 == "LESS" then |
| 10705 |
else |
| 10706 |
goto else3 |
| 10707 |
end |
| 10708 |
do |
| 10709 |
local exp2 = ins(c) |
| 10710 |
if exp2.tag == "T" and exp2.payload[1] == "R" then |
| 10711 |
local e = exp2.payload[2] |
| 10712 |
local wk = exp2.payload[3] |
| 10713 |
local w = exp2.payload[4] |
| 10714 |
local tmp56 = {tag = "T", payload = {_L[201], e, wk, w, exp2.payload[5]}} |
| 10715 |
return {tag = "T", payload = {_L[200], tmp56, zk, z, {tag = "T", payload = {_L[201], d, yk, y, b}}}} |
| 10716 |
else |
| 10717 |
return {tag = "T", payload = {_L[201], {tag = "T", payload = {_L[200], exp2, zk, z, d}}, yk, y, b}} |
| 10718 |
end |
| 10719 |
end |
| 10720 |
::else3:: |
| 10721 |
if exp1 == "EQUAL" then |
| 10722 |
return {tag = "T", payload = {color, {tag = "T", payload = {_L[200], c, xk, x, d}}, yk, y, b}} |
| 10723 |
end |
| 10724 |
if exp1 == "GREATER" then |
| 10725 |
else |
| 10726 |
_raise(_Match, "redblack-map-fn.sml:49:35") |
| 10727 |
end |
| 10728 |
do |
| 10729 |
local exp2 = ins(d) |
| 10730 |
if exp2.tag == "T" and exp2.payload[1] == "R" then |
| 10731 |
local e = exp2.payload[2] |
| 10732 |
local wk = exp2.payload[3] |
| 10733 |
local w = exp2.payload[4] |
| 10734 |
local f = exp2.payload[5] |
| 10735 |
local tmp56 = {tag = "T", payload = {_L[201], c, zk, z, e}} |
| 10736 |
return {tag = "T", payload = {_L[200], tmp56, wk, w, {tag = "T", payload = {_L[201], f, yk, y, b}}}} |
| 10737 |
else |
| 10738 |
return {tag = "T", payload = {_L[201], {tag = "T", payload = {_L[200], c, zk, z, exp2}}, yk, y, b}} |
| 10739 |
end |
| 10740 |
end |
| 10741 |
end |
| 10742 |
::else2:: |
| 10743 |
local tmp56 = ins(a1) |
| 10744 |
return {tag = "T", payload = {_L[201], tmp56, yk, y, b}} |
| 10745 |
end |
| 10746 |
::else1:: |
| 10747 |
if exp == "EQUAL" then |
| 10748 |
return {tag = "T", payload = {color, a1, xk, x, b}} |
| 10749 |
end |
| 10750 |
if exp == "GREATER" then |
| 10751 |
else |
| 10752 |
_raise(_Match, "redblack-map-fn.sml:47:51") |
| 10753 |
end |
| 10754 |
do |
| 10755 |
if b.tag == "T" and b.payload[1] == "R" then |
| 10756 |
else |
| 10757 |
goto else2 |
| 10758 |
end |
| 10759 |
do |
| 10760 |
local c = b.payload[2] |
| 10761 |
local zk = b.payload[3] |
| 10762 |
local z = b.payload[4] |
| 10763 |
local d = b.payload[5] |
| 10764 |
local exp1 |
| 10765 |
if xk == zk then |
| 10766 |
exp1 = EQUAL |
| 10767 |
elseif xk < zk then |
| 10768 |
exp1 = LESS |
| 10769 |
else |
| 10770 |
exp1 = GREATER |
| 10771 |
end |
| 10772 |
if exp1 == "LESS" then |
| 10773 |
else |
| 10774 |
goto else3 |
| 10775 |
end |
| 10776 |
do |
| 10777 |
local exp2 = ins(c) |
| 10778 |
if exp2.tag == "T" and exp2.payload[1] == "R" then |
| 10779 |
local e = exp2.payload[2] |
| 10780 |
local wk = exp2.payload[3] |
| 10781 |
local w = exp2.payload[4] |
| 10782 |
local f = exp2.payload[5] |
| 10783 |
local tmp56 = {tag = "T", payload = {_L[201], a1, yk, y, e}} |
| 10784 |
return {tag = "T", payload = {_L[200], tmp56, wk, w, {tag = "T", payload = {_L[201], f, zk, z, d}}}} |
| 10785 |
else |
| 10786 |
return {tag = "T", payload = {_L[201], a1, yk, y, {tag = "T", payload = {_L[200], exp2, zk, z, d}}}} |
| 10787 |
end |
| 10788 |
end |
| 10789 |
::else3:: |
| 10790 |
if exp1 == "EQUAL" then |
| 10791 |
return {tag = "T", payload = {color, a1, yk, y, {tag = "T", payload = {_L[200], c, xk, x, d}}}} |
| 10792 |
end |
| 10793 |
if exp1 == "GREATER" then |
| 10794 |
else |
| 10795 |
_raise(_Match, "redblack-map-fn.sml:66:35") |
| 10796 |
end |
| 10797 |
do |
| 10798 |
local exp2 = ins(d) |
| 10799 |
if exp2.tag == "T" and exp2.payload[1] == "R" then |
| 10800 |
local e = exp2.payload[2] |
| 10801 |
local wk = exp2.payload[3] |
| 10802 |
local w = exp2.payload[4] |
| 10803 |
local f = exp2.payload[5] |
| 10804 |
local tmp56 = {tag = "T", payload = {_L[201], a1, yk, y, c}} |
| 10805 |
return {tag = "T", payload = {_L[200], tmp56, zk, z, {tag = "T", payload = {_L[201], e, wk, w, f}}}} |
| 10806 |
else |
| 10807 |
return {tag = "T", payload = {_L[201], a1, yk, y, {tag = "T", payload = {_L[200], c, zk, z, exp2}}}} |
| 10808 |
end |
| 10809 |
end |
| 10810 |
end |
| 10811 |
::else2:: |
| 10812 |
local tmp56 = ins(b) |
| 10813 |
return {tag = "T", payload = {_L[201], a1, yk, y, tmp56}} |
| 10814 |
end |
| 10815 |
end |
| 10816 |
end |
| 10817 |
local exp = ins(m) |
| 10818 |
local a, b, y, yk |
| 10819 |
if exp.tag == "T" then |
| 10820 |
local a1 = exp.payload[2] |
| 10821 |
local yk1 = exp.payload[3] |
| 10822 |
local y1 = exp.payload[4] |
| 10823 |
yk = yk1 |
| 10824 |
y = y1 |
| 10825 |
b = exp.payload[5] |
| 10826 |
a = a1 |
| 10827 |
else |
| 10828 |
_raise(_Bind, "redblack-map-fn.sml:82:8") |
| 10829 |
end |
| 10830 |
local x1 = tmp55[1] |
| 10831 |
return {x1, {tag = "T", payload = {_L[201], a, yk, y, b}}} |
| 10832 |
end |
| 10833 |
_L[205] = function(tmp54, k) |
| 10834 |
local tmp55 = tmp54[2] |
| 10835 |
::cont:: |
| 10836 |
do |
| 10837 |
local a = tmp55 |
| 10838 |
if a.tag == "E" then |
| 10839 |
return NONE |
| 10840 |
end |
| 10841 |
if a.tag == "T" then |
| 10842 |
local a1 = a.payload[2] |
| 10843 |
local yk = a.payload[3] |
| 10844 |
local y = a.payload[4] |
| 10845 |
local b = a.payload[5] |
| 10846 |
local exp |
| 10847 |
if k == yk then |
| 10848 |
exp = EQUAL |
| 10849 |
elseif k < yk then |
| 10850 |
exp = LESS |
| 10851 |
else |
| 10852 |
exp = GREATER |
| 10853 |
end |
| 10854 |
if exp == "LESS" then |
| 10855 |
tmp55 = a1 |
| 10856 |
goto cont |
| 10857 |
elseif exp == "EQUAL" then |
| 10858 |
return {tag = "SOME", payload = y} |
| 10859 |
elseif exp == "GREATER" then |
| 10860 |
tmp55 = b |
| 10861 |
goto cont |
| 10862 |
else |
| 10863 |
_raise(_Match, "redblack-map-fn.sml:155:37") |
| 10864 |
end |
| 10865 |
else |
| 10866 |
_raise(_Match, "redblack-map-fn.sml:154:8") |
| 10867 |
end |
| 10868 |
end |
| 10869 |
end |
| 10870 |
_L[206] = function(a) |
| 10871 |
local function mapf(a1) |
| 10872 |
if a1.tag == "E" then |
| 10873 |
return _L[202] |
| 10874 |
end |
| 10875 |
if a1.tag == "T" then |
| 10876 |
else |
| 10877 |
_raise(_Match, "redblack-map-fn.sml:551:8") |
| 10878 |
end |
| 10879 |
do |
| 10880 |
local color = a1.payload[1] |
| 10881 |
local a2 = a1.payload[2] |
| 10882 |
local xk = a1.payload[3] |
| 10883 |
local x = a1.payload[4] |
| 10884 |
local b = a1.payload[5] |
| 10885 |
local tmp54 = mapf(a2) |
| 10886 |
local tmp55 = a(x) |
| 10887 |
local tmp56 = mapf(b) |
| 10888 |
return {tag = "T", payload = {color, tmp54, xk, tmp55, tmp56}} |
| 10889 |
end |
| 10890 |
end |
| 10891 |
return function(a1) |
| 10892 |
local n = a1[1] |
| 10893 |
local tmp54 = mapf(a1[2]) |
| 10894 |
return {n, tmp54} |
| 10895 |
end |
| 10896 |
end |
| 10897 |
_L[207] = tmp3("texrunner.shellutil") |
| 10898 |
_L[208] = _L[207].escape |
| 10899 |
_L[209] = _L[207].has_command |
| 10900 |
_L[210] = tmp3("texrunner.pathutil") |
| 10901 |
_L[211] = _L[210].basename |
| 10902 |
_L[212] = _L[210].dirname |
| 10903 |
_L[213] = _L[210].trimext |
| 10904 |
_L[214] = _L[210].ext |
| 10905 |
_L[215] = function(cwd, path) |
| 10906 |
if cwd.tag == "SOME" then |
| 10907 |
local cwd1 = cwd.payload |
| 10908 |
return _L[210].abspath(path, cwd1) |
| 10909 |
elseif cwd.tag == "NONE" then |
| 10910 |
return _L[210].abspath(path) |
| 10911 |
else |
| 10912 |
_raise(_Match, "path-util.sml:22:7") |
| 10913 |
end |
| 10914 |
end |
| 10915 |
_L[216] = tmp3("lfs") |
| 10916 |
_L[217] = tmp3("texrunner.fsutil") |
| 10917 |
_L[218] = _L[217].isfile |
| 10918 |
_L[219] = _L[217].isdir |
| 10919 |
_L[220] = tmp1.type == "windows" |
| 10920 |
_L[221] = tmp1.setenv |
| 10921 |
_L[222] = "BATCHMODE" |
| 10922 |
_L[223] = "NONSTOPMODE" |
| 10923 |
_L[224] = "SCROLLMODE" |
| 10924 |
_L[225] = "ERRORSTOPMODE" |
| 10925 |
_L[226] = "ALLOWED" |
| 10926 |
_L[227] = "RESTRICTED" |
| 10927 |
_L[228] = "FORBIDDEN" |
| 10928 |
_L[229] = function(p) |
| 10929 |
return p[1] == "ALLOWED" and p[2] == "ALLOWED" or (p[1] == "RESTRICTED" and p[2] == "RESTRICTED" or p[1] == "FORBIDDEN" and p[2] == "FORBIDDEN") |
| 10930 |
end |
| 10931 |
_L[230] = "PDF" |
| 10932 |
_L[231] = "DVI" |
| 10933 |
_L[232] = function(tmp54, tmp55) |
| 10934 |
return tmp54 == "PDF" and tmp55 == "PDF" or tmp54 == "DVI" and tmp55 == "DVI" |
| 10935 |
end |
| 10936 |
_L[233] = "PDFTEX" |
| 10937 |
_L[234] = "XETEX" |
| 10938 |
_L[235] = "LUATEX" |
| 10939 |
_L[236] = "OTHER" |
| 10940 |
_L[237] = function(tmp54, tmp55) |
| 10941 |
return tmp54 == "PDFTEX" and tmp55 == "PDFTEX" or (tmp54 == "XETEX" and tmp55 == "XETEX" or (tmp54 == "LUATEX" and tmp55 == "LUATEX" or tmp54 == "OTHER" and tmp55 == "OTHER")) |
| 10942 |
end |
| 10943 |
_L[238] = {dvi_extension = "dvi", engine_type = _L[233], executable = "pdftex", name = "pdftex", supports_draftmode = true, supports_pdf_generation = true} |
| 10944 |
_L[239] = {dvi_extension = "dvi", engine_type = _L[233], executable = "pdflatex", name = "pdflatex", supports_draftmode = true, supports_pdf_generation = true} |
| 10945 |
_L[240] = {dvi_extension = "dvi", engine_type = _L[235], executable = "luatex", name = "luatex", supports_draftmode = true, supports_pdf_generation = true} |
| 10946 |
_L[241] = {dvi_extension = "dvi", engine_type = _L[235], executable = "lualatex", name = "lualatex", supports_draftmode = true, supports_pdf_generation = true} |
| 10947 |
_L[242] = {dvi_extension = "dvi", engine_type = _L[235], executable = "luajittex", name = "luajittex", supports_draftmode = true, supports_pdf_generation = true} |
| 10948 |
_L[243] = {dvi_extension = "xdv", engine_type = _L[234], executable = "xetex", name = "xetex", supports_draftmode = true, supports_pdf_generation = true} |
| 10949 |
_L[244] = {dvi_extension = "xdv", engine_type = _L[234], executable = "xelatex", name = "xelatex", supports_draftmode = true, supports_pdf_generation = true} |
| 10950 |
_L[245] = {dvi_extension = "dvi", engine_type = _L[236], executable = "tex", name = "tex", supports_draftmode = false, supports_pdf_generation = false} |
| 10951 |
_L[246] = {dvi_extension = "dvi", engine_type = _L[236], executable = "etex", name = "etex", supports_draftmode = false, supports_pdf_generation = false} |
| 10952 |
_L[247] = {dvi_extension = "dvi", engine_type = _L[236], executable = "latex", name = "latex", supports_draftmode = false, supports_pdf_generation = false} |
| 10953 |
_L[248] = {dvi_extension = "dvi", engine_type = _L[236], executable = "ptex", name = "ptex", supports_draftmode = false, supports_pdf_generation = false} |
| 10954 |
_L[249] = {dvi_extension = "dvi", engine_type = _L[236], executable = "eptex", name = "eptex", supports_draftmode = false, supports_pdf_generation = false} |
| 10955 |
_L[250] = {dvi_extension = "dvi", engine_type = _L[236], executable = "platex", name = "platex", supports_draftmode = false, supports_pdf_generation = false} |
| 10956 |
_L[251] = {dvi_extension = "dvi", engine_type = _L[236], executable = "uptex", name = "uptex", supports_draftmode = false, supports_pdf_generation = false} |
| 10957 |
_L[252] = {dvi_extension = "dvi", engine_type = _L[236], executable = "euptex", name = "euptex", supports_draftmode = false, supports_pdf_generation = false} |
| 10958 |
_L[253] = {dvi_extension = "dvi", engine_type = _L[236], executable = "uplatex", name = "uplatex", supports_draftmode = false, supports_pdf_generation = false} |
| 10959 |
_L[254] = function(a) |
| 10960 |
if a == "pdftex" then |
| 10961 |
return {tag = "SOME", payload = _L[238]} |
| 10962 |
elseif a == "pdflatex" then |
| 10963 |
return {tag = "SOME", payload = _L[239]} |
| 10964 |
elseif a == "luatex" then |
| 10965 |
return {tag = "SOME", payload = _L[240]} |
| 10966 |
elseif a == "lualatex" then |
| 10967 |
return {tag = "SOME", payload = _L[241]} |
| 10968 |
elseif a == "luajittex" then |
| 10969 |
return {tag = "SOME", payload = _L[242]} |
| 10970 |
elseif a == "xetex" then |
| 10971 |
return {tag = "SOME", payload = _L[243]} |
| 10972 |
elseif a == "xelatex" then |
| 10973 |
return {tag = "SOME", payload = _L[244]} |
| 10974 |
elseif a == "tex" then |
| 10975 |
return {tag = "SOME", payload = _L[245]} |
| 10976 |
elseif a == "etex" then |
| 10977 |
return {tag = "SOME", payload = _L[246]} |
| 10978 |
elseif a == "latex" then |
| 10979 |
return {tag = "SOME", payload = _L[247]} |
| 10980 |
elseif a == "ptex" then |
| 10981 |
return {tag = "SOME", payload = _L[248]} |
| 10982 |
elseif a == "eptex" then |
| 10983 |
return {tag = "SOME", payload = _L[249]} |
| 10984 |
elseif a == "platex" then |
| 10985 |
return {tag = "SOME", payload = _L[250]} |
| 10986 |
elseif a == "uptex" then |
| 10987 |
return {tag = "SOME", payload = _L[251]} |
| 10988 |
elseif a == "euptex" then |
| 10989 |
return {tag = "SOME", payload = _L[252]} |
| 10990 |
elseif a == "uplatex" then |
| 10991 |
return {tag = "SOME", payload = _L[253]} |
| 10992 |
else |
| 10993 |
return NONE |
| 10994 |
end |
| 10995 |
end |
| 10996 |
_L[255] = "DEFAULT" |
| 10997 |
_L[256] = "BLACK" |
| 10998 |
_L[257] = "RED" |
| 10999 |
_L[258] = "GREEN" |
| 11000 |
_L[259] = "YELLOW" |
| 11001 |
_L[260] = "BLUE" |
| 11002 |
_L[261] = "MAGENTA" |
| 11003 |
_L[262] = "CYAN" |
| 11004 |
_L[263] = "WHITE" |
| 11005 |
_L[264] = "BRIGHT_BLACK" |
| 11006 |
_L[265] = "BRIGHT_RED" |
| 11007 |
_L[266] = "BRIGHT_GREEN" |
| 11008 |
_L[267] = "BRIGHT_YELLOW" |
| 11009 |
_L[268] = "BRIGHT_BLUE" |
| 11010 |
_L[269] = "BRIGHT_MAGENTA" |
| 11011 |
_L[270] = "BRIGHT_CYAN" |
| 11012 |
_L[271] = "BRIGHT_WHITE" |
| 11013 |
_L[272] = function(a) |
| 11014 |
if a == "DEFAULT" then |
| 11015 |
return NONE |
| 11016 |
elseif a == "BLACK" then |
| 11017 |
return {tag = "SOME", payload = "30"} |
| 11018 |
elseif a == "RED" then |
| 11019 |
return {tag = "SOME", payload = "31"} |
| 11020 |
elseif a == "GREEN" then |
| 11021 |
return {tag = "SOME", payload = "32"} |
| 11022 |
elseif a == "YELLOW" then |
| 11023 |
return {tag = "SOME", payload = "33"} |
| 11024 |
elseif a == "BLUE" then |
| 11025 |
return {tag = "SOME", payload = "34"} |
| 11026 |
elseif a == "MAGENTA" then |
| 11027 |
return {tag = "SOME", payload = "35"} |
| 11028 |
elseif a == "CYAN" then |
| 11029 |
return {tag = "SOME", payload = "36"} |
| 11030 |
elseif a == "WHITE" then |
| 11031 |
return {tag = "SOME", payload = "37"} |
| 11032 |
elseif a == "BRIGHT_BLACK" then |
| 11033 |
return {tag = "SOME", payload = "90"} |
| 11034 |
elseif a == "BRIGHT_RED" then |
| 11035 |
return {tag = "SOME", payload = "91"} |
| 11036 |
elseif a == "BRIGHT_GREEN" then |
| 11037 |
return {tag = "SOME", payload = "92"} |
| 11038 |
elseif a == "BRIGHT_YELLOW" then |
| 11039 |
return {tag = "SOME", payload = "93"} |
| 11040 |
elseif a == "BRIGHT_BLUE" then |
| 11041 |
return {tag = "SOME", payload = "94"} |
| 11042 |
elseif a == "BRIGHT_MAGENTA" then |
| 11043 |
return {tag = "SOME", payload = "95"} |
| 11044 |
elseif a == "BRIGHT_CYAN" then |
| 11045 |
return {tag = "SOME", payload = "96"} |
| 11046 |
elseif a == "BRIGHT_WHITE" then |
| 11047 |
return {tag = "SOME", payload = "97"} |
| 11048 |
else |
| 11049 |
_raise(_Match, "ansi-color.sml:62:7") |
| 11050 |
end |
| 11051 |
end |
| 11052 |
_L[273] = function(a) |
| 11053 |
if a == "DEFAULT" then |
| 11054 |
return NONE |
| 11055 |
elseif a == "BLACK" then |
| 11056 |
return {tag = "SOME", payload = "40"} |
| 11057 |
elseif a == "RED" then |
| 11058 |
return {tag = "SOME", payload = "41"} |
| 11059 |
elseif a == "GREEN" then |
| 11060 |
return {tag = "SOME", payload = "42"} |
| 11061 |
elseif a == "YELLOW" then |
| 11062 |
return {tag = "SOME", payload = "43"} |
| 11063 |
elseif a == "BLUE" then |
| 11064 |
return {tag = "SOME", payload = "44"} |
| 11065 |
elseif a == "MAGENTA" then |
| 11066 |
return {tag = "SOME", payload = "45"} |
| 11067 |
elseif a == "CYAN" then |
| 11068 |
return {tag = "SOME", payload = "46"} |
| 11069 |
elseif a == "WHITE" then |
| 11070 |
return {tag = "SOME", payload = "47"} |
| 11071 |
elseif a == "BRIGHT_BLACK" then |
| 11072 |
return {tag = "SOME", payload = "100"} |
| 11073 |
elseif a == "BRIGHT_RED" then |
| 11074 |
return {tag = "SOME", payload = "101"} |
| 11075 |
elseif a == "BRIGHT_GREEN" then |
| 11076 |
return {tag = "SOME", payload = "102"} |
| 11077 |
elseif a == "BRIGHT_YELLOW" then |
| 11078 |
return {tag = "SOME", payload = "103"} |
| 11079 |
elseif a == "BRIGHT_BLUE" then |
| 11080 |
return {tag = "SOME", payload = "104"} |
| 11081 |
elseif a == "BRIGHT_MAGENTA" then |
| 11082 |
return {tag = "SOME", payload = "105"} |
| 11083 |
elseif a == "BRIGHT_CYAN" then |
| 11084 |
return {tag = "SOME", payload = "106"} |
| 11085 |
elseif a == "BRIGHT_WHITE" then |
| 11086 |
return {tag = "SOME", payload = "107"} |
| 11087 |
else |
| 11088 |
_raise(_Match, "ansi-color.sml:79:7") |
| 11089 |
end |
| 11090 |
end |
| 11091 |
_L[274] = function(tmp54, xs) |
| 11092 |
if tmp54.tag == "SOME" then |
| 11093 |
return {tmp54.payload, xs} |
| 11094 |
elseif tmp54.tag == "NONE" then |
| 11095 |
return xs |
| 11096 |
else |
| 11097 |
_raise(_Match, "ansi-color.sml:137:7") |
| 11098 |
end |
| 11099 |
end |
| 11100 |
_L[275] = function(background, blink, bold, dim, foreground, italic, reverse, strike, underline) |
| 11101 |
local attrs, tmp54 |
| 11102 |
do |
| 11103 |
local attrs1 |
| 11104 |
if strike then |
| 11105 |
attrs1 = {"9", nil} |
| 11106 |
else |
| 11107 |
attrs1 = nil |
| 11108 |
end |
| 11109 |
local attrs2 |
| 11110 |
if reverse then |
| 11111 |
attrs2 = {"7", attrs1} |
| 11112 |
else |
| 11113 |
attrs2 = attrs1 |
| 11114 |
end |
| 11115 |
local attrs3 |
| 11116 |
if blink then |
| 11117 |
attrs3 = {"5", attrs2} |
| 11118 |
else |
| 11119 |
attrs3 = attrs2 |
| 11120 |
end |
| 11121 |
local attrs4 |
| 11122 |
if underline then |
| 11123 |
attrs4 = {"4", attrs3} |
| 11124 |
else |
| 11125 |
attrs4 = attrs3 |
| 11126 |
end |
| 11127 |
local attrs5 |
| 11128 |
if italic then |
| 11129 |
attrs5 = {"3", attrs4} |
| 11130 |
else |
| 11131 |
attrs5 = attrs4 |
| 11132 |
end |
| 11133 |
local attrs6 |
| 11134 |
if dim then |
| 11135 |
attrs6 = {"2", attrs5} |
| 11136 |
else |
| 11137 |
attrs6 = attrs5 |
| 11138 |
end |
| 11139 |
local attrs7 |
| 11140 |
if bold then |
| 11141 |
attrs7 = {"1", attrs6} |
| 11142 |
else |
| 11143 |
attrs7 = attrs6 |
| 11144 |
end |
| 11145 |
local tmp55 = mapPartial(_L[273]) |
| 11146 |
local tmp56 = tmp55(background) |
| 11147 |
attrs = _L[274](tmp56, attrs7) |
| 11148 |
local tmp57 = mapPartial(_L[272]) |
| 11149 |
tmp54 = tmp57(foreground) |
| 11150 |
end |
| 11151 |
local attrs1 = _L[274](tmp54, attrs) |
| 11152 |
return "\x1B[" .. table_concat(_VectorOrArray_fromList(attrs1), ";") .. "m" |
| 11153 |
end |
| 11154 |
_ENV.CLUTTEX_VERBOSITY = 0 |
| 11155 |
_L[276] = "ALWAYS" |
| 11156 |
_L[277] = "AUTO" |
| 11157 |
_L[278] = "NEVER" |
| 11158 |
_L[279] = {false} |
| 11159 |
_L[280] = function(a) |
| 11160 |
if a == "ALWAYS" then |
| 11161 |
else |
| 11162 |
goto else1 |
| 11163 |
end |
| 11164 |
do |
| 11165 |
local tmp54 = tmp3("texrunner.isatty").enable_virtual_terminal |
| 11166 |
local tmp55 = _ENV.io.stderr |
| 11167 |
_L[279][1] = true |
| 11168 |
if not not tmp54 then |
| 11169 |
else |
| 11170 |
return nil |
| 11171 |
end |
| 11172 |
do |
| 11173 |
if not tmp54(tmp55) and _ENV.CLUTTEX_VERBOSITY >= 2 then |
| 11174 |
else |
| 11175 |
return nil |
| 11176 |
end |
| 11177 |
do |
| 11178 |
return _L[124]({_L[118], "ClutTeX: Failed to enable virtual terminal\n"}) |
| 11179 |
end |
| 11180 |
end |
| 11181 |
end |
| 11182 |
::else1:: |
| 11183 |
if a == "AUTO" then |
| 11184 |
elseif a == "NEVER" then |
| 11185 |
_L[279][1] = false |
| 11186 |
return nil |
| 11187 |
else |
| 11188 |
_raise(_Match, "message.sml:26:5") |
| 11189 |
end |
| 11190 |
do |
| 11191 |
local tmp54 = tmp3("texrunner.isatty") |
| 11192 |
local tmp55 = tmp54.enable_virtual_terminal |
| 11193 |
local tmp56 = _ENV.io.stderr |
| 11194 |
local tmp57 = not not tmp54.isatty(tmp56) |
| 11195 |
_L[279][1] = tmp57 |
| 11196 |
local tmp58 |
| 11197 |
tmp58 = tmp57 and not not tmp55 |
| 11198 |
if tmp58 then |
| 11199 |
else |
| 11200 |
return nil |
| 11201 |
end |
| 11202 |
do |
| 11203 |
local tmp59 = tmp55(tmp56) |
| 11204 |
_L[279][1] = tmp59 |
| 11205 |
if not tmp59 and _ENV.CLUTTEX_VERBOSITY >= 2 then |
| 11206 |
else |
| 11207 |
return nil |
| 11208 |
end |
| 11209 |
do |
| 11210 |
return _L[124]({_L[118], "ClutTeX: Failed to enable virtual terminal\n"}) |
| 11211 |
end |
| 11212 |
end |
| 11213 |
end |
| 11214 |
end |
| 11215 |
_L[281] = {tag = "SOME", payload = _L[271]} |
| 11216 |
_L[282] = _L[275]({tag = "SOME", payload = _L[257]}, false, false, false, _L[281], false, false, false, false) |
| 11217 |
_L[283] = {_L[282]} |
| 11218 |
_L[284] = _L[275](NONE, false, false, false, {tag = "SOME", payload = _L[262]}, false, false, false, false) |
| 11219 |
_L[285] = {_L[284]} |
| 11220 |
_L[286] = _L[275](NONE, false, false, false, {tag = "SOME", payload = _L[257]}, false, false, false, false) |
| 11221 |
_L[287] = {_L[286]} |
| 11222 |
_L[288] = _L[275](NONE, false, false, false, {tag = "SOME", payload = _L[260]}, false, false, false, false) |
| 11223 |
_L[289] = {_L[288]} |
| 11224 |
_L[290] = _L[275](NONE, false, false, false, {tag = "SOME", payload = _L[260]}, false, false, false, false) |
| 11225 |
_L[291] = {_L[290]} |
| 11226 |
_L[292] = _L[275](NONE, false, false, false, {tag = "SOME", payload = _L[261]}, false, false, false, false) |
| 11227 |
_L[293] = {_L[292]} |
| 11228 |
_L[294] = function(a) |
| 11229 |
local tmp54 |
| 11230 |
do |
| 11231 |
local background = a.background |
| 11232 |
local blink = a.blink |
| 11233 |
local bold = a.bold |
| 11234 |
local dim = a.dim |
| 11235 |
local foreground = a.foreground |
| 11236 |
local italic = a.italic |
| 11237 |
local reverse = a.reverse |
| 11238 |
local strike = a.strike |
| 11239 |
tmp54 = _L[275](background, blink, bold, dim, foreground, italic, reverse, strike, a.underline) |
| 11240 |
end |
| 11241 |
_L[283][1] = tmp54 |
| 11242 |
return nil |
| 11243 |
end |
| 11244 |
_L[295] = function(a) |
| 11245 |
local tmp54 |
| 11246 |
do |
| 11247 |
local background = a.background |
| 11248 |
local blink = a.blink |
| 11249 |
local bold = a.bold |
| 11250 |
local dim = a.dim |
| 11251 |
local foreground = a.foreground |
| 11252 |
local italic = a.italic |
| 11253 |
local reverse = a.reverse |
| 11254 |
local strike = a.strike |
| 11255 |
tmp54 = _L[275](background, blink, bold, dim, foreground, italic, reverse, strike, a.underline) |
| 11256 |
end |
| 11257 |
_L[285][1] = tmp54 |
| 11258 |
return nil |
| 11259 |
end |
| 11260 |
_L[296] = function(a) |
| 11261 |
local tmp54 |
| 11262 |
do |
| 11263 |
local background = a.background |
| 11264 |
local blink = a.blink |
| 11265 |
local bold = a.bold |
| 11266 |
local dim = a.dim |
| 11267 |
local foreground = a.foreground |
| 11268 |
local italic = a.italic |
| 11269 |
local reverse = a.reverse |
| 11270 |
local strike = a.strike |
| 11271 |
tmp54 = _L[275](background, blink, bold, dim, foreground, italic, reverse, strike, a.underline) |
| 11272 |
end |
| 11273 |
_L[287][1] = tmp54 |
| 11274 |
return nil |
| 11275 |
end |
| 11276 |
_L[297] = function(a) |
| 11277 |
local tmp54 |
| 11278 |
do |
| 11279 |
local background = a.background |
| 11280 |
local blink = a.blink |
| 11281 |
local bold = a.bold |
| 11282 |
local dim = a.dim |
| 11283 |
local foreground = a.foreground |
| 11284 |
local italic = a.italic |
| 11285 |
local reverse = a.reverse |
| 11286 |
local strike = a.strike |
| 11287 |
tmp54 = _L[275](background, blink, bold, dim, foreground, italic, reverse, strike, a.underline) |
| 11288 |
end |
| 11289 |
_L[289][1] = tmp54 |
| 11290 |
return nil |
| 11291 |
end |
| 11292 |
_L[298] = function(a) |
| 11293 |
local tmp54 |
| 11294 |
do |
| 11295 |
local background = a.background |
| 11296 |
local blink = a.blink |
| 11297 |
local bold = a.bold |
| 11298 |
local dim = a.dim |
| 11299 |
local foreground = a.foreground |
| 11300 |
local italic = a.italic |
| 11301 |
local reverse = a.reverse |
| 11302 |
local strike = a.strike |
| 11303 |
tmp54 = _L[275](background, blink, bold, dim, foreground, italic, reverse, strike, a.underline) |
| 11304 |
end |
| 11305 |
_L[291][1] = tmp54 |
| 11306 |
return nil |
| 11307 |
end |
| 11308 |
_L[299] = function(a) |
| 11309 |
local tmp54 |
| 11310 |
do |
| 11311 |
local background = a.background |
| 11312 |
local blink = a.blink |
| 11313 |
local bold = a.bold |
| 11314 |
local dim = a.dim |
| 11315 |
local foreground = a.foreground |
| 11316 |
local italic = a.italic |
| 11317 |
local reverse = a.reverse |
| 11318 |
local strike = a.strike |
| 11319 |
tmp54 = _L[275](background, blink, bold, dim, foreground, italic, reverse, strike, a.underline) |
| 11320 |
end |
| 11321 |
_L[293][1] = tmp54 |
| 11322 |
return nil |
| 11323 |
end |
| 11324 |
_L[300] = function(a) |
| 11325 |
if _L[279][1] then |
| 11326 |
else |
| 11327 |
return _L[124]({_L[118], "[EXEC] " .. a .. "\n"}) |
| 11328 |
end |
| 11329 |
do |
| 11330 |
local tmp54 = _L[283][1] .. "[EXEC]" .. "\x1B[0m" .. " " |
| 11331 |
return _L[124]({_L[118], tmp54 .. _L[285][1] .. a .. "\x1B[0m" .. "\n"}) |
| 11332 |
end |
| 11333 |
end |
| 11334 |
_L[301] = function(a) |
| 11335 |
if _L[279][1] then |
| 11336 |
else |
| 11337 |
return _L[124]({_L[118], "[ERROR] " .. a .. "\n"}) |
| 11338 |
end |
| 11339 |
do |
| 11340 |
local tmp54 = _L[283][1] .. "[ERROR]" .. "\x1B[0m" .. " " |
| 11341 |
return _L[124]({_L[118], tmp54 .. _L[287][1] .. a .. "\x1B[0m" .. "\n"}) |
| 11342 |
end |
| 11343 |
end |
| 11344 |
_L[302] = function(a) |
| 11345 |
if _L[279][1] then |
| 11346 |
else |
| 11347 |
return _L[124]({_L[118], "[WARN] " .. a .. "\n"}) |
| 11348 |
end |
| 11349 |
do |
| 11350 |
local tmp54 = _L[283][1] .. "[WARN]" .. "\x1B[0m" .. " " |
| 11351 |
return _L[124]({_L[118], tmp54 .. _L[289][1] .. a .. "\x1B[0m" .. "\n"}) |
| 11352 |
end |
| 11353 |
end |
| 11354 |
_L[303] = function(a) |
| 11355 |
if _L[279][1] then |
| 11356 |
else |
| 11357 |
return _L[124]({_L[118], "[DIAG] " .. a .. "\n"}) |
| 11358 |
end |
| 11359 |
do |
| 11360 |
local tmp54 = _L[283][1] .. "[DIAG]" .. "\x1B[0m" .. " " |
| 11361 |
return _L[124]({_L[118], tmp54 .. _L[291][1] .. a .. "\x1B[0m" .. "\n"}) |
| 11362 |
end |
| 11363 |
end |
| 11364 |
_L[304] = function(a) |
| 11365 |
if _L[279][1] then |
| 11366 |
else |
| 11367 |
return _L[124]({_L[118], "[INFO] " .. a .. "\n"}) |
| 11368 |
end |
| 11369 |
do |
| 11370 |
local tmp54 = _L[283][1] .. "[INFO]" .. "\x1B[0m" .. " " |
| 11371 |
return _L[124]({_L[118], tmp54 .. _L[293][1] .. a .. "\x1B[0m" .. "\n"}) |
| 11372 |
end |
| 11373 |
end |
| 11374 |
_L[305] = "DVIPDFMX" |
| 11375 |
_L[306] = "DVIPS" |
| 11376 |
_L[307] = "DVISVGM" |
| 11377 |
_L[308] = "PDFTEX" |
| 11378 |
_L[309] = "XETEX" |
| 11379 |
_L[310] = "LUATEX" |
| 11380 |
_L[311] = "DVIPDFMX" |
| 11381 |
_L[312] = "DVIPS" |
| 11382 |
_L[313] = "DVISVGM" |
| 11383 |
_L[314] = "PDFTEX" |
| 11384 |
_L[315] = "XETEX" |
| 11385 |
_L[316] = "LUATEX" |
| 11386 |
_L[317] = "UNKNOWN" |
| 11387 |
_L[318] = function(a) |
| 11388 |
if a == "DVIPDFMX" then |
| 11389 |
return "dvipdfmx" |
| 11390 |
elseif a == "DVIPS" then |
| 11391 |
return "dvips" |
| 11392 |
elseif a == "DVISVGM" then |
| 11393 |
return "dvisvgm" |
| 11394 |
elseif a == "PDFTEX" then |
| 11395 |
return "pdftex" |
| 11396 |
elseif a == "XETEX" then |
| 11397 |
return "xetex" |
| 11398 |
elseif a == "LUATEX" then |
| 11399 |
return "luatex" |
| 11400 |
elseif a == "UNKNOWN" then |
| 11401 |
return "unknown" |
| 11402 |
else |
| 11403 |
_raise(_Match, "check-driver.sml:24:9") |
| 11404 |
end |
| 11405 |
end |
| 11406 |
_L[319] = "PDFMODE" |
| 11407 |
_L[320] = "DVISVGM" |
| 11408 |
_L[321] = "XDVIPDFMX" |
| 11409 |
_L[322] = "DVIPDFMX" |
| 11410 |
_L[323] = "DVIPS" |
| 11411 |
_L[324] = "PDFTEX" |
| 11412 |
_L[325] = "LUATEX" |
| 11413 |
_L[326] = "XETEX" |
| 11414 |
_L[327] = "UNKNOWN" |
| 11415 |
_L[328] = function(tmp54, tmp55) |
| 11416 |
return tmp54 == "PDFMODE" and tmp55 == "PDFMODE" or (tmp54 == "DVISVGM" and tmp55 == "DVISVGM" or (tmp54 == "XDVIPDFMX" and tmp55 == "XDVIPDFMX" or (tmp54 == "DVIPDFMX" and tmp55 == "DVIPDFMX" or (tmp54 == "DVIPS" and tmp55 == "DVIPS" or (tmp54 == "PDFTEX" and tmp55 == "PDFTEX" or (tmp54 == "LUATEX" and tmp55 == "LUATEX" or (tmp54 == "XETEX" and tmp55 == "XETEX" or tmp54 == "UNKNOWN" and tmp55 == "UNKNOWN"))))))) |
| 11417 |
end |
| 11418 |
_L[329] = function(a) |
| 11419 |
if a == "PDFMODE" then |
| 11420 |
return "pdfmode" |
| 11421 |
elseif a == "DVISVGM" then |
| 11422 |
return "dvisvgm" |
| 11423 |
elseif a == "XDVIPDFMX" then |
| 11424 |
return "xdvipdfmx" |
| 11425 |
elseif a == "DVIPDFMX" then |
| 11426 |
return "dvipdfmx" |
| 11427 |
elseif a == "DVIPS" then |
| 11428 |
return "dvips" |
| 11429 |
elseif a == "PDFTEX" then |
| 11430 |
return "pdftex" |
| 11431 |
elseif a == "LUATEX" then |
| 11432 |
return "luatex" |
| 11433 |
elseif a == "XETEX" then |
| 11434 |
return "xetex" |
| 11435 |
elseif a == "UNKNOWN" then |
| 11436 |
return "unknown" |
| 11437 |
else |
| 11438 |
_raise(_Match, "check-driver.sml:44:9") |
| 11439 |
end |
| 11440 |
end |
| 11441 |
_L[330] = "DVIPDFMX" |
| 11442 |
_L[331] = "DVIPS" |
| 11443 |
_L[332] = "PDFTEX" |
| 11444 |
_L[333] = "LUATEX" |
| 11445 |
_L[334] = "XETEX" |
| 11446 |
_L[335] = "UNKNOWN" |
| 11447 |
_L[336] = function(a) |
| 11448 |
if a == "DVIPDFMX" then |
| 11449 |
return "dvipdfmx" |
| 11450 |
elseif a == "DVIPS" then |
| 11451 |
return "dvips" |
| 11452 |
elseif a == "PDFTEX" then |
| 11453 |
return "pdftex" |
| 11454 |
elseif a == "LUATEX" then |
| 11455 |
return "luatex" |
| 11456 |
elseif a == "XETEX" then |
| 11457 |
return "xetex" |
| 11458 |
elseif a == "UNKNOWN" then |
| 11459 |
return "unknown" |
| 11460 |
else |
| 11461 |
_raise(_Match, "check-driver.sml:57:9") |
| 11462 |
end |
| 11463 |
end |
| 11464 |
_L[337] = "PDF" |
| 11465 |
_L[338] = "DVIPS" |
| 11466 |
_L[339] = "UNKNOWN" |
| 11467 |
_L[340] = "DVIPDFMX" |
| 11468 |
_L[341] = "DVIPS" |
| 11469 |
_L[342] = "DVISVGM" |
| 11470 |
_L[343] = "FSWATCH" |
| 11471 |
_L[344] = "INOTIFYWAIT" |
| 11472 |
_L[345] = "AUTO" |
| 11473 |
_L[346] = function(tmp54, tmp55) |
| 11474 |
return tmp54 == "FSWATCH" and tmp55 == "FSWATCH" or (tmp54 == "INOTIFYWAIT" and tmp55 == "INOTIFYWAIT" or tmp54 == "AUTO" and tmp55 == "AUTO") |
| 11475 |
end |
| 11476 |
_L[347] = {tag = "NOW"} |
| 11477 |
_L[348] = function(p) |
| 11478 |
if p[1].tag == "NOW" and p[2].tag == "NOW" then |
| 11479 |
return true |
| 11480 |
elseif p[1].tag == "RAW" and p[2].tag == "RAW" then |
| 11481 |
local a = p[1].payload |
| 11482 |
return a == p[2].payload |
| 11483 |
else |
| 11484 |
return false |
| 11485 |
end |
| 11486 |
end |
| 11487 |
_L[349] = {bibtex_or_biber = NONE, change_directory = NONE, check_driver = NONE, color = NONE, config_file = NONE, dvipdfmx_extraoptions = nil, engine = NONE, engine_executable = NONE, file_line_error = true, fmt = NONE, fresh = false, halt_on_error = true, includeonly = NONE, interaction = NONE, jobname = NONE, make_depends = NONE, makeglossaries = NONE, makeindex = NONE, max_iterations = NONE, output = NONE, output_directory = NONE, output_format = NONE, package_support = {epstopdf = false, minted = false, pdfx = false}, print_output_directory = false, shell_escape = NONE, source_date_epoch = NONE, start_with_draft = false, synctex = NONE, tex_extraoptions = nil, watch = NONE} |
| 11488 |
_L[350] = function(a) |
| 11489 |
return function(a1) |
| 11490 |
local tmp54 = isPrefix(a) |
| 11491 |
local tmp55 = tmp54(a1) |
| 11492 |
if tmp55 then |
| 11493 |
else |
| 11494 |
return NONE |
| 11495 |
end |
| 11496 |
do |
| 11497 |
local tmp56 = extract1({a1, #a, NONE}) |
| 11498 |
return {tag = "SOME", payload = tmp56} |
| 11499 |
end |
| 11500 |
end |
| 11501 |
end |
| 11502 |
_L[351] = function(line, outdir) |
| 11503 |
local tmp54 = _L[350]("\\@input{") |
| 11504 |
local exp = tmp54(line) |
| 11505 |
if exp.tag == "NONE" then |
| 11506 |
return NONE |
| 11507 |
end |
| 11508 |
if exp.tag == "SOME" then |
| 11509 |
else |
| 11510 |
_raise(_Match, "auxfile.sml:15:5") |
| 11511 |
end |
| 11512 |
do |
| 11513 |
local rest = exp.payload |
| 11514 |
local tmp55 = splitl(function(c) |
| 11515 |
return c ~= 125 |
| 11516 |
end) |
| 11517 |
local tmp56 = tmp55(rest) |
| 11518 |
local subauxfile = string1(tmp56[1]) |
| 11519 |
local subauxfile_abs = _L[215]({tag = "SOME", payload = outdir}, subauxfile) |
| 11520 |
return {tag = "SOME", payload = {subauxfile = subauxfile, subauxfile_abs = subauxfile_abs}} |
| 11521 |
end |
| 11522 |
end |
| 11523 |
_L[352] = function(auxfile, outdir, seen) |
| 11524 |
local ins, tmp54, tmp55 |
| 11525 |
do |
| 11526 |
ins = _L[115](auxfile) |
| 11527 |
local seen1 = _L[198](seen, auxfile) |
| 11528 |
tmp55, tmp54 = false, seen1 |
| 11529 |
end |
| 11530 |
::cont:: |
| 11531 |
do |
| 11532 |
local did, seen1 = tmp55, tmp54 |
| 11533 |
local exp = _L[114](ins) |
| 11534 |
if exp.tag == "NONE" then |
| 11535 |
else |
| 11536 |
goto else1 |
| 11537 |
end |
| 11538 |
do |
| 11539 |
_L[120](ins) |
| 11540 |
return {did, seen1} |
| 11541 |
end |
| 11542 |
::else1:: |
| 11543 |
if exp.tag == "SOME" then |
| 11544 |
else |
| 11545 |
_raise(_Match, "auxfile.sml:31:9") |
| 11546 |
end |
| 11547 |
do |
| 11548 |
local exp1 = _L[351](exp.payload, outdir) |
| 11549 |
if exp1.tag == "NONE" then |
| 11550 |
tmp55 = did |
| 11551 |
tmp54 = seen1 |
| 11552 |
goto cont |
| 11553 |
end |
| 11554 |
if exp1.tag == "SOME" then |
| 11555 |
else |
| 11556 |
_raise(_Match, "auxfile.sml:34:13") |
| 11557 |
end |
| 11558 |
do |
| 11559 |
local subauxfile |
| 11560 |
do |
| 11561 |
subauxfile = exp1.payload.subauxfile |
| 11562 |
local subauxfile_abs = exp1.payload.subauxfile_abs |
| 11563 |
local tmp56 = _L[218](subauxfile_abs) |
| 11564 |
if tmp56 then |
| 11565 |
else |
| 11566 |
goto else2 |
| 11567 |
end |
| 11568 |
do |
| 11569 |
local exp2 = _L[352](subauxfile_abs, outdir, seen1) |
| 11570 |
local did_PRIME = exp2[1] |
| 11571 |
local seen2 = exp2[2] |
| 11572 |
if did then |
| 11573 |
tmp55 = true |
| 11574 |
tmp54 = seen2 |
| 11575 |
goto cont |
| 11576 |
else |
| 11577 |
tmp55 = did_PRIME |
| 11578 |
tmp54 = seen2 |
| 11579 |
goto cont |
| 11580 |
end |
| 11581 |
end |
| 11582 |
end |
| 11583 |
::else2:: |
| 11584 |
local tmp56 = _L[212](subauxfile) |
| 11585 |
local tmp57 = _L[210].join(outdir, tmp56) |
| 11586 |
local tmp58 = _L[219](tmp57) |
| 11587 |
if tmp58 then |
| 11588 |
tmp55 = did |
| 11589 |
tmp54 = seen1 |
| 11590 |
goto cont |
| 11591 |
end |
| 11592 |
local tmp59, tmp60 = _L[217].mkdir_rec(tmp57) |
| 11593 |
if not tmp59 then |
| 11594 |
else |
| 11595 |
tmp55 = true |
| 11596 |
tmp54 = seen1 |
| 11597 |
goto cont |
| 11598 |
end |
| 11599 |
do |
| 11600 |
local tmp61 = _Error(tmp60) |
| 11601 |
_raise(tmp61, "fs-util.sml:16:28") |
| 11602 |
end |
| 11603 |
end |
| 11604 |
end |
| 11605 |
end |
| 11606 |
end |
| 11607 |
_L[353] = function(auxfile, outdir, revLines) |
| 11608 |
local ins = _L[115](auxfile) |
| 11609 |
local tmp54 = revLines |
| 11610 |
::cont:: |
| 11611 |
do |
| 11612 |
local a = tmp54 |
| 11613 |
local exp = _L[114](ins) |
| 11614 |
if exp.tag == "NONE" then |
| 11615 |
else |
| 11616 |
goto else1 |
| 11617 |
end |
| 11618 |
do |
| 11619 |
_L[120](ins) |
| 11620 |
return a |
| 11621 |
end |
| 11622 |
::else1:: |
| 11623 |
if exp.tag == "SOME" then |
| 11624 |
else |
| 11625 |
_raise(_Match, "auxfile.sml:62:9") |
| 11626 |
end |
| 11627 |
do |
| 11628 |
local line = exp.payload |
| 11629 |
local exp1 = _L[351](line, outdir) |
| 11630 |
if exp1.tag == "SOME" then |
| 11631 |
else |
| 11632 |
goto else2 |
| 11633 |
end |
| 11634 |
do |
| 11635 |
local subauxfile_abs = exp1.payload.subauxfile_abs |
| 11636 |
local tmp55 = _L[218](subauxfile_abs) |
| 11637 |
if tmp55 then |
| 11638 |
else |
| 11639 |
tmp54 = a |
| 11640 |
goto cont |
| 11641 |
end |
| 11642 |
tmp54 = _L[353](subauxfile_abs, outdir, a) |
| 11643 |
goto cont |
| 11644 |
end |
| 11645 |
::else2:: |
| 11646 |
if exp1.tag == "NONE" then |
| 11647 |
else |
| 11648 |
_raise(_Match, "auxfile.sml:65:13") |
| 11649 |
end |
| 11650 |
do |
| 11651 |
local isBibTeXLine |
| 11652 |
do |
| 11653 |
local tmp55 = _L[350]("\\") |
| 11654 |
local exp2 = tmp55(line) |
| 11655 |
do |
| 11656 |
if exp2.tag == "SOME" then |
| 11657 |
elseif exp2.tag == "NONE" then |
| 11658 |
isBibTeXLine = false |
| 11659 |
goto cont1 |
| 11660 |
else |
| 11661 |
_raise(_Match, "auxfile.sml:83:21") |
| 11662 |
end |
| 11663 |
do |
| 11664 |
local s = exp2.payload |
| 11665 |
local tmp56 |
| 11666 |
do |
| 11667 |
local tmp57 = splitl(function(c) |
| 11668 |
local tmp58 |
| 11669 |
tmp58 = 65 <= c and c <= 90 or 97 <= c and c <= 122 |
| 11670 |
return tmp58 or c == 64 |
| 11671 |
end) |
| 11672 |
local tmp58 = tmp57(s) |
| 11673 |
tmp56 = tmp58[1] |
| 11674 |
end |
| 11675 |
local exp3 = string1(tmp56) |
| 11676 |
isBibTeXLine = exp3 == "citation" or (exp3 == "bibdata" or exp3 == "bibstyle") |
| 11677 |
end |
| 11678 |
end |
| 11679 |
end |
| 11680 |
::cont1:: |
| 11681 |
if isBibTeXLine then |
| 11682 |
else |
| 11683 |
tmp54 = a |
| 11684 |
goto cont |
| 11685 |
end |
| 11686 |
do |
| 11687 |
if _ENV.CLUTTEX_VERBOSITY >= 2 then |
| 11688 |
else |
| 11689 |
tmp54 = {line, a} |
| 11690 |
goto cont |
| 11691 |
end |
| 11692 |
do |
| 11693 |
local tmp55 = full(line) |
| 11694 |
local tmp56 = splitr(isSpace, tmp55) |
| 11695 |
local tmp57 = string1(tmp56[1]) |
| 11696 |
_L[304]("BibTeX line: " .. tmp57) |
| 11697 |
tmp54 = {line, a} |
| 11698 |
goto cont |
| 11699 |
end |
| 11700 |
end |
| 11701 |
end |
| 11702 |
end |
| 11703 |
end |
| 11704 |
end |
| 11705 |
_L[354] = tmp3("texrunner.luatexinit") |
| 11706 |
_L[355] = "INPUT" |
| 11707 |
_L[356] = "OUTPUT" |
| 11708 |
_L[357] = "AUXILIARY" |
| 11709 |
_L[358] = function(tmp54, tmp55) |
| 11710 |
return tmp54 == "INPUT" and tmp55 == "INPUT" or (tmp54 == "OUTPUT" and tmp55 == "OUTPUT" or tmp54 == "AUXILIARY" and tmp55 == "AUXILIARY") |
| 11711 |
end |
| 11712 |
_L[359] = function(fileInfo, fileMap) |
| 11713 |
local tmp54 = foldl(function(a) |
| 11714 |
local x = a[1] |
| 11715 |
return {x[1], a[2]} |
| 11716 |
end) |
| 11717 |
local tmp55 = tmp54(nil) |
| 11718 |
local tmp56 = tmp55(fileInfo) |
| 11719 |
local tmp57 = _L[206](_EXCLAM) |
| 11720 |
local tmp58 = tmp57(fileMap) |
| 11721 |
return {tmp56, tmp58} |
| 11722 |
end |
| 11723 |
_L[360] = function(file, tmp54, fileList, fileMap) |
| 11724 |
local ins = _L[115](file) |
| 11725 |
local tmp55, tmp56 = fileList, fileMap |
| 11726 |
::cont:: |
| 11727 |
do |
| 11728 |
local fileList1, fileMap1 = tmp55, tmp56 |
| 11729 |
local exp = _L[114](ins) |
| 11730 |
if exp.tag == "NONE" then |
| 11731 |
else |
| 11732 |
goto else1 |
| 11733 |
end |
| 11734 |
do |
| 11735 |
_L[120](ins) |
| 11736 |
return {fileList1, fileMap1} |
| 11737 |
end |
| 11738 |
::else1:: |
| 11739 |
if exp.tag == "SOME" then |
| 11740 |
else |
| 11741 |
_raise(_Match, "reruncheck.sml:29:17") |
| 11742 |
end |
| 11743 |
do |
| 11744 |
local path, exp1 |
| 11745 |
do |
| 11746 |
local line = exp.payload |
| 11747 |
local tmp57 = splitl(isAlphaNum) |
| 11748 |
local tmp58 = full(line) |
| 11749 |
local exp2 = tmp57(tmp58) |
| 11750 |
local t = exp2[1] |
| 11751 |
local tmp59 |
| 11752 |
do |
| 11753 |
local tmp60 = splitr(isSpace, exp2[2]) |
| 11754 |
tmp59 = tmp60[1] |
| 11755 |
end |
| 11756 |
local tmp60 |
| 11757 |
do |
| 11758 |
local tmp61 = splitl(isSpace) |
| 11759 |
local tmp62 = tmp61(tmp59) |
| 11760 |
tmp60 = tmp62[2] |
| 11761 |
end |
| 11762 |
path = string1(tmp60) |
| 11763 |
exp1 = string1(t) |
| 11764 |
if exp1 == "PWD" then |
| 11765 |
tmp55 = fileList1 |
| 11766 |
tmp56 = fileMap1 |
| 11767 |
goto cont |
| 11768 |
end |
| 11769 |
if exp1 == "INPUT" then |
| 11770 |
else |
| 11771 |
goto else2 |
| 11772 |
end |
| 11773 |
do |
| 11774 |
local abspath = _L[215](NONE, path) |
| 11775 |
local exp3 = _L[205](fileMap1, abspath) |
| 11776 |
if exp3.tag == "SOME" then |
| 11777 |
else |
| 11778 |
goto else4 |
| 11779 |
end |
| 11780 |
do |
| 11781 |
local r = exp3.payload |
| 11782 |
local path_PRIME = exp3.payload[1].path |
| 11783 |
local abspath_PRIME = exp3.payload[1].abspath |
| 11784 |
local kind = exp3.payload[1].kind |
| 11785 |
local tmp61 = #path |
| 11786 |
local tmp62 |
| 11787 |
if tmp61 < #path_PRIME then |
| 11788 |
tmp62 = path |
| 11789 |
else |
| 11790 |
tmp62 = path_PRIME |
| 11791 |
end |
| 11792 |
local tmp63 = _L[358](kind, _L[356]) |
| 11793 |
local tmp64 |
| 11794 |
if tmp63 then |
| 11795 |
tmp64 = _L[357] |
| 11796 |
else |
| 11797 |
tmp64 = kind |
| 11798 |
end |
| 11799 |
r[1] = {abspath = abspath_PRIME, kind = tmp64, path = tmp62} |
| 11800 |
tmp55 = fileList1 |
| 11801 |
tmp56 = fileMap1 |
| 11802 |
goto cont |
| 11803 |
end |
| 11804 |
::else4:: |
| 11805 |
if exp3.tag == "NONE" then |
| 11806 |
else |
| 11807 |
_raise(_Match, "reruncheck.sml:38:31") |
| 11808 |
end |
| 11809 |
do |
| 11810 |
local tmp61 = _L[218](path) |
| 11811 |
if tmp61 then |
| 11812 |
else |
| 11813 |
tmp55 = fileList1 |
| 11814 |
tmp56 = fileMap1 |
| 11815 |
goto cont |
| 11816 |
end |
| 11817 |
do |
| 11818 |
local tmp62 = _L[214](path) |
| 11819 |
local tmp63 |
| 11820 |
if tmp62 == "bbl" then |
| 11821 |
tmp63 = _L[357] |
| 11822 |
else |
| 11823 |
tmp63 = _L[355] |
| 11824 |
end |
| 11825 |
local tmp64 = {{abspath = abspath, kind = tmp63, path = path}} |
| 11826 |
local tmp65 = {tmp64, fileList1} |
| 11827 |
local tmp66 = _L[204](fileMap1, abspath, tmp64) |
| 11828 |
tmp55 = tmp65 |
| 11829 |
tmp56 = tmp66 |
| 11830 |
goto cont |
| 11831 |
end |
| 11832 |
end |
| 11833 |
end |
| 11834 |
end |
| 11835 |
::else2:: |
| 11836 |
if exp1 == "OUTPUT" then |
| 11837 |
else |
| 11838 |
goto else3 |
| 11839 |
end |
| 11840 |
do |
| 11841 |
local abspath = _L[215](NONE, path) |
| 11842 |
local exp2 = _L[205](fileMap1, abspath) |
| 11843 |
if exp2.tag == "SOME" then |
| 11844 |
else |
| 11845 |
goto else4 |
| 11846 |
end |
| 11847 |
do |
| 11848 |
local r = exp2.payload |
| 11849 |
local path_PRIME = exp2.payload[1].path |
| 11850 |
local abspath_PRIME = exp2.payload[1].abspath |
| 11851 |
local kind = exp2.payload[1].kind |
| 11852 |
local tmp57 = #path |
| 11853 |
local tmp58 |
| 11854 |
if tmp57 < #path_PRIME then |
| 11855 |
tmp58 = path |
| 11856 |
else |
| 11857 |
tmp58 = path_PRIME |
| 11858 |
end |
| 11859 |
local tmp59 = _L[358](kind, _L[355]) |
| 11860 |
local tmp60 |
| 11861 |
if tmp59 then |
| 11862 |
tmp60 = _L[357] |
| 11863 |
else |
| 11864 |
tmp60 = kind |
| 11865 |
end |
| 11866 |
r[1] = {abspath = abspath_PRIME, kind = tmp60, path = tmp58} |
| 11867 |
tmp55 = fileList1 |
| 11868 |
tmp56 = fileMap1 |
| 11869 |
goto cont |
| 11870 |
end |
| 11871 |
::else4:: |
| 11872 |
if exp2.tag == "NONE" then |
| 11873 |
else |
| 11874 |
_raise(_Match, "reruncheck.sml:70:31") |
| 11875 |
end |
| 11876 |
do |
| 11877 |
local tmp57 |
| 11878 |
do |
| 11879 |
local ext = _L[214](path) |
| 11880 |
do |
| 11881 |
if ext == "out" then |
| 11882 |
tmp57 = true |
| 11883 |
goto cont1 |
| 11884 |
end |
| 11885 |
local tmp58 = tmp(eq) |
| 11886 |
local tmp59 |
| 11887 |
do |
| 11888 |
local tmp60 = tmp58({tmp54, NONE}) |
| 11889 |
tmp59 = not tmp60 |
| 11890 |
end |
| 11891 |
local tmp60 |
| 11892 |
tmp60 = tmp59 and ext == "idx" |
| 11893 |
tmp57 = tmp60 or (ext == "bcf" or ext == "glo") |
| 11894 |
end |
| 11895 |
end |
| 11896 |
::cont1:: |
| 11897 |
local tmp58 |
| 11898 |
if tmp57 then |
| 11899 |
tmp58 = _L[357] |
| 11900 |
else |
| 11901 |
tmp58 = _L[356] |
| 11902 |
end |
| 11903 |
local tmp59 = {{abspath = abspath, kind = tmp58, path = path}} |
| 11904 |
local tmp60 = {tmp59, fileList1} |
| 11905 |
local tmp61 = _L[204](fileMap1, abspath, tmp59) |
| 11906 |
tmp55 = tmp60 |
| 11907 |
tmp56 = tmp61 |
| 11908 |
goto cont |
| 11909 |
end |
| 11910 |
end |
| 11911 |
::else3:: |
| 11912 |
_L[302]("Unrecognized line in recorder file '" .. file .. "': " .. exp1) |
| 11913 |
tmp55 = fileList1 |
| 11914 |
tmp56 = fileMap1 |
| 11915 |
goto cont |
| 11916 |
end |
| 11917 |
end |
| 11918 |
end |
| 11919 |
_L[361] = function(fileList, auxstatus) |
| 11920 |
local shouldRerun, auxstatus1 |
| 11921 |
do |
| 11922 |
local tmp54, tmp55 = fileList, _L[203] |
| 11923 |
::cont1:: |
| 11924 |
do |
| 11925 |
local tmp56, newauxstatus = tmp54, tmp55 |
| 11926 |
if tmp56 == nil then |
| 11927 |
auxstatus1 = newauxstatus |
| 11928 |
shouldRerun = false |
| 11929 |
goto cont |
| 11930 |
end |
| 11931 |
if tmp56 ~= nil then |
| 11932 |
else |
| 11933 |
_raise(_Match, "reruncheck.sml:155:15") |
| 11934 |
end |
| 11935 |
do |
| 11936 |
local shortPath = tmp56[1].path |
| 11937 |
local abspath = tmp56[1].abspath |
| 11938 |
local kind = tmp56[1].kind |
| 11939 |
local tmp57 = tmp56[2] |
| 11940 |
local tmp58 = _L[218](abspath) |
| 11941 |
if tmp58 then |
| 11942 |
else |
| 11943 |
tmp54 = tmp57 |
| 11944 |
tmp55 = newauxstatus |
| 11945 |
goto cont1 |
| 11946 |
end |
| 11947 |
do |
| 11948 |
local shouldRerun1, newauxstatus1 |
| 11949 |
do |
| 11950 |
if kind == "INPUT" then |
| 11951 |
else |
| 11952 |
goto else1 |
| 11953 |
end |
| 11954 |
do |
| 11955 |
local mtime = _L[66](abspath) |
| 11956 |
local exp = _L[205](auxstatus, abspath) |
| 11957 |
if exp.tag == "SOME" and exp.payload.mtime.tag == "SOME" then |
| 11958 |
else |
| 11959 |
newauxstatus1 = newauxstatus |
| 11960 |
shouldRerun1 = false |
| 11961 |
goto cont2 |
| 11962 |
end |
| 11963 |
do |
| 11964 |
if exp.payload.mtime.payload < mtime then |
| 11965 |
else |
| 11966 |
newauxstatus1 = newauxstatus |
| 11967 |
shouldRerun1 = false |
| 11968 |
goto cont2 |
| 11969 |
end |
| 11970 |
do |
| 11971 |
_L[304]("Input file '" .. shortPath .. "' was modified (by user, or some external commands).") |
| 11972 |
local tmp59 = _L[204](newauxstatus, abspath, {{md5sum = NONE, mtime = {tag = "SOME", payload = mtime}, size = NONE}}) |
| 11973 |
newauxstatus1 = tmp59 |
| 11974 |
shouldRerun1 = true |
| 11975 |
goto cont2 |
| 11976 |
end |
| 11977 |
end |
| 11978 |
end |
| 11979 |
::else1:: |
| 11980 |
if kind == "AUXILIARY" then |
| 11981 |
elseif kind == "OUTPUT" then |
| 11982 |
newauxstatus1 = newauxstatus |
| 11983 |
shouldRerun1 = false |
| 11984 |
goto cont2 |
| 11985 |
else |
| 11986 |
_raise(_Match, "reruncheck.sml:159:31") |
| 11987 |
end |
| 11988 |
do |
| 11989 |
local exp = _L[205](auxstatus, abspath) |
| 11990 |
if exp.tag == "SOME" then |
| 11991 |
else |
| 11992 |
goto else2 |
| 11993 |
end |
| 11994 |
do |
| 11995 |
local newauxstatus2, modifiedBecause |
| 11996 |
do |
| 11997 |
local s = exp.payload |
| 11998 |
local size1 = _L[67](abspath) |
| 11999 |
local exp1 = s.size |
| 12000 |
local sizeIsDifferent |
| 12001 |
if exp1.tag == "SOME" then |
| 12002 |
sizeIsDifferent = exp1.payload ~= size1 |
| 12003 |
elseif exp1.tag == "NONE" then |
| 12004 |
sizeIsDifferent = true |
| 12005 |
else |
| 12006 |
_raise(_Match, "reruncheck.sml:178:66") |
| 12007 |
end |
| 12008 |
do |
| 12009 |
if sizeIsDifferent then |
| 12010 |
else |
| 12011 |
goto else4 |
| 12012 |
end |
| 12013 |
do |
| 12014 |
local exp2 = s.size |
| 12015 |
local previousSize |
| 12016 |
if exp2.tag == "SOME" then |
| 12017 |
previousSize = tmp21(tmp5(exp2.payload), "-", "~") |
| 12018 |
elseif exp2.tag == "NONE" then |
| 12019 |
previousSize = "(N/A)" |
| 12020 |
else |
| 12021 |
_raise(_Match, "reruncheck.sml:183:77") |
| 12022 |
end |
| 12023 |
local tmp59 = "size: " .. previousSize .. " -> " |
| 12024 |
local tmp60 = {tag = "SOME", payload = tmp59 .. tmp21(tmp5(size1), "-", "~")} |
| 12025 |
local tmp61 = _L[204](newauxstatus, abspath, {{md5sum = NONE, mtime = NONE, size = {tag = "SOME", payload = size1}}}) |
| 12026 |
newauxstatus2 = tmp61 |
| 12027 |
modifiedBecause = tmp60 |
| 12028 |
goto cont3 |
| 12029 |
end |
| 12030 |
::else4:: |
| 12031 |
local md5sum |
| 12032 |
do |
| 12033 |
local ins = _L[151](abspath) |
| 12034 |
local tmp59 = _L[153](ins) |
| 12035 |
_L[152](ins) |
| 12036 |
md5sum = _L[191](tmp59) |
| 12037 |
end |
| 12038 |
local exp2 = s.md5sum |
| 12039 |
local md5sumIsDifferent |
| 12040 |
if exp2.tag == "SOME" then |
| 12041 |
local h = exp2.payload |
| 12042 |
local tmp59 = h[1] |
| 12043 |
local tmp60 = h[2] |
| 12044 |
local tmp61 = h[3] |
| 12045 |
local tmp62 = h[4] |
| 12046 |
local tmp63 = md5sum[1] |
| 12047 |
local tmp64 = md5sum[2] |
| 12048 |
local tmp65 = md5sum[3] |
| 12049 |
md5sumIsDifferent = tmp62 ~= md5sum[4] or (tmp61 ~= tmp65 or (tmp60 ~= tmp64 or tmp59 ~= tmp63)) |
| 12050 |
elseif exp2.tag == "NONE" then |
| 12051 |
md5sumIsDifferent = true |
| 12052 |
else |
| 12053 |
_raise(_Match, "reruncheck.sml:190:82") |
| 12054 |
end |
| 12055 |
if md5sumIsDifferent then |
| 12056 |
else |
| 12057 |
newauxstatus2 = newauxstatus |
| 12058 |
modifiedBecause = NONE |
| 12059 |
goto cont3 |
| 12060 |
end |
| 12061 |
do |
| 12062 |
local previousMd5sum |
| 12063 |
do |
| 12064 |
local exp3 = s.md5sum |
| 12065 |
do |
| 12066 |
if exp3.tag == "SOME" then |
| 12067 |
elseif exp3.tag == "NONE" then |
| 12068 |
previousMd5sum = "(N/A)" |
| 12069 |
goto cont4 |
| 12070 |
else |
| 12071 |
_raise(_Match, "reruncheck.sml:194:86") |
| 12072 |
end |
| 12073 |
do |
| 12074 |
local h = exp3.payload |
| 12075 |
local a = h[1] |
| 12076 |
local b = h[2] |
| 12077 |
local c = h[3] |
| 12078 |
previousMd5sum = _L[193](a, b, c, h[4]) |
| 12079 |
end |
| 12080 |
end |
| 12081 |
end |
| 12082 |
::cont4:: |
| 12083 |
local tmp59 = "md5: " .. previousMd5sum .. " -> " |
| 12084 |
local tmp60 |
| 12085 |
do |
| 12086 |
local a = md5sum[1] |
| 12087 |
local b = md5sum[2] |
| 12088 |
local c = md5sum[3] |
| 12089 |
tmp60 = _L[193](a, b, c, md5sum[4]) |
| 12090 |
end |
| 12091 |
local tmp61 = {tag = "SOME", payload = tmp59 .. tmp60} |
| 12092 |
local tmp62 = {tag = "SOME", payload = size1} |
| 12093 |
local tmp63 = _L[204](newauxstatus, abspath, {{md5sum = {tag = "SOME", payload = md5sum}, mtime = NONE, size = tmp62}}) |
| 12094 |
newauxstatus2 = tmp63 |
| 12095 |
modifiedBecause = tmp61 |
| 12096 |
end |
| 12097 |
end |
| 12098 |
end |
| 12099 |
::cont3:: |
| 12100 |
if modifiedBecause.tag == "SOME" then |
| 12101 |
else |
| 12102 |
goto else3 |
| 12103 |
end |
| 12104 |
do |
| 12105 |
local reason = modifiedBecause.payload |
| 12106 |
_L[304]("File '" .. shortPath .. "' was modified (" .. reason .. ").") |
| 12107 |
newauxstatus1 = newauxstatus2 |
| 12108 |
shouldRerun1 = true |
| 12109 |
goto cont2 |
| 12110 |
end |
| 12111 |
::else3:: |
| 12112 |
if modifiedBecause.tag == "NONE" then |
| 12113 |
else |
| 12114 |
_raise(_Match, "reruncheck.sml:202:43") |
| 12115 |
end |
| 12116 |
do |
| 12117 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 12118 |
else |
| 12119 |
newauxstatus1 = newauxstatus2 |
| 12120 |
shouldRerun1 = false |
| 12121 |
goto cont2 |
| 12122 |
end |
| 12123 |
_L[304]("File '" .. shortPath .. "' unmodified (size and md5sum).") |
| 12124 |
newauxstatus1 = newauxstatus2 |
| 12125 |
shouldRerun1 = false |
| 12126 |
goto cont2 |
| 12127 |
end |
| 12128 |
end |
| 12129 |
::else2:: |
| 12130 |
if exp.tag == "NONE" then |
| 12131 |
else |
| 12132 |
_raise(_Match, "reruncheck.sml:175:36") |
| 12133 |
end |
| 12134 |
do |
| 12135 |
local newauxstatus2, shouldRerun2 |
| 12136 |
do |
| 12137 |
local tmp59 = isSuffix(".aux") |
| 12138 |
local tmp60 = tmp59(abspath) |
| 12139 |
do |
| 12140 |
if tmp60 then |
| 12141 |
else |
| 12142 |
newauxstatus2 = newauxstatus |
| 12143 |
shouldRerun2 = true |
| 12144 |
goto cont3 |
| 12145 |
end |
| 12146 |
do |
| 12147 |
local size1 = _L[67](abspath) |
| 12148 |
if size1 == 8 then |
| 12149 |
else |
| 12150 |
goto else4 |
| 12151 |
end |
| 12152 |
do |
| 12153 |
local ins = _L[151](abspath) |
| 12154 |
local tmp61 = _L[153](ins) |
| 12155 |
_L[152](ins) |
| 12156 |
local tmp62 = tmp61 == "\\relax \n" |
| 12157 |
local tmp63 = {tag = "SOME", payload = size1} |
| 12158 |
local tmp64 = _L[191](tmp61) |
| 12159 |
local newauxstatus3 = _L[204](newauxstatus, abspath, {{md5sum = {tag = "SOME", payload = tmp64}, mtime = NONE, size = tmp63}}) |
| 12160 |
newauxstatus2 = newauxstatus3 |
| 12161 |
shouldRerun2 = not tmp62 |
| 12162 |
goto cont3 |
| 12163 |
end |
| 12164 |
::else4:: |
| 12165 |
local newauxstatus3 = _L[204](newauxstatus, abspath, {{md5sum = NONE, mtime = NONE, size = {tag = "SOME", payload = size1}}}) |
| 12166 |
newauxstatus2 = newauxstatus3 |
| 12167 |
shouldRerun2 = true |
| 12168 |
end |
| 12169 |
end |
| 12170 |
end |
| 12171 |
::cont3:: |
| 12172 |
if shouldRerun2 then |
| 12173 |
else |
| 12174 |
goto else3 |
| 12175 |
end |
| 12176 |
_L[304]("New auxiliary file '" .. shortPath .. "'.") |
| 12177 |
newauxstatus1 = newauxstatus2 |
| 12178 |
shouldRerun1 = shouldRerun2 |
| 12179 |
goto cont2 |
| 12180 |
::else3:: |
| 12181 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 12182 |
else |
| 12183 |
newauxstatus1 = newauxstatus2 |
| 12184 |
shouldRerun1 = shouldRerun2 |
| 12185 |
goto cont2 |
| 12186 |
end |
| 12187 |
_L[304]("Ignoring almost-empty auxiliary file '" .. shortPath .. "'.") |
| 12188 |
newauxstatus1 = newauxstatus2 |
| 12189 |
shouldRerun1 = shouldRerun2 |
| 12190 |
end |
| 12191 |
end |
| 12192 |
end |
| 12193 |
::cont2:: |
| 12194 |
if shouldRerun1 then |
| 12195 |
auxstatus1 = newauxstatus1 |
| 12196 |
shouldRerun = true |
| 12197 |
else |
| 12198 |
tmp54 = tmp57 |
| 12199 |
tmp55 = newauxstatus1 |
| 12200 |
goto cont1 |
| 12201 |
end |
| 12202 |
end |
| 12203 |
end |
| 12204 |
end |
| 12205 |
end |
| 12206 |
::cont:: |
| 12207 |
local tmp54 = _L[206](_EXCLAM) |
| 12208 |
local tmp55 = tmp54(auxstatus1) |
| 12209 |
return {shouldRerun, tmp55} |
| 12210 |
end |
| 12211 |
_L[362] = function(auxstatus, dst, srcAbs) |
| 12212 |
local tmp54 = _L[218](dst) |
| 12213 |
if not tmp54 then |
| 12214 |
return true |
| 12215 |
end |
| 12216 |
local exp = _L[205](auxstatus, srcAbs) |
| 12217 |
if exp.tag == "SOME" and exp.payload.mtime.tag == "SOME" then |
| 12218 |
else |
| 12219 |
return false |
| 12220 |
end |
| 12221 |
do |
| 12222 |
local mtime = exp.payload.mtime.payload |
| 12223 |
local tmp55 = _L[66](dst) |
| 12224 |
return mtime > tmp55 |
| 12225 |
end |
| 12226 |
end |
| 12227 |
_L[363] = {color = {diagnostic = NONE, error = NONE, execute = NONE, information = NONE, type_ = NONE, warning = NONE}, temporary_directory = NONE} |
| 12228 |
_L[364] = function(table, key) |
| 12229 |
local tmp54 = find(function(a) |
| 12230 |
return a[1] == key |
| 12231 |
end) |
| 12232 |
local exp = tmp54(table) |
| 12233 |
if exp.tag == "NONE" then |
| 12234 |
return NONE |
| 12235 |
elseif exp.tag == "SOME" then |
| 12236 |
return {tag = "SOME", payload = exp.payload[2]} |
| 12237 |
else |
| 12238 |
_raise(_Match, "config-file.sml:42:5") |
| 12239 |
end |
| 12240 |
end |
| 12241 |
_L[365] = function(tmp54, key) |
| 12242 |
if tmp54.tag == "SOME" then |
| 12243 |
elseif tmp54.tag == "NONE" then |
| 12244 |
return NONE |
| 12245 |
else |
| 12246 |
_raise(_Match, "config-file.sml:46:7") |
| 12247 |
end |
| 12248 |
do |
| 12249 |
local table = tmp54.payload |
| 12250 |
local tmp55 = find(function(a) |
| 12251 |
return a[1] == key |
| 12252 |
end) |
| 12253 |
local exp = tmp55(table) |
| 12254 |
if exp.tag == "NONE" then |
| 12255 |
return NONE |
| 12256 |
elseif exp.tag == "SOME" then |
| 12257 |
return {tag = "SOME", payload = exp.payload[2]} |
| 12258 |
else |
| 12259 |
_raise(_Match, "config-file.sml:47:10") |
| 12260 |
end |
| 12261 |
end |
| 12262 |
end |
| 12263 |
_L[366] = function(tmp54, f) |
| 12264 |
if tmp54.tag == "SOME" then |
| 12265 |
elseif tmp54.tag == "NONE" then |
| 12266 |
return NONE |
| 12267 |
else |
| 12268 |
_raise(_Match, "config-file.sml:54:7") |
| 12269 |
end |
| 12270 |
do |
| 12271 |
return f(tmp54.payload) |
| 12272 |
end |
| 12273 |
end |
| 12274 |
_L[367] = function(a) |
| 12275 |
return function(a1) |
| 12276 |
if a1.tag == "BOOL" then |
| 12277 |
return {tag = "SOME", payload = a1.payload} |
| 12278 |
end |
| 12279 |
_L[302]("Config entry " .. a .. " should be a boolean.") |
| 12280 |
return NONE |
| 12281 |
end |
| 12282 |
end |
| 12283 |
_L[368] = function(a) |
| 12284 |
return function(a1) |
| 12285 |
if a1.tag == "STRING" then |
| 12286 |
else |
| 12287 |
goto else1 |
| 12288 |
end |
| 12289 |
do |
| 12290 |
local x = a1.payload |
| 12291 |
local exp |
| 12292 |
if x == "default" then |
| 12293 |
exp = {tag = "SOME", payload = _L[255]} |
| 12294 |
elseif x == "black" then |
| 12295 |
exp = {tag = "SOME", payload = _L[256]} |
| 12296 |
elseif x == "red" then |
| 12297 |
exp = {tag = "SOME", payload = _L[257]} |
| 12298 |
elseif x == "green" then |
| 12299 |
exp = {tag = "SOME", payload = _L[258]} |
| 12300 |
elseif x == "yellow" then |
| 12301 |
exp = {tag = "SOME", payload = _L[259]} |
| 12302 |
elseif x == "blue" then |
| 12303 |
exp = {tag = "SOME", payload = _L[260]} |
| 12304 |
elseif x == "magenta" then |
| 12305 |
exp = {tag = "SOME", payload = _L[261]} |
| 12306 |
elseif x == "cyan" then |
| 12307 |
exp = {tag = "SOME", payload = _L[262]} |
| 12308 |
elseif x == "white" then |
| 12309 |
exp = {tag = "SOME", payload = _L[263]} |
| 12310 |
elseif x == "brightblack" then |
| 12311 |
exp = {tag = "SOME", payload = _L[264]} |
| 12312 |
elseif x == "brightred" then |
| 12313 |
exp = {tag = "SOME", payload = _L[265]} |
| 12314 |
elseif x == "brightgreen" then |
| 12315 |
exp = {tag = "SOME", payload = _L[266]} |
| 12316 |
elseif x == "brightyellow" then |
| 12317 |
exp = {tag = "SOME", payload = _L[267]} |
| 12318 |
elseif x == "brightblue" then |
| 12319 |
exp = {tag = "SOME", payload = _L[268]} |
| 12320 |
elseif x == "brightmagenta" then |
| 12321 |
exp = {tag = "SOME", payload = _L[269]} |
| 12322 |
elseif x == "brightcyan" then |
| 12323 |
exp = {tag = "SOME", payload = _L[270]} |
| 12324 |
elseif x == "brightwhite" then |
| 12325 |
exp = {tag = "SOME", payload = _L[271]} |
| 12326 |
else |
| 12327 |
exp = NONE |
| 12328 |
end |
| 12329 |
if exp.tag == "SOME" then |
| 12330 |
return {tag = "SOME", payload = exp.payload} |
| 12331 |
end |
| 12332 |
if exp.tag == "NONE" then |
| 12333 |
else |
| 12334 |
_raise(_Match, "config-file.sml:76:10") |
| 12335 |
end |
| 12336 |
do |
| 12337 |
_L[302]("Config entry " .. a .. " should be a valid color.") |
| 12338 |
return NONE |
| 12339 |
end |
| 12340 |
end |
| 12341 |
::else1:: |
| 12342 |
_L[302]("Config entry " .. a .. " should be a string.") |
| 12343 |
return NONE |
| 12344 |
end |
| 12345 |
end |
| 12346 |
_L[369] = function(a) |
| 12347 |
return function(a1) |
| 12348 |
if a1.tag == "TABLE" then |
| 12349 |
else |
| 12350 |
goto else1 |
| 12351 |
end |
| 12352 |
do |
| 12353 |
local t, tmp54, tmp55, tmp56, tmp57 |
| 12354 |
do |
| 12355 |
t = a1.payload |
| 12356 |
local tmp58 = _L[364](t, "fore") |
| 12357 |
local tmp59 = _L[368](a .. ".fore") |
| 12358 |
tmp54 = _L[366](tmp58, tmp59) |
| 12359 |
local tmp60 = _L[364](t, "back") |
| 12360 |
local tmp61 = _L[368](a .. ".back") |
| 12361 |
tmp55 = _L[366](tmp60, tmp61) |
| 12362 |
local tmp62 = _L[364](t, "bold") |
| 12363 |
local tmp63 = _L[367](a .. ".bold") |
| 12364 |
local tmp64 = _L[366](tmp62, tmp63) |
| 12365 |
tmp56 = getOpt(tmp64, false) |
| 12366 |
local tmp65 = _L[364](t, "dim") |
| 12367 |
local tmp66 = _L[367](a .. ".dim") |
| 12368 |
local tmp67 = _L[366](tmp65, tmp66) |
| 12369 |
tmp57 = getOpt(tmp67, false) |
| 12370 |
end |
| 12371 |
local tmp58, tmp59, tmp60, tmp61 |
| 12372 |
do |
| 12373 |
local tmp62 = _L[364](t, "underline") |
| 12374 |
local tmp63 = _L[367](a .. ".underline") |
| 12375 |
local tmp64 = _L[366](tmp62, tmp63) |
| 12376 |
tmp58 = getOpt(tmp64, false) |
| 12377 |
local tmp65 = _L[364](t, "blink") |
| 12378 |
local tmp66 = _L[367](a .. ".blink") |
| 12379 |
local tmp67 = _L[366](tmp65, tmp66) |
| 12380 |
tmp59 = getOpt(tmp67, false) |
| 12381 |
local tmp68 = _L[364](t, "reverse") |
| 12382 |
local tmp69 = _L[367](a .. ".reverse") |
| 12383 |
local tmp70 = _L[366](tmp68, tmp69) |
| 12384 |
tmp60 = getOpt(tmp70, false) |
| 12385 |
local tmp71 = _L[364](t, "italic") |
| 12386 |
local tmp72 = _L[367](a .. ".italic") |
| 12387 |
tmp61 = _L[366](tmp71, tmp72) |
| 12388 |
end |
| 12389 |
local tmp62 = getOpt(tmp61, false) |
| 12390 |
local tmp63 = _L[364](t, "strike") |
| 12391 |
local tmp64 = _L[367](a .. ".strike") |
| 12392 |
local tmp65 = _L[366](tmp63, tmp64) |
| 12393 |
local tmp66 = getOpt(tmp65, false) |
| 12394 |
return {tag = "SOME", payload = {background = tmp55, blink = tmp59, bold = tmp56, dim = tmp57, foreground = tmp54, italic = tmp62, reverse = tmp60, strike = tmp66, underline = tmp58}} |
| 12395 |
end |
| 12396 |
::else1:: |
| 12397 |
_L[302]("Config entry " .. a .. " should be a table.") |
| 12398 |
return NONE |
| 12399 |
end |
| 12400 |
end |
| 12401 |
_L[370] = {"Abort"} |
| 12402 |
_L[371] = {tag = _L[370]} |
| 12403 |
tmp17("", "ctype") |
| 12404 |
_L[372] = function(a) |
| 12405 |
local tmp54 = a |
| 12406 |
::cont:: |
| 12407 |
do |
| 12408 |
local a1 = tmp54 |
| 12409 |
if a1 == nil then |
| 12410 |
return NONE |
| 12411 |
end |
| 12412 |
if a1 ~= nil then |
| 12413 |
local tmp55 = a1[1] |
| 12414 |
local tmp56 = a1[2] |
| 12415 |
local exp |
| 12416 |
do |
| 12417 |
local tmp57 = tmp16(tmp55) |
| 12418 |
if tmp57 == nil then |
| 12419 |
exp = NONE |
| 12420 |
else |
| 12421 |
exp = {tag = "SOME", payload = tmp57} |
| 12422 |
end |
| 12423 |
end |
| 12424 |
if exp.tag == "SOME" then |
| 12425 |
return {tag = "SOME", payload = exp.payload} |
| 12426 |
elseif exp.tag == "NONE" then |
| 12427 |
tmp54 = tmp56 |
| 12428 |
goto cont |
| 12429 |
else |
| 12430 |
_raise(_Match, "main.sml:27:32") |
| 12431 |
end |
| 12432 |
else |
| 12433 |
_raise(_Match, "main.sml:26:5") |
| 12434 |
end |
| 12435 |
end |
| 12436 |
end |
| 12437 |
_L[373] = function() |
| 12438 |
local progName |
| 12439 |
do |
| 12440 |
local tmp54 = _L[154][0] |
| 12441 |
if tmp54 == nil then |
| 12442 |
else |
| 12443 |
progName = tmp54 |
| 12444 |
goto cont |
| 12445 |
end |
| 12446 |
do |
| 12447 |
local tmp55 = _Fail("CommandLine.name: arg is not available") |
| 12448 |
_raise(tmp55, "command-line.sml:10:45") |
| 12449 |
end |
| 12450 |
end |
| 12451 |
::cont:: |
| 12452 |
_L[124]({_L[118], "ClutTeX: Process TeX files without cluttering your working directory\n\nUsage:\n " .. progName .. " [options] [--] FILE.tex\n\nOptions:\n -e, --engine=ENGINE Specify which TeX engine to use.\n ENGINE is one of the following:\n pdflatex, pdftex,\n lualatex, luatex, luajittex,\n xelatex, xetex, latex, etex, tex,\n platex, eptex, ptex,\n uplatex, euptex, uptex,\n --engine-executable=COMMAND+OPTIONs\n The actual TeX command to use.\n [default: ENGINE]\n -o, --output=FILE The name of output file.\n [default: JOBNAME.pdf or JOBNAME.dvi]\n --fresh Clean intermediate files before running TeX.\n Cannot be used with --output-directory.\n --max-iterations=N Maximum number of running TeX to resolve\n cross-references. [default: 3]\n --start-with-draft Start with draft mode.\n --[no-]change-directory Change directory before running TeX.\n --watch[=ENGINE] Watch input files for change. Requires fswatch\n or inotifywait to be installed. ENGINE is one of\n `fswatch', `inotifywait' or `auto' [default: `auto']\n --tex-option=OPTION Pass OPTION to TeX as a single option.\n --tex-options=OPTIONs Pass OPTIONs to TeX as multiple options.\n --dvipdfmx-option[s]=OPTION[s] Same for dvipdfmx.\n --makeindex=COMMAND+OPTIONs Command to generate index, such as\n `makeindex' or `mendex'.\n --bibtex=COMMAND+OPTIONs Command for BibTeX, such as\n `bibtex' or `pbibtex'.\n --biber[=COMMAND+OPTIONs] Command for Biber.\n --makeglossaries[=COMMAND+OPTIONs] Command for makeglossaries.\n -h, --help Print this message and exit.\n -v, --version Print version information and exit.\n -V, --verbose Be more verbose.\n --color[=WHEN] Make ClutTeX's message colorful. WHEN is one of\n `always', `auto', or `never'.\n [default: `auto' if --color is omitted,\n `always' if WHEN is omitted]\n --includeonly=NAMEs Insert '\\includeonly{NAMEs}'.\n --make-depends=FILE Write dependencies as a Makefile rule.\n --print-output-directory Print the output directory and exit.\n --package-support=PKG1[,PKG2,...]\n Enable special support for some shell-escaping\n packages.\n Currently supported: minted, epstopdf\n --check-driver=DRIVER Check that the correct driver file is loaded.\n DRIVER is one of `dvipdfmx', `dvips', `dvisvgm'.\n --source-date-epoch=TIME\n Set SOURCE_DATE_EPOCH variable.\n TIME is `now' or an integer.\n\n --[no-]shell-escape\n --shell-restricted\n --synctex=NUMBER\n --fmt=FMTNAME\n --[no-]file-line-error [default: yes]\n --[no-]halt-on-error [default: yes]\n --interaction=STRING [default: nonstopmode]\n --jobname=STRING\n --output-directory=DIR [default: somewhere in the temporary directory]\n --output-format=FORMAT FORMAT is `pdf' or `dvi'. [default: pdf]\n\n" .. "Copyright (C) 2016-2024 ARATA Mizuki\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <http://www.gnu.org/licenses/>.\n"}) |
| 12453 |
tmp15(0, true) |
| 12454 |
end |
| 12455 |
_L[374] = function(payload) |
| 12456 |
return {tag = "OPT_ENGINE", payload = payload} |
| 12457 |
end |
| 12458 |
_L[375] = function(payload) |
| 12459 |
return {tag = "OPT_ENGINE_EXECUTABLE", payload = payload} |
| 12460 |
end |
| 12461 |
_L[376] = function(payload) |
| 12462 |
return {tag = "OPT_OUTPUT", payload = payload} |
| 12463 |
end |
| 12464 |
_L[377] = {tag = "OPT_FRESH"} |
| 12465 |
_L[378] = function(payload) |
| 12466 |
return {tag = "OPT_MAX_ITERATIONS", payload = payload} |
| 12467 |
end |
| 12468 |
_L[379] = {tag = "OPT_START_WITH_DRAFT"} |
| 12469 |
_L[380] = function(payload) |
| 12470 |
return {tag = "OPT_WATCH", payload = payload} |
| 12471 |
end |
| 12472 |
_L[381] = {tag = "OPT_HELP"} |
| 12473 |
_L[382] = {tag = "OPT_VERSION"} |
| 12474 |
_L[383] = {tag = "OPT_VERBOSE"} |
| 12475 |
_L[384] = function(payload) |
| 12476 |
return {tag = "OPT_COLOR", payload = payload} |
| 12477 |
end |
| 12478 |
_L[385] = function(payload) |
| 12479 |
return {tag = "OPT_INCLUDEONLY", payload = payload} |
| 12480 |
end |
| 12481 |
_L[386] = function(payload) |
| 12482 |
return {tag = "OPT_MAKE_DEPENDS", payload = payload} |
| 12483 |
end |
| 12484 |
_L[387] = {tag = "OPT_PRINT_OUTPUT_DIRECTORY"} |
| 12485 |
_L[388] = function(payload) |
| 12486 |
return {tag = "OPT_PACKAGE_SUPPORT", payload = payload} |
| 12487 |
end |
| 12488 |
_L[389] = function(payload) |
| 12489 |
return {tag = "OPT_CHECK_DRIVER", payload = payload} |
| 12490 |
end |
| 12491 |
_L[390] = function(payload) |
| 12492 |
return {tag = "OPT_SOURCE_DATE_EPOCH", payload = payload} |
| 12493 |
end |
| 12494 |
_L[391] = function(payload) |
| 12495 |
return {tag = "OPT_SYNCTEX", payload = payload} |
| 12496 |
end |
| 12497 |
_L[392] = function(payload) |
| 12498 |
return {tag = "OPT_INTERACTION", payload = payload} |
| 12499 |
end |
| 12500 |
_L[393] = function(payload) |
| 12501 |
return {tag = "OPT_JOBNAME", payload = payload} |
| 12502 |
end |
| 12503 |
_L[394] = function(payload) |
| 12504 |
return {tag = "OPT_FMT", payload = payload} |
| 12505 |
end |
| 12506 |
_L[395] = function(payload) |
| 12507 |
return {tag = "OPT_OUTPUT_DIRECTORY", payload = payload} |
| 12508 |
end |
| 12509 |
_L[396] = function(payload) |
| 12510 |
return {tag = "OPT_OUTPUT_FORMAT", payload = payload} |
| 12511 |
end |
| 12512 |
_L[397] = function(payload) |
| 12513 |
return {tag = "OPT_TEX_OPTION", payload = payload} |
| 12514 |
end |
| 12515 |
_L[398] = function(payload) |
| 12516 |
return {tag = "OPT_TEX_OPTIONS", payload = payload} |
| 12517 |
end |
| 12518 |
_L[399] = function(payload) |
| 12519 |
return {tag = "OPT_DVIPDFMX_OPTION", payload = payload} |
| 12520 |
end |
| 12521 |
_L[400] = function(payload) |
| 12522 |
return {tag = "OPT_DVIPDFMX_OPTIONS", payload = payload} |
| 12523 |
end |
| 12524 |
_L[401] = function(payload) |
| 12525 |
return {tag = "OPT_MAKEINDEX", payload = payload} |
| 12526 |
end |
| 12527 |
_L[402] = function(payload) |
| 12528 |
return {tag = "OPT_BIBTEX", payload = payload} |
| 12529 |
end |
| 12530 |
_L[403] = function(payload) |
| 12531 |
return {tag = "OPT_BIBER", payload = payload} |
| 12532 |
end |
| 12533 |
_L[404] = function(payload) |
| 12534 |
return {tag = "OPT_MAKEGLOSSARIES", payload = payload} |
| 12535 |
end |
| 12536 |
_L[405] = function(payload) |
| 12537 |
return {tag = "OPT_CONFIG_FILE", payload = payload} |
| 12538 |
end |
| 12539 |
_L[406] = {tag = "SHORT", payload = "-e"} |
| 12540 |
_L[407] = {_L[406], {tag = "WITH_ARG", payload = _L[374]}} |
| 12541 |
_L[408] = {tag = "LONG", payload = "--engine"} |
| 12542 |
_L[409] = {_L[408], {tag = "WITH_ARG", payload = _L[374]}} |
| 12543 |
_L[410] = {tag = "LONG", payload = "--engine-executable"} |
| 12544 |
_L[411] = {_L[410], {tag = "WITH_ARG", payload = _L[375]}} |
| 12545 |
_L[412] = {tag = "SHORT", payload = "-o"} |
| 12546 |
_L[413] = {_L[412], {tag = "WITH_ARG", payload = _L[376]}} |
| 12547 |
_L[414] = {tag = "LONG", payload = "--output"} |
| 12548 |
_L[415] = {_L[414], {tag = "WITH_ARG", payload = _L[376]}} |
| 12549 |
_L[416] = {tag = "LONG", payload = "--fresh"} |
| 12550 |
_L[417] = {_L[416], {tag = "SIMPLE", payload = _L[377]}} |
| 12551 |
_L[418] = {tag = "LONG", payload = "--max-iterations"} |
| 12552 |
_L[419] = {_L[418], {tag = "WITH_ARG", payload = _L[378]}} |
| 12553 |
_L[420] = {tag = "LONG", payload = "--start-with-draft"} |
| 12554 |
_L[421] = {_L[420], {tag = "SIMPLE", payload = _L[379]}} |
| 12555 |
_L[422] = {tag = "LONG", payload = "--change-directory"} |
| 12556 |
_L[423] = {_L[422], {tag = "SIMPLE", payload = {tag = "OPT_CHANGE_DIRECTORY", payload = true}}} |
| 12557 |
_L[424] = {tag = "LONG", payload = "--no-change-directory"} |
| 12558 |
_L[425] = {_L[424], {tag = "SIMPLE", payload = {tag = "OPT_CHANGE_DIRECTORY", payload = false}}} |
| 12559 |
_L[426] = {tag = "LONG", payload = "--watch"} |
| 12560 |
_L[427] = {_L[426], {tag = "WITH_OPTIONAL_ARG", payload = {action = _L[380], default = "auto"}}} |
| 12561 |
_L[428] = {tag = "SHORT", payload = "-h"} |
| 12562 |
_L[429] = {_L[428], {tag = "SIMPLE", payload = _L[381]}} |
| 12563 |
_L[430] = {tag = "LONG", payload = "-help"} |
| 12564 |
_L[431] = {_L[430], {tag = "SIMPLE", payload = _L[381]}} |
| 12565 |
_L[432] = {tag = "LONG", payload = "--help"} |
| 12566 |
_L[433] = {_L[432], {tag = "SIMPLE", payload = _L[381]}} |
| 12567 |
_L[434] = {tag = "SHORT", payload = "-v"} |
| 12568 |
_L[435] = {_L[434], {tag = "SIMPLE", payload = _L[382]}} |
| 12569 |
_L[436] = {tag = "LONG", payload = "--version"} |
| 12570 |
_L[437] = {_L[436], {tag = "SIMPLE", payload = _L[382]}} |
| 12571 |
_L[438] = {tag = "SHORT", payload = "-V"} |
| 12572 |
_L[439] = {_L[438], {tag = "SIMPLE", payload = _L[383]}} |
| 12573 |
_L[440] = {tag = "LONG", payload = "--verbose"} |
| 12574 |
_L[441] = {_L[440], {tag = "SIMPLE", payload = _L[383]}} |
| 12575 |
_L[442] = {tag = "LONG", payload = "--color"} |
| 12576 |
_L[443] = {_L[442], {tag = "WITH_OPTIONAL_ARG", payload = {action = _L[384], default = "always"}}} |
| 12577 |
_L[444] = {tag = "LONG", payload = "--includeonly"} |
| 12578 |
_L[445] = {_L[444], {tag = "WITH_ARG", payload = _L[385]}} |
| 12579 |
_L[446] = {tag = "LONG", payload = "--make-depends"} |
| 12580 |
_L[447] = {_L[446], {tag = "WITH_ARG", payload = _L[386]}} |
| 12581 |
_L[448] = {tag = "LONG", payload = "--print-output-directory"} |
| 12582 |
_L[449] = {_L[448], {tag = "SIMPLE", payload = _L[387]}} |
| 12583 |
_L[450] = {tag = "LONG", payload = "--package-support"} |
| 12584 |
_L[451] = {_L[450], {tag = "WITH_ARG", payload = _L[388]}} |
| 12585 |
_L[452] = {tag = "LONG", payload = "--check-driver"} |
| 12586 |
_L[453] = {_L[452], {tag = "WITH_ARG", payload = _L[389]}} |
| 12587 |
_L[454] = {tag = "LONG", payload = "--source-date-epoch"} |
| 12588 |
_L[455] = {_L[454], {tag = "WITH_ARG", payload = _L[390]}} |
| 12589 |
_L[456] = {tag = "LONG", payload = "-synctex"} |
| 12590 |
_L[457] = {_L[456], {tag = "WITH_ARG", payload = _L[391]}} |
| 12591 |
_L[458] = {tag = "LONG", payload = "--synctex"} |
| 12592 |
_L[459] = {_L[458], {tag = "WITH_ARG", payload = _L[391]}} |
| 12593 |
_L[460] = {tag = "LONG", payload = "-file-line-error"} |
| 12594 |
_L[461] = {_L[460], {tag = "SIMPLE", payload = {tag = "OPT_FILE_LINE_ERROR", payload = true}}} |
| 12595 |
_L[462] = {tag = "LONG", payload = "--file-line-error"} |
| 12596 |
_L[463] = {_L[462], {tag = "SIMPLE", payload = {tag = "OPT_FILE_LINE_ERROR", payload = true}}} |
| 12597 |
_L[464] = {tag = "LONG", payload = "-no-file-line-error"} |
| 12598 |
_L[465] = {_L[464], {tag = "SIMPLE", payload = {tag = "OPT_FILE_LINE_ERROR", payload = false}}} |
| 12599 |
_L[466] = {tag = "LONG", payload = "--no-file-line-error"} |
| 12600 |
_L[467] = {_L[466], {tag = "SIMPLE", payload = {tag = "OPT_FILE_LINE_ERROR", payload = false}}} |
| 12601 |
_L[468] = {tag = "LONG", payload = "-interaction"} |
| 12602 |
_L[469] = {_L[468], {tag = "WITH_ARG", payload = _L[392]}} |
| 12603 |
_L[470] = {tag = "LONG", payload = "--interaction"} |
| 12604 |
_L[471] = {_L[470], {tag = "WITH_ARG", payload = _L[392]}} |
| 12605 |
_L[472] = {tag = "LONG", payload = "-halt-on-error"} |
| 12606 |
_L[473] = {_L[472], {tag = "SIMPLE", payload = {tag = "OPT_HALT_ON_ERROR", payload = true}}} |
| 12607 |
_L[474] = {tag = "LONG", payload = "--halt-on-error"} |
| 12608 |
_L[475] = {_L[474], {tag = "SIMPLE", payload = {tag = "OPT_HALT_ON_ERROR", payload = true}}} |
| 12609 |
_L[476] = {tag = "LONG", payload = "-no-halt-on-error"} |
| 12610 |
_L[477] = {_L[476], {tag = "SIMPLE", payload = {tag = "OPT_HALT_ON_ERROR", payload = false}}} |
| 12611 |
_L[478] = {tag = "LONG", payload = "--no-halt-on-error"} |
| 12612 |
_L[479] = {_L[478], {tag = "SIMPLE", payload = {tag = "OPT_HALT_ON_ERROR", payload = false}}} |
| 12613 |
_L[480] = {tag = "LONG", payload = "-shell-escape"} |
| 12614 |
_L[481] = {_L[480], {tag = "SIMPLE", payload = {tag = "OPT_SHELL_ESCAPE", payload = _L[226]}}} |
| 12615 |
_L[482] = {tag = "LONG", payload = "--shell-escape"} |
| 12616 |
_L[483] = {_L[482], {tag = "SIMPLE", payload = {tag = "OPT_SHELL_ESCAPE", payload = _L[226]}}} |
| 12617 |
_L[484] = {tag = "LONG", payload = "-no-shell-escape"} |
| 12618 |
_L[485] = {_L[484], {tag = "SIMPLE", payload = {tag = "OPT_SHELL_ESCAPE", payload = _L[228]}}} |
| 12619 |
_L[486] = {tag = "LONG", payload = "--no-shell-escape"} |
| 12620 |
_L[487] = {_L[486], {tag = "SIMPLE", payload = {tag = "OPT_SHELL_ESCAPE", payload = _L[228]}}} |
| 12621 |
_L[488] = {tag = "LONG", payload = "-shell-restricted"} |
| 12622 |
_L[489] = {_L[488], {tag = "SIMPLE", payload = {tag = "OPT_SHELL_ESCAPE", payload = _L[227]}}} |
| 12623 |
_L[490] = {tag = "LONG", payload = "--shell-restricted"} |
| 12624 |
_L[491] = {_L[490], {tag = "SIMPLE", payload = {tag = "OPT_SHELL_ESCAPE", payload = _L[227]}}} |
| 12625 |
_L[492] = {tag = "LONG", payload = "-jobname"} |
| 12626 |
_L[493] = {_L[492], {tag = "WITH_ARG", payload = _L[393]}} |
| 12627 |
_L[494] = {tag = "LONG", payload = "--jobname"} |
| 12628 |
_L[495] = {_L[494], {tag = "WITH_ARG", payload = _L[393]}} |
| 12629 |
_L[496] = {tag = "LONG", payload = "-fmt"} |
| 12630 |
_L[497] = {_L[496], {tag = "WITH_ARG", payload = _L[394]}} |
| 12631 |
_L[498] = {tag = "LONG", payload = "--fmt"} |
| 12632 |
_L[499] = {_L[498], {tag = "WITH_ARG", payload = _L[394]}} |
| 12633 |
_L[500] = {tag = "LONG", payload = "-output-directory"} |
| 12634 |
_L[501] = {_L[500], {tag = "WITH_ARG", payload = _L[395]}} |
| 12635 |
_L[502] = {tag = "LONG", payload = "--output-directory"} |
| 12636 |
_L[503] = {_L[502], {tag = "WITH_ARG", payload = _L[395]}} |
| 12637 |
_L[504] = {tag = "LONG", payload = "-output-format"} |
| 12638 |
_L[505] = {_L[504], {tag = "WITH_ARG", payload = _L[396]}} |
| 12639 |
_L[506] = {tag = "LONG", payload = "--output-format"} |
| 12640 |
_L[507] = {_L[506], {tag = "WITH_ARG", payload = _L[396]}} |
| 12641 |
_L[508] = {tag = "LONG", payload = "--tex-option"} |
| 12642 |
_L[509] = {_L[508], {tag = "WITH_ARG", payload = _L[397]}} |
| 12643 |
_L[510] = {tag = "LONG", payload = "--tex-options"} |
| 12644 |
_L[511] = {_L[510], {tag = "WITH_ARG", payload = _L[398]}} |
| 12645 |
_L[512] = {tag = "LONG", payload = "--dvipdfmx-option"} |
| 12646 |
_L[513] = {_L[512], {tag = "WITH_ARG", payload = _L[399]}} |
| 12647 |
_L[514] = {tag = "LONG", payload = "--dvipdfmx-options"} |
| 12648 |
_L[515] = {_L[514], {tag = "WITH_ARG", payload = _L[400]}} |
| 12649 |
_L[516] = {tag = "LONG", payload = "--makeindex"} |
| 12650 |
_L[517] = {_L[516], {tag = "WITH_ARG", payload = _L[401]}} |
| 12651 |
_L[518] = {tag = "LONG", payload = "--bibtex"} |
| 12652 |
_L[519] = {_L[518], {tag = "WITH_ARG", payload = _L[402]}} |
| 12653 |
_L[520] = {tag = "LONG", payload = "--biber"} |
| 12654 |
_L[521] = {_L[520], {tag = "WITH_OPTIONAL_ARG", payload = {action = _L[403], default = "biber"}}} |
| 12655 |
_L[522] = {tag = "LONG", payload = "--makeglossaries"} |
| 12656 |
_L[523] = {_L[522], {tag = "WITH_OPTIONAL_ARG", payload = {action = _L[404], default = "makeglossaries"}}} |
| 12657 |
_L[524] = {tag = "LONG", payload = "--config-file"} |
| 12658 |
_L[525] = _list({n = 60, _L[407], _L[409], _L[411], _L[413], _L[415], _L[417], _L[419], _L[421], _L[423], _L[425], _L[427], _L[429], _L[431], _L[433], _L[435], _L[437], _L[439], _L[441], _L[443], _L[445], _L[447], _L[449], _L[451], _L[453], _L[455], _L[457], _L[459], _L[461], _L[463], _L[465], _L[467], _L[469], _L[471], _L[473], _L[475], _L[477], _L[479], _L[481], _L[483], _L[485], _L[487], _L[489], _L[491], _L[493], _L[495], _L[497], _L[499], _L[501], _L[503], _L[505], _L[507], _L[509], _L[511], _L[513], _L[515], _L[517], _L[519], _L[521], _L[523], {_L[524], {tag = "WITH_ARG", payload = _L[405]}}}) |
| 12659 |
_L[526] = function(command, recover) |
| 12660 |
local status_or_signal, termination, success_or_recovered |
| 12661 |
do |
| 12662 |
_L[300](command) |
| 12663 |
local tmp54, tmp55, tmp56 = tmp14(command) |
| 12664 |
local success |
| 12665 |
if tmp6(tmp54) == "number" then |
| 12666 |
status_or_signal = tmp54 |
| 12667 |
termination = NONE |
| 12668 |
success = tmp54 == 0 |
| 12669 |
else |
| 12670 |
status_or_signal = tmp56 |
| 12671 |
termination = {tag = "SOME", payload = tmp55} |
| 12672 |
success = tmp54 |
| 12673 |
end |
| 12674 |
if success then |
| 12675 |
success_or_recovered = true |
| 12676 |
else |
| 12677 |
if recover.tag == "SOME" then |
| 12678 |
elseif recover.tag == "NONE" then |
| 12679 |
success_or_recovered = false |
| 12680 |
goto cont |
| 12681 |
else |
| 12682 |
_raise(_Match, "main.sml:150:54") |
| 12683 |
end |
| 12684 |
success_or_recovered = recover.payload(nil) |
| 12685 |
end |
| 12686 |
end |
| 12687 |
::cont:: |
| 12688 |
if success_or_recovered then |
| 12689 |
return nil |
| 12690 |
end |
| 12691 |
if termination.tag == "SOME" and termination.payload == "exit" then |
| 12692 |
else |
| 12693 |
goto else1 |
| 12694 |
end |
| 12695 |
_L[301]("Command exited abnormally: exit status " .. tmp5(status_or_signal)) |
| 12696 |
_raise(_L[371], "main.sml:161:16") |
| 12697 |
::else1:: |
| 12698 |
if termination.tag == "SOME" and termination.payload == "signal" then |
| 12699 |
else |
| 12700 |
goto else2 |
| 12701 |
end |
| 12702 |
_L[301]("Command exited abnormally: signal " .. tmp5(status_or_signal)) |
| 12703 |
_raise(_L[371], "main.sml:161:16") |
| 12704 |
::else2:: |
| 12705 |
_L[301]("Command exited abnormally: " .. tmp5(status_or_signal)) |
| 12706 |
_raise(_L[371], "main.sml:161:16") |
| 12707 |
end |
| 12708 |
_L[527] = {tag = "NO_NEED_TO_RERUN"} |
| 12709 |
_L[528] = {tag = "NO_PAGES_OF_OUTPUT"} |
| 12710 |
_L[529] = function(engine_type, tmp54, tmp55, tmp56, inputfile, exp, exp1, tmp57, exp2, tmp58, exp3, exp4, tmp59, tmp60, tmp61, tmp62, tmp63, tmp64, tmp65, tmp66, tmp67, exp5, tmp68, tmp69, original_wd, output_extension, recorderfile, recorderfile2, source_date_epoch_info, tmp70, tmp71, tmp72, tmp73, tmp74, tmp75, tmp76, tmp77, tmp78, tmp79, tmp80, tmp81, tmp82) |
| 12711 |
local tmp83 |
| 12712 |
do |
| 12713 |
local tmp84, tmp85 = 0, _L[203] |
| 12714 |
::cont1:: |
| 12715 |
do |
| 12716 |
local tmp86, exp6 |
| 12717 |
do |
| 12718 |
local iteration, auxstatus = tmp84, tmp85 |
| 12719 |
tmp86 = _Int_add(iteration, 1) |
| 12720 |
do |
| 12721 |
local tmp87, pdfx, minted, filelist, epstopdf, bibtex_aux_hash, auxstatus1 |
| 12722 |
do |
| 12723 |
local tmp88 = tmp58 .. "." .. "aux" |
| 12724 |
tmp87 = _L[210].join(tmp62, tmp88) |
| 12725 |
local tmp89 = _L[218](recorderfile) |
| 12726 |
do |
| 12727 |
if tmp89 then |
| 12728 |
else |
| 12729 |
goto else2 |
| 12730 |
end |
| 12731 |
do |
| 12732 |
local recorded, tmp90 |
| 12733 |
do |
| 12734 |
recorded = _L[360](recorderfile, tmp59, nil, _L[203]) |
| 12735 |
local tmp91 = _L[237](engine_type, _L[235]) |
| 12736 |
do |
| 12737 |
if tmp91 then |
| 12738 |
else |
| 12739 |
tmp90 = false |
| 12740 |
goto cont13 |
| 12741 |
end |
| 12742 |
tmp90 = _L[218](recorderfile2) |
| 12743 |
end |
| 12744 |
end |
| 12745 |
::cont13:: |
| 12746 |
local recorded1 |
| 12747 |
do |
| 12748 |
if tmp90 then |
| 12749 |
else |
| 12750 |
recorded1 = recorded |
| 12751 |
goto cont14 |
| 12752 |
end |
| 12753 |
do |
| 12754 |
local fileList = recorded[1] |
| 12755 |
recorded1 = _L[360](recorderfile2, tmp59, fileList, recorded[2]) |
| 12756 |
end |
| 12757 |
end |
| 12758 |
::cont14:: |
| 12759 |
local filelist1, auxstatus2, minted1, epstopdf1, pdfx1, bibtex_aux_hash1 |
| 12760 |
do |
| 12761 |
local exp7 |
| 12762 |
do |
| 12763 |
local fileInfo = recorded1[1] |
| 12764 |
exp7 = _L[359](fileInfo, recorded1[2]) |
| 12765 |
end |
| 12766 |
filelist1 = exp7[1] |
| 12767 |
do |
| 12768 |
local go = function(a) |
| 12769 |
local abspath = a[1].abspath |
| 12770 |
local kind = a[1].kind |
| 12771 |
local auxstatus3 = a[2] |
| 12772 |
local tmp91 = _L[218](abspath) |
| 12773 |
if tmp91 then |
| 12774 |
else |
| 12775 |
return auxstatus3 |
| 12776 |
end |
| 12777 |
do |
| 12778 |
local auxstatus4, status |
| 12779 |
do |
| 12780 |
local exp8 = _L[205](auxstatus3, abspath) |
| 12781 |
do |
| 12782 |
if exp8.tag == "NONE" then |
| 12783 |
elseif exp8.tag == "SOME" then |
| 12784 |
auxstatus4 = auxstatus3 |
| 12785 |
status = exp8.payload |
| 12786 |
goto cont |
| 12787 |
else |
| 12788 |
_raise(_Match, "reruncheck.sml:124:51") |
| 12789 |
end |
| 12790 |
do |
| 12791 |
local tmp92 = {{md5sum = NONE, mtime = NONE, size = NONE}} |
| 12792 |
local tmp93 = _L[204](auxstatus3, abspath, tmp92) |
| 12793 |
auxstatus4 = tmp93 |
| 12794 |
status = tmp92 |
| 12795 |
end |
| 12796 |
end |
| 12797 |
end |
| 12798 |
::cont:: |
| 12799 |
if kind == "INPUT" then |
| 12800 |
else |
| 12801 |
goto else1 |
| 12802 |
end |
| 12803 |
do |
| 12804 |
if status[1].mtime.tag == "NONE" then |
| 12805 |
else |
| 12806 |
return auxstatus4 |
| 12807 |
end |
| 12808 |
do |
| 12809 |
local s = status[1] |
| 12810 |
local tmp92 = s.md5sum |
| 12811 |
local tmp93 = s.size |
| 12812 |
local tmp94 = _L[66](abspath) |
| 12813 |
status[1] = {md5sum = tmp92, mtime = {tag = "SOME", payload = tmp94}, size = tmp93} |
| 12814 |
return auxstatus4 |
| 12815 |
end |
| 12816 |
end |
| 12817 |
::else1:: |
| 12818 |
if kind == "AUXILIARY" then |
| 12819 |
elseif kind == "OUTPUT" then |
| 12820 |
return auxstatus4 |
| 12821 |
else |
| 12822 |
_raise(_Match, "reruncheck.sml:129:24") |
| 12823 |
end |
| 12824 |
do |
| 12825 |
local s |
| 12826 |
do |
| 12827 |
local x = status[1] |
| 12828 |
do |
| 12829 |
if x.mtime.tag == "NONE" then |
| 12830 |
else |
| 12831 |
s = x |
| 12832 |
goto cont1 |
| 12833 |
end |
| 12834 |
do |
| 12835 |
local tmp92 = x.md5sum |
| 12836 |
local tmp93 = x.size |
| 12837 |
local tmp94 = _L[66](abspath) |
| 12838 |
s = {md5sum = tmp92, mtime = {tag = "SOME", payload = tmp94}, size = tmp93} |
| 12839 |
end |
| 12840 |
end |
| 12841 |
end |
| 12842 |
::cont1:: |
| 12843 |
local s1 |
| 12844 |
do |
| 12845 |
if s.size.tag == "NONE" then |
| 12846 |
else |
| 12847 |
s1 = s |
| 12848 |
goto cont2 |
| 12849 |
end |
| 12850 |
do |
| 12851 |
local tmp92 = s.md5sum |
| 12852 |
local tmp93 = s.mtime |
| 12853 |
local tmp94 = _L[67](abspath) |
| 12854 |
s1 = {md5sum = tmp92, mtime = tmp93, size = {tag = "SOME", payload = tmp94}} |
| 12855 |
end |
| 12856 |
end |
| 12857 |
::cont2:: |
| 12858 |
if s1.md5sum.tag == "NONE" then |
| 12859 |
else |
| 12860 |
status[1] = s1 |
| 12861 |
return auxstatus4 |
| 12862 |
end |
| 12863 |
do |
| 12864 |
local tmp92 = s1.mtime |
| 12865 |
local tmp93 = s1.size |
| 12866 |
local tmp94 |
| 12867 |
do |
| 12868 |
local ins = _L[151](abspath) |
| 12869 |
local tmp95 = _L[153](ins) |
| 12870 |
_L[152](ins) |
| 12871 |
tmp94 = _L[191](tmp95) |
| 12872 |
end |
| 12873 |
status[1] = {md5sum = {tag = "SOME", payload = tmp94}, mtime = tmp92, size = tmp93} |
| 12874 |
return auxstatus4 |
| 12875 |
end |
| 12876 |
end |
| 12877 |
end |
| 12878 |
end |
| 12879 |
local tmp91 = _L[206](_EXCLAM) |
| 12880 |
local tmp92 = foldl(go) |
| 12881 |
local tmp93 = _L[206](ref) |
| 12882 |
local tmp94 = tmp93(auxstatus) |
| 12883 |
local tmp95 = tmp92(tmp94) |
| 12884 |
local tmp96 = tmp95(filelist1) |
| 12885 |
auxstatus2 = tmp91(tmp96) |
| 12886 |
end |
| 12887 |
local tmp91 = foldl(function(a) |
| 12888 |
local path, epstopdf2, pdfx2, tmp92 |
| 12889 |
do |
| 12890 |
path = a[1].path |
| 12891 |
local minted2 = a[2].minted |
| 12892 |
epstopdf2 = a[2].epstopdf |
| 12893 |
pdfx2 = a[2].pdfx |
| 12894 |
do |
| 12895 |
if minted2 then |
| 12896 |
tmp92 = true |
| 12897 |
goto cont |
| 12898 |
end |
| 12899 |
local tmp93 = isSuffix("minted/minted.sty") |
| 12900 |
tmp92 = tmp93(path) |
| 12901 |
end |
| 12902 |
end |
| 12903 |
::cont:: |
| 12904 |
local tmp93 |
| 12905 |
do |
| 12906 |
if epstopdf2 then |
| 12907 |
tmp93 = true |
| 12908 |
goto cont1 |
| 12909 |
end |
| 12910 |
local tmp94 = isSuffix("epstopdf.sty") |
| 12911 |
tmp93 = tmp94(path) |
| 12912 |
end |
| 12913 |
::cont1:: |
| 12914 |
local tmp94 |
| 12915 |
do |
| 12916 |
if pdfx2 then |
| 12917 |
tmp94 = true |
| 12918 |
goto cont2 |
| 12919 |
end |
| 12920 |
local tmp95 = isSuffix("pdfx.sty") |
| 12921 |
tmp94 = tmp95(path) |
| 12922 |
end |
| 12923 |
::cont2:: |
| 12924 |
return {epstopdf = tmp93, minted = tmp92, pdfx = tmp94} |
| 12925 |
end) |
| 12926 |
local tmp92 = tmp91({epstopdf = false, minted = false, pdfx = false}) |
| 12927 |
local exp8 = tmp92(filelist1) |
| 12928 |
minted1 = exp8.minted |
| 12929 |
epstopdf1 = exp8.epstopdf |
| 12930 |
pdfx1 = exp8.pdfx |
| 12931 |
local tmp93 = exp.tag == "SOME" and exp.payload.tag == "BIBTEX" |
| 12932 |
do |
| 12933 |
if tmp93 then |
| 12934 |
else |
| 12935 |
bibtex_aux_hash1 = NONE |
| 12936 |
goto cont15 |
| 12937 |
end |
| 12938 |
do |
| 12939 |
local biblines |
| 12940 |
do |
| 12941 |
local tmp94 = _L[353](tmp87, tmp62, nil) |
| 12942 |
biblines = revAppend(tmp94, nil) |
| 12943 |
end |
| 12944 |
local tmp94 = _L[191](table_concat(_VectorOrArray_fromList(biblines), "\n")) |
| 12945 |
bibtex_aux_hash1 = {tag = "SOME", payload = tmp94} |
| 12946 |
end |
| 12947 |
end |
| 12948 |
end |
| 12949 |
::cont15:: |
| 12950 |
pdfx = pdfx1 |
| 12951 |
minted = minted1 |
| 12952 |
filelist = filelist1 |
| 12953 |
epstopdf = epstopdf1 |
| 12954 |
bibtex_aux_hash = bibtex_aux_hash1 |
| 12955 |
auxstatus1 = auxstatus2 |
| 12956 |
goto cont3 |
| 12957 |
end |
| 12958 |
::else2:: |
| 12959 |
if auxstatus[2].tag == "E" then |
| 12960 |
pdfx = false |
| 12961 |
minted = false |
| 12962 |
filelist = nil |
| 12963 |
epstopdf = false |
| 12964 |
bibtex_aux_hash = NONE |
| 12965 |
auxstatus1 = _L[203] |
| 12966 |
goto cont3 |
| 12967 |
end |
| 12968 |
_L[301]("Recorder file was not generated during the execution!") |
| 12969 |
_raise(_L[371], "main.sml:218:27") |
| 12970 |
end |
| 12971 |
end |
| 12972 |
::cont3:: |
| 12973 |
do |
| 12974 |
if source_date_epoch_info.tag == "NONE" then |
| 12975 |
goto cont4 |
| 12976 |
end |
| 12977 |
if source_date_epoch_info.tag == "SOME" then |
| 12978 |
else |
| 12979 |
_raise(_Match, "main.sml:229:20") |
| 12980 |
end |
| 12981 |
do |
| 12982 |
local r = source_date_epoch_info.payload |
| 12983 |
local tmp88 = exp5.tag == "SOME" and exp5.payload.tag == "NOW" |
| 12984 |
local should_set_source_date_epoch |
| 12985 |
if tmp88 then |
| 12986 |
should_set_source_date_epoch = true |
| 12987 |
elseif exp5.tag == "SOME" and exp5.payload.tag == "RAW" then |
| 12988 |
should_set_source_date_epoch = false |
| 12989 |
elseif exp5.tag == "NONE" then |
| 12990 |
should_set_source_date_epoch = pdfx or tmp66 |
| 12991 |
else |
| 12992 |
_raise(_Match, "main.sml:232:54") |
| 12993 |
end |
| 12994 |
if should_set_source_date_epoch then |
| 12995 |
else |
| 12996 |
goto cont4 |
| 12997 |
end |
| 12998 |
do |
| 12999 |
local tmp89 |
| 13000 |
do |
| 13001 |
local tmp90 = foldl(function(a) |
| 13002 |
if a[1].kind == "INPUT" then |
| 13003 |
else |
| 13004 |
return a[2] |
| 13005 |
end |
| 13006 |
do |
| 13007 |
local abspath = a[1].abspath |
| 13008 |
local acc = a[2] |
| 13009 |
local exp7 = _L[205](auxstatus1, abspath) |
| 13010 |
if exp7.tag == "SOME" then |
| 13011 |
local mtime = exp7.payload.mtime |
| 13012 |
if mtime.tag == "SOME" and acc.tag == "SOME" then |
| 13013 |
if acc.payload < mtime.payload then |
| 13014 |
return mtime |
| 13015 |
else |
| 13016 |
return acc |
| 13017 |
end |
| 13018 |
elseif mtime.tag == "NONE" then |
| 13019 |
return acc |
| 13020 |
elseif acc.tag == "NONE" then |
| 13021 |
return mtime |
| 13022 |
else |
| 13023 |
_raise(_Match, "main.sml:240:68") |
| 13024 |
end |
| 13025 |
elseif exp7.tag == "NONE" then |
| 13026 |
return acc |
| 13027 |
else |
| 13028 |
_raise(_Match, "main.sml:238:59") |
| 13029 |
end |
| 13030 |
end |
| 13031 |
end) |
| 13032 |
local tmp91 = tmp90(NONE) |
| 13033 |
local input_time = tmp91(filelist) |
| 13034 |
do |
| 13035 |
if input_time.tag == "SOME" then |
| 13036 |
elseif input_time.tag == "NONE" then |
| 13037 |
tmp89 = r[1].time_since_epoch |
| 13038 |
goto cont13 |
| 13039 |
else |
| 13040 |
_raise(_Match, "main.sml:253:37") |
| 13041 |
end |
| 13042 |
do |
| 13043 |
local input_time1 = input_time.payload |
| 13044 |
if r[1].time < input_time1 then |
| 13045 |
else |
| 13046 |
tmp89 = r[1].time_since_epoch |
| 13047 |
goto cont13 |
| 13048 |
end |
| 13049 |
do |
| 13050 |
local tmp92 = tmp5(tmp18()) |
| 13051 |
local new_info = {time = input_time1, time_since_epoch = tmp92} |
| 13052 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 13053 |
else |
| 13054 |
r[1] = new_info |
| 13055 |
tmp89 = tmp92 |
| 13056 |
goto cont13 |
| 13057 |
end |
| 13058 |
_L[304]("Input file was modified; Updating SOURCE_DATE_EPOCH...") |
| 13059 |
r[1] = new_info |
| 13060 |
tmp89 = tmp92 |
| 13061 |
end |
| 13062 |
end |
| 13063 |
end |
| 13064 |
end |
| 13065 |
::cont13:: |
| 13066 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 13067 |
else |
| 13068 |
_L[221]("SOURCE_DATE_EPOCH", tmp89) |
| 13069 |
goto cont4 |
| 13070 |
end |
| 13071 |
_L[304]("Setting SOURCE_DATE_EPOCH to " .. tmp89) |
| 13072 |
_L[221]("SOURCE_DATE_EPOCH", tmp89) |
| 13073 |
end |
| 13074 |
end |
| 13075 |
end |
| 13076 |
::cont4:: |
| 13077 |
local tex_injection |
| 13078 |
do |
| 13079 |
local tex_injection1 |
| 13080 |
if exp2.tag == "SOME" then |
| 13081 |
tex_injection1 = "\\includeonly{" .. exp2.payload .. "}" |
| 13082 |
elseif exp2.tag == "NONE" then |
| 13083 |
tex_injection1 = "" |
| 13084 |
else |
| 13085 |
_raise(_Match, "main.sml:276:31") |
| 13086 |
end |
| 13087 |
local tmp88 |
| 13088 |
tmp88 = minted or tmp65 |
| 13089 |
do |
| 13090 |
if tmp88 then |
| 13091 |
else |
| 13092 |
tex_injection = tex_injection1 |
| 13093 |
goto cont5 |
| 13094 |
end |
| 13095 |
do |
| 13096 |
do |
| 13097 |
if not tmp65 then |
| 13098 |
else |
| 13099 |
goto cont13 |
| 13100 |
end |
| 13101 |
_L[303]("You may want to use --package-support=minted option.") |
| 13102 |
end |
| 13103 |
::cont13:: |
| 13104 |
local outdir |
| 13105 |
if _L[220] then |
| 13106 |
outdir = tmp21(tmp62, ".", function(a) |
| 13107 |
local tmp89 = tmp19(a) |
| 13108 |
if tmp89 == 92 then |
| 13109 |
return string_char(47) |
| 13110 |
else |
| 13111 |
return string_char(tmp89) |
| 13112 |
end |
| 13113 |
end) |
| 13114 |
else |
| 13115 |
outdir = tmp62 |
| 13116 |
end |
| 13117 |
tex_injection = tex_injection1 .. "\\PassOptionsToPackage{outputdir=" .. outdir .. "}{minted}" |
| 13118 |
end |
| 13119 |
end |
| 13120 |
end |
| 13121 |
::cont5:: |
| 13122 |
local tex_injection1 |
| 13123 |
do |
| 13124 |
local tmp88 |
| 13125 |
tmp88 = epstopdf or tmp64 |
| 13126 |
do |
| 13127 |
if tmp88 then |
| 13128 |
else |
| 13129 |
tex_injection1 = tex_injection |
| 13130 |
goto cont6 |
| 13131 |
end |
| 13132 |
do |
| 13133 |
do |
| 13134 |
if not tmp64 then |
| 13135 |
else |
| 13136 |
goto cont13 |
| 13137 |
end |
| 13138 |
_L[303]("You may want to use --package-support=epstopdf option.") |
| 13139 |
end |
| 13140 |
::cont13:: |
| 13141 |
local outdir |
| 13142 |
if _L[220] then |
| 13143 |
outdir = tmp21(tmp62, ".", function(a) |
| 13144 |
local tmp89 = tmp19(a) |
| 13145 |
if tmp89 == 92 then |
| 13146 |
return string_char(47) |
| 13147 |
else |
| 13148 |
return string_char(tmp89) |
| 13149 |
end |
| 13150 |
end) |
| 13151 |
else |
| 13152 |
outdir = tmp62 |
| 13153 |
end |
| 13154 |
local tmp89 = isSuffix("/") |
| 13155 |
local tmp90 = tmp89(outdir) |
| 13156 |
local outdir1 |
| 13157 |
if tmp90 then |
| 13158 |
outdir1 = outdir |
| 13159 |
else |
| 13160 |
outdir1 = outdir .. "/" |
| 13161 |
end |
| 13162 |
tex_injection1 = tex_injection .. "\\PassOptionsToPackage{outdir=" .. outdir1 .. "}{epstopdf}" |
| 13163 |
end |
| 13164 |
end |
| 13165 |
end |
| 13166 |
::cont6:: |
| 13167 |
local lightweight_mode, command |
| 13168 |
do |
| 13169 |
local tmp88 = _L[237](engine_type, _L[233]) |
| 13170 |
local tmp89 |
| 13171 |
do |
| 13172 |
local escaped |
| 13173 |
do |
| 13174 |
local tmp90, tmp91 |
| 13175 |
do |
| 13176 |
local tmp92 = full(tmp21(inputfile, ".", function(a) |
| 13177 |
local tmp93 = tmp19(a) |
| 13178 |
if tmp93 == 92 then |
| 13179 |
return "~\\\\" |
| 13180 |
elseif tmp93 == 37 then |
| 13181 |
return "~\\%" |
| 13182 |
elseif tmp93 == 94 then |
| 13183 |
return "~\\^" |
| 13184 |
elseif tmp93 == 123 then |
| 13185 |
return "~\\{" |
| 13186 |
elseif tmp93 == 125 then |
| 13187 |
return "~\\}" |
| 13188 |
elseif tmp93 == 126 then |
| 13189 |
return "~\\~" |
| 13190 |
elseif tmp93 == 35 then |
| 13191 |
return "~\\#" |
| 13192 |
else |
| 13193 |
return string_char(tmp93) |
| 13194 |
end |
| 13195 |
end)) |
| 13196 |
tmp91, tmp90 = tmp92, nil |
| 13197 |
end |
| 13198 |
::cont15:: |
| 13199 |
do |
| 13200 |
local acc, s |
| 13201 |
do |
| 13202 |
s, acc = tmp91, tmp90 |
| 13203 |
local tmp92 = isEmpty(s) |
| 13204 |
if tmp92 then |
| 13205 |
else |
| 13206 |
goto else2 |
| 13207 |
end |
| 13208 |
do |
| 13209 |
local tmp93 = revAppend(acc, nil) |
| 13210 |
escaped = concat1(tmp93) |
| 13211 |
goto cont13 |
| 13212 |
end |
| 13213 |
end |
| 13214 |
::else2:: |
| 13215 |
local a, d, tmp92, tmp93 |
| 13216 |
do |
| 13217 |
local tmp94 = splitl(function(c) |
| 13218 |
return c ~= 32 |
| 13219 |
end) |
| 13220 |
local exp7 = tmp94(s) |
| 13221 |
a = exp7[1] |
| 13222 |
local b = exp7[2] |
| 13223 |
local tmp95 = splitl(function(c) |
| 13224 |
return c == 32 |
| 13225 |
end) |
| 13226 |
local exp8 = tmp95(b) |
| 13227 |
local c = exp8[1] |
| 13228 |
d = exp8[2] |
| 13229 |
tmp92 = map(str) |
| 13230 |
do |
| 13231 |
local base, start, tmp96, tmp97 |
| 13232 |
do |
| 13233 |
base = c.base |
| 13234 |
local length1 = c.length |
| 13235 |
start = c.start |
| 13236 |
tmp97, tmp96 = _Int_sub(_Int_add(start, length1), 1), nil |
| 13237 |
end |
| 13238 |
::cont17:: |
| 13239 |
do |
| 13240 |
local i, acc1 = tmp97, tmp96 |
| 13241 |
if i < start then |
| 13242 |
tmp93 = acc1 |
| 13243 |
goto cont16 |
| 13244 |
end |
| 13245 |
local tmp98 = _Int_sub(i, 1) |
| 13246 |
local tmp99 = sub1({base, i}) |
| 13247 |
tmp97 = tmp98 |
| 13248 |
tmp96 = {tmp99, acc1} |
| 13249 |
goto cont17 |
| 13250 |
end |
| 13251 |
end |
| 13252 |
end |
| 13253 |
::cont16:: |
| 13254 |
local tmp94 = tmp92(tmp93) |
| 13255 |
local c_PRIME = full(table_concat(_VectorOrArray_fromList(tmp94), "~")) |
| 13256 |
tmp91 = d |
| 13257 |
tmp90 = {c_PRIME, {a, acc}} |
| 13258 |
goto cont15 |
| 13259 |
end |
| 13260 |
end |
| 13261 |
::cont13:: |
| 13262 |
local escaped1 |
| 13263 |
do |
| 13264 |
if tmp88 then |
| 13265 |
else |
| 13266 |
escaped1 = escaped |
| 13267 |
goto cont14 |
| 13268 |
end |
| 13269 |
do |
| 13270 |
local tmp90, tmp91 |
| 13271 |
do |
| 13272 |
local tmp92 = full(escaped) |
| 13273 |
tmp91, tmp90 = tmp92, nil |
| 13274 |
end |
| 13275 |
::cont15:: |
| 13276 |
do |
| 13277 |
local acc, s |
| 13278 |
do |
| 13279 |
s, acc = tmp91, tmp90 |
| 13280 |
local tmp92 = isEmpty(s) |
| 13281 |
if tmp92 then |
| 13282 |
else |
| 13283 |
goto else2 |
| 13284 |
end |
| 13285 |
do |
| 13286 |
local tmp93 = revAppend(acc, nil) |
| 13287 |
escaped1 = concat1(tmp93) |
| 13288 |
goto cont14 |
| 13289 |
end |
| 13290 |
end |
| 13291 |
::else2:: |
| 13292 |
local a, d, c_PRIME |
| 13293 |
do |
| 13294 |
local tmp92 = splitl(isAscii) |
| 13295 |
local exp7 = tmp92(s) |
| 13296 |
a = exp7[1] |
| 13297 |
local b = exp7[2] |
| 13298 |
local tmp93 = splitl(function(a1) |
| 13299 |
return not (a1 <= 127) |
| 13300 |
end) |
| 13301 |
local exp8 = tmp93(b) |
| 13302 |
local c = exp8[1] |
| 13303 |
d = exp8[2] |
| 13304 |
local tmp94 = isEmpty(c) |
| 13305 |
do |
| 13306 |
if tmp94 then |
| 13307 |
c_PRIME = c |
| 13308 |
goto cont16 |
| 13309 |
end |
| 13310 |
local tmp95 = string1(c) |
| 13311 |
c_PRIME = full("\\detokenize{" .. tmp95 .. "}") |
| 13312 |
end |
| 13313 |
end |
| 13314 |
::cont16:: |
| 13315 |
tmp91 = d |
| 13316 |
tmp90 = {c_PRIME, {a, acc}} |
| 13317 |
goto cont15 |
| 13318 |
end |
| 13319 |
end |
| 13320 |
end |
| 13321 |
::cont14:: |
| 13322 |
if inputfile == escaped1 then |
| 13323 |
tmp89 = "\\input\"" .. inputfile .. "\"" |
| 13324 |
else |
| 13325 |
tmp89 = "\\begingroup\\escapechar-1\\let~\\string\\edef\\x{\"" .. escaped1 .. "\" }\\expandafter\\endgroup\\expandafter\\input\\x" |
| 13326 |
end |
| 13327 |
end |
| 13328 |
local tmp90 = tex_injection1 .. tmp89 |
| 13329 |
local tmp91 = tmp86 == 1 and tmp68 |
| 13330 |
local tmp92, tmp93, tmp94, exp7, exp8, exp9, exp10, exp11, exp12, exp13, exp14, exp15, exp16 |
| 13331 |
if tmp91 then |
| 13332 |
if tmp55 then |
| 13333 |
lightweight_mode = true |
| 13334 |
exp16 = tmp82 |
| 13335 |
exp15 = tmp81 |
| 13336 |
exp14 = tmp80 |
| 13337 |
exp13 = tmp79 |
| 13338 |
exp12 = tmp78 |
| 13339 |
exp11 = tmp77 |
| 13340 |
exp10 = {tag = "SOME", payload = _L[222]} |
| 13341 |
exp9 = tmp75 |
| 13342 |
exp8 = tmp74 |
| 13343 |
exp7 = tmp73 |
| 13344 |
tmp94 = tmp72 |
| 13345 |
tmp93 = tmp71 |
| 13346 |
tmp92 = true |
| 13347 |
else |
| 13348 |
lightweight_mode = true |
| 13349 |
exp16 = tmp82 |
| 13350 |
exp15 = tmp81 |
| 13351 |
exp14 = tmp80 |
| 13352 |
exp13 = tmp79 |
| 13353 |
exp12 = tmp78 |
| 13354 |
exp11 = tmp77 |
| 13355 |
exp10 = {tag = "SOME", payload = _L[222]} |
| 13356 |
exp9 = tmp75 |
| 13357 |
exp8 = tmp74 |
| 13358 |
exp7 = tmp73 |
| 13359 |
tmp94 = tmp72 |
| 13360 |
tmp93 = tmp71 |
| 13361 |
tmp92 = tmp70 |
| 13362 |
end |
| 13363 |
else |
| 13364 |
lightweight_mode = false |
| 13365 |
exp16 = tmp82 |
| 13366 |
exp15 = tmp81 |
| 13367 |
exp14 = tmp80 |
| 13368 |
exp13 = tmp79 |
| 13369 |
exp12 = tmp78 |
| 13370 |
exp11 = tmp77 |
| 13371 |
exp10 = tmp76 |
| 13372 |
exp9 = tmp75 |
| 13373 |
exp8 = tmp74 |
| 13374 |
exp7 = tmp73 |
| 13375 |
tmp94 = tmp72 |
| 13376 |
tmp93 = tmp71 |
| 13377 |
tmp92 = false |
| 13378 |
end |
| 13379 |
do |
| 13380 |
local revCommand |
| 13381 |
do |
| 13382 |
local executable = getOpt(tmp93, tmp54) |
| 13383 |
local revCommand1 = {"-recorder", {executable, nil}} |
| 13384 |
local revCommand2 |
| 13385 |
if exp8.tag == "NONE" then |
| 13386 |
revCommand2 = revCommand1 |
| 13387 |
elseif exp8.tag == "SOME" then |
| 13388 |
revCommand2 = {"-fmt=" .. exp8.payload, revCommand1} |
| 13389 |
else |
| 13390 |
_raise(_Match, "tex-engine.sml:58:28") |
| 13391 |
end |
| 13392 |
local revCommand3 |
| 13393 |
if not exp9 then |
| 13394 |
revCommand3 = revCommand2 |
| 13395 |
elseif exp9 then |
| 13396 |
revCommand3 = {"-halt-on-error", revCommand2} |
| 13397 |
else |
| 13398 |
_raise(_Match, "tex-engine.sml:61:28") |
| 13399 |
end |
| 13400 |
if exp10.tag == "NONE" then |
| 13401 |
revCommand = revCommand3 |
| 13402 |
goto cont13 |
| 13403 |
end |
| 13404 |
if exp10.tag == "SOME" then |
| 13405 |
local mode = exp10.payload |
| 13406 |
local tmp95 |
| 13407 |
if mode == "BATCHMODE" then |
| 13408 |
tmp95 = "batchmode" |
| 13409 |
elseif mode == "NONSTOPMODE" then |
| 13410 |
tmp95 = "nonstopmode" |
| 13411 |
elseif mode == "SCROLLMODE" then |
| 13412 |
tmp95 = "scrollmode" |
| 13413 |
elseif mode == "ERRORSTOPMODE" then |
| 13414 |
tmp95 = "errorstopmode" |
| 13415 |
else |
| 13416 |
_raise(_Match, "types.sml:14:7") |
| 13417 |
end |
| 13418 |
revCommand = {"-interaction=" .. tmp95, revCommand3} |
| 13419 |
else |
| 13420 |
_raise(_Match, "tex-engine.sml:64:28") |
| 13421 |
end |
| 13422 |
end |
| 13423 |
::cont13:: |
| 13424 |
local revCommand1 |
| 13425 |
do |
| 13426 |
local revCommand2 |
| 13427 |
if not exp7 then |
| 13428 |
revCommand2 = revCommand |
| 13429 |
elseif exp7 then |
| 13430 |
revCommand2 = {"-file-line-error", revCommand} |
| 13431 |
else |
| 13432 |
_raise(_Match, "tex-engine.sml:67:28") |
| 13433 |
end |
| 13434 |
do |
| 13435 |
if exp16.tag == "NONE" then |
| 13436 |
revCommand1 = revCommand2 |
| 13437 |
goto cont14 |
| 13438 |
end |
| 13439 |
if exp16.tag == "SOME" then |
| 13440 |
else |
| 13441 |
_raise(_Match, "tex-engine.sml:70:28") |
| 13442 |
end |
| 13443 |
do |
| 13444 |
local tmp95 = _L[208](exp16.payload) |
| 13445 |
revCommand1 = {"-synctex=" .. tmp95, revCommand2} |
| 13446 |
end |
| 13447 |
end |
| 13448 |
end |
| 13449 |
::cont14:: |
| 13450 |
local revCommand2 |
| 13451 |
do |
| 13452 |
local revCommand3 |
| 13453 |
if exp15.tag == "NONE" then |
| 13454 |
revCommand3 = revCommand1 |
| 13455 |
elseif exp15.tag == "SOME" and exp15.payload == "FORBIDDEN" then |
| 13456 |
revCommand3 = {"-no-shell-escape", revCommand1} |
| 13457 |
elseif exp15.tag == "SOME" and exp15.payload == "RESTRICTED" then |
| 13458 |
revCommand3 = {"-shell-restricted", revCommand1} |
| 13459 |
elseif exp15.tag == "SOME" and exp15.payload == "ALLOWED" then |
| 13460 |
revCommand3 = {"-shell-escape", revCommand1} |
| 13461 |
else |
| 13462 |
_raise(_Match, "tex-engine.sml:73:28") |
| 13463 |
end |
| 13464 |
do |
| 13465 |
if exp11.tag == "NONE" then |
| 13466 |
revCommand2 = revCommand3 |
| 13467 |
goto cont15 |
| 13468 |
end |
| 13469 |
if exp11.tag == "SOME" then |
| 13470 |
else |
| 13471 |
_raise(_Match, "tex-engine.sml:78:28") |
| 13472 |
end |
| 13473 |
do |
| 13474 |
local tmp95 = _L[208](exp11.payload) |
| 13475 |
revCommand2 = {"-jobname=" .. tmp95, revCommand3} |
| 13476 |
end |
| 13477 |
end |
| 13478 |
end |
| 13479 |
::cont15:: |
| 13480 |
local revCommand3 |
| 13481 |
do |
| 13482 |
if exp13.tag == "NONE" then |
| 13483 |
revCommand3 = revCommand2 |
| 13484 |
goto cont16 |
| 13485 |
end |
| 13486 |
if exp13.tag == "SOME" then |
| 13487 |
else |
| 13488 |
_raise(_Match, "tex-engine.sml:81:28") |
| 13489 |
end |
| 13490 |
do |
| 13491 |
local tmp95 = _L[208](exp13.payload) |
| 13492 |
revCommand3 = {"-output-directory=" .. tmp95, revCommand2} |
| 13493 |
end |
| 13494 |
end |
| 13495 |
::cont16:: |
| 13496 |
local revCommand4 |
| 13497 |
do |
| 13498 |
if engine_type == "OTHER" then |
| 13499 |
revCommand4 = revCommand3 |
| 13500 |
goto cont17 |
| 13501 |
end |
| 13502 |
if engine_type == "PDFTEX" then |
| 13503 |
local revCommand5 |
| 13504 |
if tmp92 then |
| 13505 |
revCommand5 = {"-draftmode", revCommand3} |
| 13506 |
else |
| 13507 |
revCommand5 = revCommand3 |
| 13508 |
end |
| 13509 |
if exp14 == "DVI" then |
| 13510 |
revCommand4 = {"-output-format=dvi", revCommand5} |
| 13511 |
goto cont17 |
| 13512 |
elseif exp14 == "PDF" then |
| 13513 |
revCommand4 = revCommand5 |
| 13514 |
goto cont17 |
| 13515 |
else |
| 13516 |
_raise(_Match, "tex-engine.sml:90:45") |
| 13517 |
end |
| 13518 |
end |
| 13519 |
if engine_type == "XETEX" then |
| 13520 |
else |
| 13521 |
goto else2 |
| 13522 |
end |
| 13523 |
do |
| 13524 |
local tmp95 |
| 13525 |
if tmp92 then |
| 13526 |
tmp95 = true |
| 13527 |
else |
| 13528 |
tmp95 = _L[232](exp14, _L[231]) |
| 13529 |
end |
| 13530 |
if tmp95 then |
| 13531 |
revCommand4 = {"-no-pdf", revCommand3} |
| 13532 |
goto cont17 |
| 13533 |
else |
| 13534 |
revCommand4 = revCommand3 |
| 13535 |
goto cont17 |
| 13536 |
end |
| 13537 |
end |
| 13538 |
::else2:: |
| 13539 |
if engine_type == "LUATEX" then |
| 13540 |
else |
| 13541 |
_raise(_Match, "tex-engine.sml:84:28") |
| 13542 |
end |
| 13543 |
do |
| 13544 |
local revCommand5 |
| 13545 |
do |
| 13546 |
if exp12.tag == "NONE" then |
| 13547 |
revCommand5 = revCommand3 |
| 13548 |
goto cont18 |
| 13549 |
end |
| 13550 |
if exp12.tag == "SOME" then |
| 13551 |
else |
| 13552 |
_raise(_Match, "tex-engine.sml:98:63") |
| 13553 |
end |
| 13554 |
do |
| 13555 |
local tmp95 = _L[208](exp12.payload) |
| 13556 |
revCommand5 = {"--lua=" .. tmp95, revCommand3} |
| 13557 |
end |
| 13558 |
end |
| 13559 |
::cont18:: |
| 13560 |
local revCommand6 |
| 13561 |
if tmp92 then |
| 13562 |
revCommand6 = {"--draftmode", revCommand5} |
| 13563 |
else |
| 13564 |
revCommand6 = revCommand5 |
| 13565 |
end |
| 13566 |
if exp14 == "DVI" then |
| 13567 |
revCommand4 = {"--output-format=dvi", revCommand6} |
| 13568 |
elseif exp14 == "PDF" then |
| 13569 |
revCommand4 = revCommand6 |
| 13570 |
else |
| 13571 |
_raise(_Match, "tex-engine.sml:105:45") |
| 13572 |
end |
| 13573 |
end |
| 13574 |
end |
| 13575 |
::cont17:: |
| 13576 |
local revCommand5 = revAppend(tmp94, revCommand4) |
| 13577 |
local tmp95 = _L[208](tmp90) |
| 13578 |
local tmp96 = revAppend({tmp95, revCommand5}, nil) |
| 13579 |
command = table_concat(_VectorOrArray_fromList(tmp96), " ") |
| 13580 |
end |
| 13581 |
end |
| 13582 |
local getExecLog, recorded, tmp88 |
| 13583 |
do |
| 13584 |
local tmp89 = {NONE} |
| 13585 |
getExecLog = function() |
| 13586 |
local x = tmp89[1] |
| 13587 |
if x.tag == "NONE" then |
| 13588 |
elseif x.tag == "SOME" then |
| 13589 |
return x.payload |
| 13590 |
else |
| 13591 |
_raise(_Match, "main.sml:322:31") |
| 13592 |
end |
| 13593 |
do |
| 13594 |
local tmp90 = tmp58 .. "." .. "log" |
| 13595 |
local ins = _L[115](_L[210].join(tmp62, tmp90)) |
| 13596 |
local log = _L[123](ins) |
| 13597 |
_L[120](ins) |
| 13598 |
tmp89[1] = {tag = "SOME", payload = log} |
| 13599 |
return log |
| 13600 |
end |
| 13601 |
end |
| 13602 |
local tmp90 = {false} |
| 13603 |
_L[526](command, {tag = "SOME", payload = function(a) |
| 13604 |
local execlog = getExecLog() |
| 13605 |
local tmp91 = _L[210].join(tmp62, tmp58 .. "." .. "aux") |
| 13606 |
local r |
| 13607 |
do |
| 13608 |
local recovered |
| 13609 |
do |
| 13610 |
local tmp92 = _L[49]("I can't write on file") |
| 13611 |
local tmp93 = tmp92(execlog) |
| 13612 |
if tmp93 then |
| 13613 |
else |
| 13614 |
recovered = false |
| 13615 |
goto cont |
| 13616 |
end |
| 13617 |
do |
| 13618 |
local exp7 = _L[352](tmp91, tmp62, _L[197]) |
| 13619 |
local madeNewDirectory = exp7[1] |
| 13620 |
local tmp94 |
| 13621 |
tmp94 = madeNewDirectory and _ENV.CLUTTEX_VERBOSITY >= 1 |
| 13622 |
if tmp94 then |
| 13623 |
else |
| 13624 |
recovered = madeNewDirectory |
| 13625 |
goto cont |
| 13626 |
end |
| 13627 |
_L[304]("Created missing directories.") |
| 13628 |
recovered = madeNewDirectory |
| 13629 |
end |
| 13630 |
end |
| 13631 |
::cont:: |
| 13632 |
local tmp92 |
| 13633 |
do |
| 13634 |
local tmp93 = tmp(_L[229]) |
| 13635 |
local tmp94 |
| 13636 |
do |
| 13637 |
local tmp95 = tmp93({tmp67, {tag = "SOME", payload = _L[228]}}) |
| 13638 |
tmp94 = not tmp95 |
| 13639 |
end |
| 13640 |
if tmp94 then |
| 13641 |
else |
| 13642 |
tmp92 = false |
| 13643 |
goto cont1 |
| 13644 |
end |
| 13645 |
do |
| 13646 |
local tmp95 = tokens(function(c) |
| 13647 |
return c == 10 |
| 13648 |
end) |
| 13649 |
local tmp96 = full(execlog) |
| 13650 |
local lines = tmp95(tmp96) |
| 13651 |
local tmp97 = foldl(function(a1) |
| 13652 |
local line = a1[1] |
| 13653 |
local run = a1[2] |
| 13654 |
local tmp98 = map(string1) |
| 13655 |
local tmp99 = tokens(isSpace) |
| 13656 |
local tmp100 = tmp99(line) |
| 13657 |
local exp7 = tmp98(tmp100) |
| 13658 |
if exp7 ~= nil and (exp7[1] == "(epstopdf)" and (exp7[2] ~= nil and (exp7[2][1] == "Command:" and (exp7[2][2] ~= nil and (exp7[2][2][2] ~= nil and (exp7[2][2][2][2] ~= nil and exp7[2][2][2][2][2] == nil)))))) then |
| 13659 |
else |
| 13660 |
return run |
| 13661 |
end |
| 13662 |
do |
| 13663 |
local tmp101, tmp102, tmp103 |
| 13664 |
do |
| 13665 |
local tmp104 = exp7[2][2][1] |
| 13666 |
tmp101 = exp7[2][2][2][1] |
| 13667 |
tmp102 = exp7[2][2][2][2][1] |
| 13668 |
do |
| 13669 |
if tmp104 == "<epstopdf" then |
| 13670 |
tmp103 = true |
| 13671 |
goto cont |
| 13672 |
end |
| 13673 |
if tmp104 == "<repstopdf" then |
| 13674 |
else |
| 13675 |
tmp103 = false |
| 13676 |
goto cont |
| 13677 |
end |
| 13678 |
do |
| 13679 |
local tmp105 = isPrefix("--outfile=") |
| 13680 |
local tmp106 = tmp105(tmp101) |
| 13681 |
if tmp106 then |
| 13682 |
else |
| 13683 |
tmp103 = false |
| 13684 |
goto cont |
| 13685 |
end |
| 13686 |
do |
| 13687 |
local tmp107 = isSuffix(">") |
| 13688 |
tmp103 = tmp107(tmp102) |
| 13689 |
end |
| 13690 |
end |
| 13691 |
end |
| 13692 |
end |
| 13693 |
::cont:: |
| 13694 |
if tmp103 then |
| 13695 |
else |
| 13696 |
return run |
| 13697 |
end |
| 13698 |
do |
| 13699 |
local outfile = extract(tmp101, 10, NONE) |
| 13700 |
local infile = substring(tmp102, 0, _Int_sub(#tmp102, 1)) |
| 13701 |
local infileAbs = _L[215]({tag = "SOME", payload = original_wd}, infile) |
| 13702 |
local tmp104 = _L[218](infileAbs) |
| 13703 |
if tmp104 then |
| 13704 |
else |
| 13705 |
return run |
| 13706 |
end |
| 13707 |
do |
| 13708 |
local outfileAbs = _L[215]({tag = "SOME", payload = tmp62}, outfile) |
| 13709 |
do |
| 13710 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 13711 |
else |
| 13712 |
goto cont1 |
| 13713 |
end |
| 13714 |
_L[304]("Running epstopdf on " .. infile .. ".") |
| 13715 |
end |
| 13716 |
::cont1:: |
| 13717 |
do |
| 13718 |
local outdir = _L[212](outfileAbs) |
| 13719 |
local tmp105 = _L[219](outdir) |
| 13720 |
do |
| 13721 |
if not tmp105 then |
| 13722 |
else |
| 13723 |
goto cont2 |
| 13724 |
end |
| 13725 |
do |
| 13726 |
local tmp106, tmp107 = _L[217].mkdir_rec(outdir) |
| 13727 |
if not tmp106 then |
| 13728 |
else |
| 13729 |
goto cont2 |
| 13730 |
end |
| 13731 |
do |
| 13732 |
local tmp108 = _Error(tmp107) |
| 13733 |
_raise(tmp108, "fs-util.sml:16:28") |
| 13734 |
end |
| 13735 |
end |
| 13736 |
end |
| 13737 |
end |
| 13738 |
::cont2:: |
| 13739 |
local tmp105 = _L[208](outfileAbs) |
| 13740 |
local tmp106 = "epstopdf --outfile=" .. tmp105 .. " " |
| 13741 |
local tmp107 = _L[208](infileAbs) |
| 13742 |
local tmp108 = tmp106 .. tmp107 |
| 13743 |
_L[300](tmp108) |
| 13744 |
tmp14(tmp108) |
| 13745 |
return run |
| 13746 |
end |
| 13747 |
end |
| 13748 |
end |
| 13749 |
end) |
| 13750 |
local tmp98 = tmp97(false) |
| 13751 |
tmp92 = tmp98(lines) |
| 13752 |
end |
| 13753 |
end |
| 13754 |
::cont1:: |
| 13755 |
local recovered1 |
| 13756 |
recovered1 = tmp92 or recovered |
| 13757 |
if recovered1 then |
| 13758 |
tmp90[1] = true |
| 13759 |
return true |
| 13760 |
end |
| 13761 |
local tmp93 = _L[49]("Package minted Error: Missing Pygments output; \\inputminted was") |
| 13762 |
r = tmp93(execlog) |
| 13763 |
end |
| 13764 |
tmp90[1] = true |
| 13765 |
return r |
| 13766 |
end}) |
| 13767 |
if tmp90[1] then |
| 13768 |
exp6 = {tag = "SHOULD_RERUN", payload = _L[203]} |
| 13769 |
goto cont2 |
| 13770 |
end |
| 13771 |
recorded = _L[360](recorderfile, tmp59, nil, _L[203]) |
| 13772 |
local tmp91 = _L[237](engine_type, _L[235]) |
| 13773 |
do |
| 13774 |
if tmp91 then |
| 13775 |
else |
| 13776 |
tmp88 = false |
| 13777 |
goto cont7 |
| 13778 |
end |
| 13779 |
tmp88 = _L[218](recorderfile2) |
| 13780 |
end |
| 13781 |
end |
| 13782 |
::cont7:: |
| 13783 |
local recorded1 |
| 13784 |
do |
| 13785 |
if tmp88 then |
| 13786 |
else |
| 13787 |
recorded1 = recorded |
| 13788 |
goto cont8 |
| 13789 |
end |
| 13790 |
do |
| 13791 |
local fileList = recorded[1] |
| 13792 |
recorded1 = _L[360](recorderfile2, tmp59, fileList, recorded[2]) |
| 13793 |
end |
| 13794 |
end |
| 13795 |
::cont8:: |
| 13796 |
local filelist1, execlog |
| 13797 |
do |
| 13798 |
local exp7 |
| 13799 |
do |
| 13800 |
local fileInfo = recorded1[1] |
| 13801 |
exp7 = _L[359](fileInfo, recorded1[2]) |
| 13802 |
end |
| 13803 |
filelist1 = exp7[1] |
| 13804 |
execlog = getExecLog() |
| 13805 |
do |
| 13806 |
if exp1.tag == "NONE" then |
| 13807 |
goto cont9 |
| 13808 |
end |
| 13809 |
if exp1.tag == "SOME" then |
| 13810 |
else |
| 13811 |
_raise(_Match, "main.sml:349:27") |
| 13812 |
end |
| 13813 |
do |
| 13814 |
do |
| 13815 |
local driver = exp1.payload |
| 13816 |
local tmp89 = map(function(a) |
| 13817 |
local path = a.path |
| 13818 |
local kind = a.kind |
| 13819 |
if kind == "INPUT" then |
| 13820 |
return {kind = "input", path = path} |
| 13821 |
elseif kind == "OUTPUT" then |
| 13822 |
return {kind = "output", path = path} |
| 13823 |
elseif kind == "AUXILIARY" then |
| 13824 |
return {kind = "auxiliary", path = path} |
| 13825 |
else |
| 13826 |
_raise(_Match, "main.sml:351:141") |
| 13827 |
end |
| 13828 |
end) |
| 13829 |
local tmp90 = tmp89(filelist1) |
| 13830 |
do |
| 13831 |
do |
| 13832 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 13833 |
else |
| 13834 |
goto cont14 |
| 13835 |
end |
| 13836 |
do |
| 13837 |
if driver == "DVIPDFMX" then |
| 13838 |
else |
| 13839 |
goto else2 |
| 13840 |
end |
| 13841 |
_L[304]("checkdriver: expects dvipdfmx") |
| 13842 |
goto cont14 |
| 13843 |
::else2:: |
| 13844 |
if driver == "DVIPS" then |
| 13845 |
else |
| 13846 |
goto else3 |
| 13847 |
end |
| 13848 |
_L[304]("checkdriver: expects dvips") |
| 13849 |
goto cont14 |
| 13850 |
::else3:: |
| 13851 |
if driver == "DVISVGM" then |
| 13852 |
else |
| 13853 |
goto else4 |
| 13854 |
end |
| 13855 |
_L[304]("checkdriver: expects dvisvgm") |
| 13856 |
goto cont14 |
| 13857 |
::else4:: |
| 13858 |
if driver == "PDFTEX" then |
| 13859 |
else |
| 13860 |
goto else5 |
| 13861 |
end |
| 13862 |
_L[304]("checkdriver: expects pdftex") |
| 13863 |
goto cont14 |
| 13864 |
::else5:: |
| 13865 |
if driver == "XETEX" then |
| 13866 |
else |
| 13867 |
goto else6 |
| 13868 |
end |
| 13869 |
_L[304]("checkdriver: expects xetex") |
| 13870 |
goto cont14 |
| 13871 |
::else6:: |
| 13872 |
if driver == "LUATEX" then |
| 13873 |
else |
| 13874 |
_raise(_Match, "check-driver.sml:8:7") |
| 13875 |
end |
| 13876 |
_L[304]("checkdriver: expects luatex") |
| 13877 |
end |
| 13878 |
end |
| 13879 |
::cont14:: |
| 13880 |
local loadedSet, graphics_driver |
| 13881 |
do |
| 13882 |
local tmp91 = foldl(function(a) |
| 13883 |
local kind = a[1].kind |
| 13884 |
local path = a[1].path |
| 13885 |
local set = a[2] |
| 13886 |
if kind == "input" then |
| 13887 |
else |
| 13888 |
return set |
| 13889 |
end |
| 13890 |
do |
| 13891 |
local tmp92 = _L[211](path) |
| 13892 |
return _L[198](set, tmp92) |
| 13893 |
end |
| 13894 |
end) |
| 13895 |
local tmp92 = tmp91(_L[197]) |
| 13896 |
loadedSet = tmp92(tmp90) |
| 13897 |
local tmp93 = _L[199](loadedSet, "graphics.sty") |
| 13898 |
local tmp94 |
| 13899 |
if tmp93 then |
| 13900 |
tmp94 = true |
| 13901 |
else |
| 13902 |
tmp94 = _L[199](loadedSet, "color.sty") |
| 13903 |
end |
| 13904 |
do |
| 13905 |
if tmp94 then |
| 13906 |
else |
| 13907 |
graphics_driver = NONE |
| 13908 |
goto cont15 |
| 13909 |
end |
| 13910 |
do |
| 13911 |
local tmp95 = _L[199](loadedSet, "dvipdfmx.def") |
| 13912 |
if tmp95 then |
| 13913 |
graphics_driver = {tag = "SOME", payload = _L[311]} |
| 13914 |
goto cont15 |
| 13915 |
end |
| 13916 |
local tmp96 = _L[199](loadedSet, "dvips.def") |
| 13917 |
if tmp96 then |
| 13918 |
graphics_driver = {tag = "SOME", payload = _L[312]} |
| 13919 |
goto cont15 |
| 13920 |
end |
| 13921 |
local tmp97 = _L[199](loadedSet, "dvisvgm.def") |
| 13922 |
if tmp97 then |
| 13923 |
graphics_driver = {tag = "SOME", payload = _L[313]} |
| 13924 |
goto cont15 |
| 13925 |
end |
| 13926 |
local tmp98 = _L[199](loadedSet, "pdftex.def") |
| 13927 |
if tmp98 then |
| 13928 |
graphics_driver = {tag = "SOME", payload = _L[314]} |
| 13929 |
goto cont15 |
| 13930 |
end |
| 13931 |
local tmp99 = _L[199](loadedSet, "luatex.def") |
| 13932 |
if tmp99 then |
| 13933 |
graphics_driver = {tag = "SOME", payload = _L[316]} |
| 13934 |
goto cont15 |
| 13935 |
end |
| 13936 |
local tmp100 = _L[199](loadedSet, "xetex.def") |
| 13937 |
if tmp100 then |
| 13938 |
graphics_driver = {tag = "SOME", payload = _L[315]} |
| 13939 |
else |
| 13940 |
graphics_driver = {tag = "SOME", payload = _L[317]} |
| 13941 |
end |
| 13942 |
end |
| 13943 |
end |
| 13944 |
end |
| 13945 |
::cont15:: |
| 13946 |
local tmp91 |
| 13947 |
do |
| 13948 |
local tmp92 = _L[199](loadedSet, "expl3-code.tex") |
| 13949 |
do |
| 13950 |
if tmp92 then |
| 13951 |
tmp91 = true |
| 13952 |
goto cont16 |
| 13953 |
end |
| 13954 |
local tmp93 = _L[199](loadedSet, "expl3.sty") |
| 13955 |
if tmp93 then |
| 13956 |
tmp91 = true |
| 13957 |
goto cont16 |
| 13958 |
end |
| 13959 |
local tmp94 = _L[199](loadedSet, "l3backend-dvips.def") |
| 13960 |
if tmp94 then |
| 13961 |
tmp91 = true |
| 13962 |
goto cont16 |
| 13963 |
end |
| 13964 |
local tmp95 = _L[199](loadedSet, "l3backend-dvipdfmx.def") |
| 13965 |
if tmp95 then |
| 13966 |
tmp91 = true |
| 13967 |
goto cont16 |
| 13968 |
end |
| 13969 |
local tmp96 = _L[199](loadedSet, "l3backend-xdvipdfmx.def") |
| 13970 |
if tmp96 then |
| 13971 |
tmp91 = true |
| 13972 |
goto cont16 |
| 13973 |
end |
| 13974 |
local tmp97 = _L[199](loadedSet, "l3backend-pdfmode.def") |
| 13975 |
if tmp97 then |
| 13976 |
tmp91 = true |
| 13977 |
goto cont16 |
| 13978 |
end |
| 13979 |
local tmp98 = _L[199](loadedSet, "l3backend-pdftex.def") |
| 13980 |
if tmp98 then |
| 13981 |
tmp91 = true |
| 13982 |
goto cont16 |
| 13983 |
end |
| 13984 |
local tmp99 = _L[199](loadedSet, "l3backend-luatex.def") |
| 13985 |
if tmp99 then |
| 13986 |
tmp91 = true |
| 13987 |
else |
| 13988 |
tmp91 = _L[199](loadedSet, "l3backend-xetex.def") |
| 13989 |
end |
| 13990 |
end |
| 13991 |
end |
| 13992 |
::cont16:: |
| 13993 |
local expl3_driver |
| 13994 |
do |
| 13995 |
if tmp91 then |
| 13996 |
else |
| 13997 |
expl3_driver = NONE |
| 13998 |
goto cont17 |
| 13999 |
end |
| 14000 |
do |
| 14001 |
local tmp92 = _L[199](loadedSet, "l3backend-pdfmode.def") |
| 14002 |
if tmp92 then |
| 14003 |
expl3_driver = {tag = "SOME", payload = _L[319]} |
| 14004 |
goto cont17 |
| 14005 |
end |
| 14006 |
local tmp93 = _L[199](loadedSet, "l3backend-dvisvgm.def") |
| 14007 |
if tmp93 then |
| 14008 |
expl3_driver = {tag = "SOME", payload = _L[320]} |
| 14009 |
goto cont17 |
| 14010 |
end |
| 14011 |
local tmp94 = _L[199](loadedSet, "l3backend-xdvipdfmx.def") |
| 14012 |
if tmp94 then |
| 14013 |
expl3_driver = {tag = "SOME", payload = _L[321]} |
| 14014 |
goto cont17 |
| 14015 |
end |
| 14016 |
local tmp95 = _L[199](loadedSet, "l3backend-dvipdfmx.def") |
| 14017 |
if tmp95 then |
| 14018 |
expl3_driver = {tag = "SOME", payload = _L[322]} |
| 14019 |
goto cont17 |
| 14020 |
end |
| 14021 |
local tmp96 = _L[199](loadedSet, "l3backend-dvips.def") |
| 14022 |
if tmp96 then |
| 14023 |
expl3_driver = {tag = "SOME", payload = _L[323]} |
| 14024 |
goto cont17 |
| 14025 |
end |
| 14026 |
local tmp97 = _L[199](loadedSet, "l3backend-pdftex.def") |
| 14027 |
if tmp97 then |
| 14028 |
expl3_driver = {tag = "SOME", payload = _L[324]} |
| 14029 |
goto cont17 |
| 14030 |
end |
| 14031 |
local tmp98 = _L[199](loadedSet, "l3backend-luatex.def") |
| 14032 |
if tmp98 then |
| 14033 |
expl3_driver = {tag = "SOME", payload = _L[325]} |
| 14034 |
goto cont17 |
| 14035 |
end |
| 14036 |
local tmp99 = _L[199](loadedSet, "l3backend-xetex.def") |
| 14037 |
if tmp99 then |
| 14038 |
expl3_driver = {tag = "SOME", payload = _L[326]} |
| 14039 |
else |
| 14040 |
expl3_driver = {tag = "SOME", payload = _L[327]} |
| 14041 |
end |
| 14042 |
end |
| 14043 |
end |
| 14044 |
::cont17:: |
| 14045 |
local hyperref_driver |
| 14046 |
do |
| 14047 |
local tmp92 = _L[199](loadedSet, "hyperref.sty") |
| 14048 |
do |
| 14049 |
if tmp92 then |
| 14050 |
else |
| 14051 |
hyperref_driver = NONE |
| 14052 |
goto cont18 |
| 14053 |
end |
| 14054 |
do |
| 14055 |
local tmp93 = _L[199](loadedSet, "hluatex.def") |
| 14056 |
if tmp93 then |
| 14057 |
hyperref_driver = {tag = "SOME", payload = _L[333]} |
| 14058 |
goto cont18 |
| 14059 |
end |
| 14060 |
local tmp94 = _L[199](loadedSet, "hpdftex.def") |
| 14061 |
if tmp94 then |
| 14062 |
hyperref_driver = {tag = "SOME", payload = _L[332]} |
| 14063 |
goto cont18 |
| 14064 |
end |
| 14065 |
local tmp95 = _L[199](loadedSet, "hxetex.def") |
| 14066 |
if tmp95 then |
| 14067 |
hyperref_driver = {tag = "SOME", payload = _L[334]} |
| 14068 |
goto cont18 |
| 14069 |
end |
| 14070 |
local tmp96 = _L[199](loadedSet, "hdvipdfm.def") |
| 14071 |
if tmp96 then |
| 14072 |
hyperref_driver = {tag = "SOME", payload = _L[330]} |
| 14073 |
goto cont18 |
| 14074 |
end |
| 14075 |
local tmp97 = _L[199](loadedSet, "hdvips.def") |
| 14076 |
if tmp97 then |
| 14077 |
hyperref_driver = {tag = "SOME", payload = _L[331]} |
| 14078 |
else |
| 14079 |
hyperref_driver = {tag = "SOME", payload = _L[335]} |
| 14080 |
end |
| 14081 |
end |
| 14082 |
end |
| 14083 |
end |
| 14084 |
::cont18:: |
| 14085 |
local xypic_driver |
| 14086 |
do |
| 14087 |
local tmp92 = _L[199](loadedSet, "xy.tex") |
| 14088 |
do |
| 14089 |
if tmp92 then |
| 14090 |
else |
| 14091 |
xypic_driver = NONE |
| 14092 |
goto cont19 |
| 14093 |
end |
| 14094 |
do |
| 14095 |
local tmp93 = _L[199](loadedSet, "xypdf.tex") |
| 14096 |
if tmp93 then |
| 14097 |
xypic_driver = {tag = "SOME", payload = _L[337]} |
| 14098 |
goto cont19 |
| 14099 |
end |
| 14100 |
local tmp94 = _L[199](loadedSet, "xydvips.tex") |
| 14101 |
if tmp94 then |
| 14102 |
xypic_driver = {tag = "SOME", payload = _L[338]} |
| 14103 |
else |
| 14104 |
xypic_driver = {tag = "SOME", payload = _L[339]} |
| 14105 |
end |
| 14106 |
end |
| 14107 |
end |
| 14108 |
end |
| 14109 |
::cont19:: |
| 14110 |
do |
| 14111 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 14112 |
else |
| 14113 |
goto cont20 |
| 14114 |
end |
| 14115 |
do |
| 14116 |
do |
| 14117 |
local tmp92 |
| 14118 |
if graphics_driver.tag == "NONE" then |
| 14119 |
tmp92 = "not loaded" |
| 14120 |
else |
| 14121 |
if graphics_driver.tag == "SOME" then |
| 14122 |
else |
| 14123 |
_raise(_Match, "check-driver.sml:204:17") |
| 14124 |
end |
| 14125 |
tmp92 = _L[318](graphics_driver.payload) |
| 14126 |
end |
| 14127 |
_L[304]("checkdriver: graphics=" .. tmp92) |
| 14128 |
local tmp93 |
| 14129 |
if expl3_driver.tag == "NONE" then |
| 14130 |
tmp93 = "not loaded" |
| 14131 |
else |
| 14132 |
if expl3_driver.tag == "SOME" then |
| 14133 |
else |
| 14134 |
_raise(_Match, "check-driver.sml:210:17") |
| 14135 |
end |
| 14136 |
tmp93 = _L[329](expl3_driver.payload) |
| 14137 |
end |
| 14138 |
_L[304]("checkdriver: expl3=" .. tmp93) |
| 14139 |
local tmp94 |
| 14140 |
if hyperref_driver.tag == "NONE" then |
| 14141 |
tmp94 = "not loaded" |
| 14142 |
else |
| 14143 |
if hyperref_driver.tag == "SOME" then |
| 14144 |
else |
| 14145 |
_raise(_Match, "check-driver.sml:216:17") |
| 14146 |
end |
| 14147 |
tmp94 = _L[336](hyperref_driver.payload) |
| 14148 |
end |
| 14149 |
_L[304]("checkdriver: hyperref=" .. tmp94) |
| 14150 |
if xypic_driver.tag == "NONE" then |
| 14151 |
else |
| 14152 |
goto else2 |
| 14153 |
end |
| 14154 |
_L[304]("checkdriver: xypic=not loaded") |
| 14155 |
goto cont20 |
| 14156 |
end |
| 14157 |
::else2:: |
| 14158 |
if xypic_driver.tag == "SOME" then |
| 14159 |
else |
| 14160 |
_raise(_Match, "check-driver.sml:222:17") |
| 14161 |
end |
| 14162 |
do |
| 14163 |
local d = xypic_driver.payload |
| 14164 |
if d == "PDF" then |
| 14165 |
else |
| 14166 |
goto else3 |
| 14167 |
end |
| 14168 |
_L[304]("checkdriver: xypic=pdf") |
| 14169 |
goto cont20 |
| 14170 |
::else3:: |
| 14171 |
if d == "DVIPS" then |
| 14172 |
else |
| 14173 |
goto else4 |
| 14174 |
end |
| 14175 |
_L[304]("checkdriver: xypic=dvips") |
| 14176 |
goto cont20 |
| 14177 |
::else4:: |
| 14178 |
if d == "UNKNOWN" then |
| 14179 |
else |
| 14180 |
_raise(_Match, "check-driver.sml:67:9") |
| 14181 |
end |
| 14182 |
_L[304]("checkdriver: xypic=unknown") |
| 14183 |
end |
| 14184 |
end |
| 14185 |
end |
| 14186 |
::cont20:: |
| 14187 |
local expected_xypic, expected_hyperref, expected_expl3_old, expected_expl3_new |
| 14188 |
do |
| 14189 |
local expected_graphics |
| 14190 |
if driver == "DVIPS" then |
| 14191 |
local tmp92 = {tag = "SOME", payload = _L[331]} |
| 14192 |
expected_xypic = {tag = "SOME", payload = _L[338]} |
| 14193 |
expected_hyperref = tmp92 |
| 14194 |
expected_graphics = _L[312] |
| 14195 |
expected_expl3_old = _L[323] |
| 14196 |
expected_expl3_new = _L[323] |
| 14197 |
elseif driver == "DVIPDFMX" then |
| 14198 |
local tmp92 = {tag = "SOME", payload = _L[330]} |
| 14199 |
expected_xypic = {tag = "SOME", payload = _L[337]} |
| 14200 |
expected_hyperref = tmp92 |
| 14201 |
expected_graphics = _L[311] |
| 14202 |
expected_expl3_old = _L[322] |
| 14203 |
expected_expl3_new = _L[322] |
| 14204 |
elseif driver == "DVISVGM" then |
| 14205 |
expected_xypic = NONE |
| 14206 |
expected_hyperref = NONE |
| 14207 |
expected_graphics = _L[313] |
| 14208 |
expected_expl3_old = _L[320] |
| 14209 |
expected_expl3_new = _L[320] |
| 14210 |
elseif driver == "XETEX" then |
| 14211 |
local tmp92 = {tag = "SOME", payload = _L[334]} |
| 14212 |
expected_xypic = {tag = "SOME", payload = _L[337]} |
| 14213 |
expected_hyperref = tmp92 |
| 14214 |
expected_graphics = _L[315] |
| 14215 |
expected_expl3_old = _L[321] |
| 14216 |
expected_expl3_new = _L[326] |
| 14217 |
elseif driver == "PDFTEX" then |
| 14218 |
local tmp92 = {tag = "SOME", payload = _L[332]} |
| 14219 |
expected_xypic = {tag = "SOME", payload = _L[337]} |
| 14220 |
expected_hyperref = tmp92 |
| 14221 |
expected_graphics = _L[314] |
| 14222 |
expected_expl3_old = _L[319] |
| 14223 |
expected_expl3_new = _L[324] |
| 14224 |
elseif driver == "LUATEX" then |
| 14225 |
local tmp92 = {tag = "SOME", payload = _L[333]} |
| 14226 |
expected_xypic = {tag = "SOME", payload = _L[337]} |
| 14227 |
expected_hyperref = tmp92 |
| 14228 |
expected_graphics = _L[316] |
| 14229 |
expected_expl3_old = _L[319] |
| 14230 |
expected_expl3_new = _L[325] |
| 14231 |
else |
| 14232 |
_raise(_Match, "check-driver.sml:72:7") |
| 14233 |
end |
| 14234 |
do |
| 14235 |
if graphics_driver.tag == "NONE" then |
| 14236 |
goto cont21 |
| 14237 |
end |
| 14238 |
if graphics_driver.tag == "SOME" then |
| 14239 |
else |
| 14240 |
_raise(_Match, "check-driver.sml:236:7") |
| 14241 |
end |
| 14242 |
do |
| 14243 |
local d = graphics_driver.payload |
| 14244 |
local tmp92 |
| 14245 |
tmp92 = not (d == "DVIPDFMX" and expected_graphics == "DVIPDFMX") and (not (d == "DVIPS" and expected_graphics == "DVIPS") and (not (d == "DVISVGM" and expected_graphics == "DVISVGM") and (not (d == "PDFTEX" and expected_graphics == "PDFTEX") and (not (d == "XETEX" and expected_graphics == "XETEX") and (not (d == "LUATEX" and expected_graphics == "LUATEX") and (d ~= "UNKNOWN" or expected_graphics ~= "UNKNOWN")))))) |
| 14246 |
if tmp92 then |
| 14247 |
else |
| 14248 |
goto cont21 |
| 14249 |
end |
| 14250 |
do |
| 14251 |
_L[303]("The driver option for grahipcs(x)/color is missing or wrong.") |
| 14252 |
local tmp93 = _L[318](expected_graphics) |
| 14253 |
_L[303]("Consider setting '" .. tmp93 .. "' option.") |
| 14254 |
end |
| 14255 |
end |
| 14256 |
end |
| 14257 |
end |
| 14258 |
::cont21:: |
| 14259 |
do |
| 14260 |
if expl3_driver.tag == "NONE" then |
| 14261 |
goto cont22 |
| 14262 |
end |
| 14263 |
if expl3_driver.tag == "SOME" then |
| 14264 |
else |
| 14265 |
_raise(_Match, "check-driver.sml:248:7") |
| 14266 |
end |
| 14267 |
do |
| 14268 |
local tmp92 |
| 14269 |
do |
| 14270 |
local d = expl3_driver.payload |
| 14271 |
local tmp93 |
| 14272 |
do |
| 14273 |
local tmp94 = _L[328](d, expected_expl3_old) |
| 14274 |
tmp93 = not tmp94 |
| 14275 |
end |
| 14276 |
do |
| 14277 |
if tmp93 then |
| 14278 |
else |
| 14279 |
tmp92 = false |
| 14280 |
goto cont24 |
| 14281 |
end |
| 14282 |
do |
| 14283 |
local tmp94 = _L[328](d, expected_expl3_new) |
| 14284 |
tmp92 = not tmp94 |
| 14285 |
end |
| 14286 |
end |
| 14287 |
end |
| 14288 |
::cont24:: |
| 14289 |
if tmp92 then |
| 14290 |
else |
| 14291 |
goto cont22 |
| 14292 |
end |
| 14293 |
do |
| 14294 |
_L[303]("The driver option for expl3 is missing or wrong.") |
| 14295 |
local tmp93 = _L[329](expected_expl3_new) |
| 14296 |
_L[303]("Consider setting 'driver=" .. tmp93 .. "' option when loading expl3.") |
| 14297 |
local tmp94 = _L[328](expected_expl3_old, expected_expl3_new) |
| 14298 |
if not tmp94 then |
| 14299 |
else |
| 14300 |
goto cont22 |
| 14301 |
end |
| 14302 |
do |
| 14303 |
local tmp95 = _L[329](expected_expl3_old) |
| 14304 |
_L[303]("You might need to instead set 'driver=" .. tmp95 .. "' if you are using an older version of expl3.") |
| 14305 |
end |
| 14306 |
end |
| 14307 |
end |
| 14308 |
end |
| 14309 |
::cont22:: |
| 14310 |
do |
| 14311 |
local tmp92 = hyperref_driver.tag == "SOME" and expected_hyperref.tag == "SOME" |
| 14312 |
do |
| 14313 |
if tmp92 then |
| 14314 |
else |
| 14315 |
goto cont23 |
| 14316 |
end |
| 14317 |
do |
| 14318 |
local actual = hyperref_driver.payload |
| 14319 |
local expected = expected_hyperref.payload |
| 14320 |
local tmp93 |
| 14321 |
tmp93 = not (actual == "DVIPDFMX" and expected == "DVIPDFMX") and (not (actual == "DVIPS" and expected == "DVIPS") and (not (actual == "PDFTEX" and expected == "PDFTEX") and (not (actual == "LUATEX" and expected == "LUATEX") and (not (actual == "XETEX" and expected == "XETEX") and (actual ~= "UNKNOWN" or expected ~= "UNKNOWN"))))) |
| 14322 |
if tmp93 then |
| 14323 |
else |
| 14324 |
goto cont23 |
| 14325 |
end |
| 14326 |
do |
| 14327 |
_L[303]("The driver option for hyperref is missing or wrong.") |
| 14328 |
local tmp94 = _L[336](expected) |
| 14329 |
_L[303]("Consider setting '" .. tmp94 .. "' option.") |
| 14330 |
end |
| 14331 |
end |
| 14332 |
end |
| 14333 |
end |
| 14334 |
::cont23:: |
| 14335 |
if xypic_driver.tag == "SOME" and expected_xypic.tag == "SOME" then |
| 14336 |
else |
| 14337 |
goto cont9 |
| 14338 |
end |
| 14339 |
do |
| 14340 |
local actual = xypic_driver.payload |
| 14341 |
local expected = expected_xypic.payload |
| 14342 |
local tmp92 |
| 14343 |
tmp92 = not (actual == "PDF" and expected == "PDF") and (not (actual == "DVIPS" and expected == "DVIPS") and (actual ~= "UNKNOWN" or expected ~= "UNKNOWN")) |
| 14344 |
if tmp92 then |
| 14345 |
else |
| 14346 |
goto cont9 |
| 14347 |
end |
| 14348 |
do |
| 14349 |
_L[303]("The driver option for Xy-pic is missing or wrong.") |
| 14350 |
if driver == "DVIPDFMX" then |
| 14351 |
else |
| 14352 |
if driver == "PDFTEX" then |
| 14353 |
else |
| 14354 |
if expected == "PDF" then |
| 14355 |
else |
| 14356 |
if expected == "DVIPS" then |
| 14357 |
elseif expected == "UNKNOWN" then |
| 14358 |
goto cont9 |
| 14359 |
else |
| 14360 |
_raise(_Match, "check-driver.sml:280:15") |
| 14361 |
end |
| 14362 |
_L[303]("Consider setting 'dvips' option.") |
| 14363 |
goto cont13 |
| 14364 |
end |
| 14365 |
_L[303]("Consider setting 'pdf' package option or running \\xyoption{pdf}.") |
| 14366 |
goto cont13 |
| 14367 |
end |
| 14368 |
_L[303]("Consider setting 'pdftex' option or running \\xyoption{pdf}.") |
| 14369 |
goto cont13 |
| 14370 |
end |
| 14371 |
_L[303]("Consider setting 'dvipdfmx' option or running \\xyoption{pdf}.") |
| 14372 |
end |
| 14373 |
end |
| 14374 |
end |
| 14375 |
end |
| 14376 |
::cont13:: |
| 14377 |
end |
| 14378 |
end |
| 14379 |
end |
| 14380 |
::cont9:: |
| 14381 |
local filelist2 |
| 14382 |
do |
| 14383 |
if tmp59.tag == "NONE" then |
| 14384 |
else |
| 14385 |
goto else2 |
| 14386 |
end |
| 14387 |
if not tmp20(execlog, "No file [^\n]+%.ind%.") then |
| 14388 |
filelist2 = filelist1 |
| 14389 |
goto cont10 |
| 14390 |
end |
| 14391 |
_L[303]("You may want to use --makeindex option.") |
| 14392 |
filelist2 = filelist1 |
| 14393 |
goto cont10 |
| 14394 |
::else2:: |
| 14395 |
if tmp59.tag == "SOME" then |
| 14396 |
else |
| 14397 |
_raise(_Match, "main.sml:354:33") |
| 14398 |
end |
| 14399 |
do |
| 14400 |
local makeindex = tmp59.payload |
| 14401 |
local tmp89 = foldl(function(a) |
| 14402 |
local file = a[1] |
| 14403 |
local filelist_acc = a[2] |
| 14404 |
local tmp90 = _L[214](file.path) |
| 14405 |
if tmp90 == "idx" then |
| 14406 |
else |
| 14407 |
return filelist_acc |
| 14408 |
end |
| 14409 |
do |
| 14410 |
local tmp91 |
| 14411 |
do |
| 14412 |
local idxfileinfo = {abspath = file.abspath, kind = _L[357], path = file.path} |
| 14413 |
tmp91 = _L[210].replaceext(file.abspath, "ind") |
| 14414 |
local tmp92 = _L[361]({idxfileinfo, nil}, auxstatus1) |
| 14415 |
local tmp93 |
| 14416 |
if tmp92[1] then |
| 14417 |
tmp93 = true |
| 14418 |
else |
| 14419 |
tmp93 = _L[362](auxstatus1, tmp91, file.abspath) |
| 14420 |
end |
| 14421 |
if tmp93 then |
| 14422 |
else |
| 14423 |
goto else1 |
| 14424 |
end |
| 14425 |
do |
| 14426 |
local idx_dir = _L[212](file.abspath) |
| 14427 |
local tmp94 = _L[208](idx_dir) |
| 14428 |
local tmp95 = _L[211](tmp91) |
| 14429 |
local tmp96 = _L[211](file.abspath) |
| 14430 |
_L[526](table_concat({n = 7, "cd", tmp94, "&&", makeindex, "-o", tmp95, tmp96}, " "), NONE) |
| 14431 |
return {{abspath = tmp91, kind = _L[357], path = tmp91}, filelist_acc} |
| 14432 |
end |
| 14433 |
end |
| 14434 |
::else1:: |
| 14435 |
do |
| 14436 |
local status, exn = _handle(function() |
| 14437 |
local tmp92, tmp93 = _L[216].touch(tmp91) |
| 14438 |
if not tmp92 then |
| 14439 |
else |
| 14440 |
return nil |
| 14441 |
end |
| 14442 |
do |
| 14443 |
local tmp94 = _Error(tmp93) |
| 14444 |
_raise(tmp94, "fs-util.sml:28:25") |
| 14445 |
end |
| 14446 |
end) |
| 14447 |
if not status then |
| 14448 |
if __exn_instanceof(exn, _Error_tag) then |
| 14449 |
else |
| 14450 |
_raise(exn, nil) |
| 14451 |
end |
| 14452 |
do |
| 14453 |
_L[302]("Failed to touch " .. tmp91 .. " (" .. exn.payload .. ")") |
| 14454 |
return filelist_acc |
| 14455 |
end |
| 14456 |
end |
| 14457 |
end |
| 14458 |
return filelist_acc |
| 14459 |
end |
| 14460 |
end) |
| 14461 |
local tmp90 = tmp89(filelist1) |
| 14462 |
filelist2 = tmp90(filelist1) |
| 14463 |
end |
| 14464 |
end |
| 14465 |
::cont10:: |
| 14466 |
local filelist3 |
| 14467 |
do |
| 14468 |
if exp4.tag == "NONE" then |
| 14469 |
else |
| 14470 |
goto else2 |
| 14471 |
end |
| 14472 |
if not tmp20(execlog, "No file [^\n]+%.gls%.") then |
| 14473 |
filelist3 = filelist2 |
| 14474 |
goto cont11 |
| 14475 |
end |
| 14476 |
_L[303]("You may want to use --makeglossaries option.") |
| 14477 |
filelist3 = filelist2 |
| 14478 |
goto cont11 |
| 14479 |
::else2:: |
| 14480 |
if exp4.tag == "SOME" then |
| 14481 |
else |
| 14482 |
_raise(_Match, "main.sml:390:33") |
| 14483 |
end |
| 14484 |
do |
| 14485 |
local makeglossaries = exp4.payload |
| 14486 |
local tmp89 = foldl(function(a) |
| 14487 |
local file = a[1] |
| 14488 |
local filelist_acc = a[2] |
| 14489 |
local tmp90 = _L[214](file.path) |
| 14490 |
if tmp90 == "glo" then |
| 14491 |
else |
| 14492 |
return filelist_acc |
| 14493 |
end |
| 14494 |
do |
| 14495 |
local tmp91 |
| 14496 |
do |
| 14497 |
local glofileinfo = {abspath = file.abspath, kind = _L[357], path = file.path} |
| 14498 |
tmp91 = _L[210].replaceext(file.abspath, "gls") |
| 14499 |
local tmp92 = _L[361]({glofileinfo, nil}, auxstatus1) |
| 14500 |
local tmp93 |
| 14501 |
if tmp92[1] then |
| 14502 |
tmp93 = true |
| 14503 |
else |
| 14504 |
tmp93 = _L[362](auxstatus1, tmp91, file.abspath) |
| 14505 |
end |
| 14506 |
if tmp93 then |
| 14507 |
else |
| 14508 |
goto else1 |
| 14509 |
end |
| 14510 |
do |
| 14511 |
local tmp94 = _L[208](tmp62) |
| 14512 |
local tmp95 = _L[211](file.path) |
| 14513 |
local tmp96 = _L[213](tmp95) |
| 14514 |
_L[526](table_concat({n = 4, makeglossaries, "-d", tmp94, tmp96}, " "), NONE) |
| 14515 |
return {{abspath = tmp91, kind = _L[357], path = tmp91}, filelist_acc} |
| 14516 |
end |
| 14517 |
end |
| 14518 |
::else1:: |
| 14519 |
do |
| 14520 |
local status, exn = _handle(function() |
| 14521 |
local tmp92, tmp93 = _L[216].touch(tmp91) |
| 14522 |
if not tmp92 then |
| 14523 |
else |
| 14524 |
return nil |
| 14525 |
end |
| 14526 |
do |
| 14527 |
local tmp94 = _Error(tmp93) |
| 14528 |
_raise(tmp94, "fs-util.sml:28:25") |
| 14529 |
end |
| 14530 |
end) |
| 14531 |
if not status then |
| 14532 |
if __exn_instanceof(exn, _Error_tag) then |
| 14533 |
else |
| 14534 |
_raise(exn, nil) |
| 14535 |
end |
| 14536 |
do |
| 14537 |
_L[302]("Failed to touch " .. tmp91 .. " (" .. exn.payload .. ")") |
| 14538 |
return filelist_acc |
| 14539 |
end |
| 14540 |
end |
| 14541 |
end |
| 14542 |
return filelist_acc |
| 14543 |
end |
| 14544 |
end) |
| 14545 |
local tmp90 = tmp89(filelist2) |
| 14546 |
filelist3 = tmp90(filelist2) |
| 14547 |
end |
| 14548 |
end |
| 14549 |
::cont11:: |
| 14550 |
local filelist4 |
| 14551 |
do |
| 14552 |
if exp.tag == "NONE" then |
| 14553 |
else |
| 14554 |
goto else2 |
| 14555 |
end |
| 14556 |
if not tmp20(execlog, "No file [^\n]+%.bbl%.") then |
| 14557 |
filelist4 = filelist3 |
| 14558 |
goto cont12 |
| 14559 |
end |
| 14560 |
_L[303]("You may want to use --bibtex or biber option.") |
| 14561 |
filelist4 = filelist3 |
| 14562 |
goto cont12 |
| 14563 |
::else2:: |
| 14564 |
if exp.tag == "SOME" and exp.payload.tag == "BIBTEX" then |
| 14565 |
else |
| 14566 |
goto else3 |
| 14567 |
end |
| 14568 |
do |
| 14569 |
local bibtex, bibtex_aux_hash2 |
| 14570 |
do |
| 14571 |
bibtex = exp.payload.payload |
| 14572 |
local biblines2 |
| 14573 |
do |
| 14574 |
local tmp89 = _L[353](tmp87, tmp62, nil) |
| 14575 |
biblines2 = revAppend(tmp89, nil) |
| 14576 |
end |
| 14577 |
local tmp89 = biblines2 == nil |
| 14578 |
do |
| 14579 |
if tmp89 then |
| 14580 |
bibtex_aux_hash2 = NONE |
| 14581 |
goto cont13 |
| 14582 |
end |
| 14583 |
local tmp90 = _L[191](table_concat(_VectorOrArray_fromList(biblines2), "\n")) |
| 14584 |
bibtex_aux_hash2 = {tag = "SOME", payload = tmp90} |
| 14585 |
end |
| 14586 |
end |
| 14587 |
::cont13:: |
| 14588 |
local tmp89, tmp90 |
| 14589 |
do |
| 14590 |
local tmp91 = tmp58 .. "." .. "bbl" |
| 14591 |
tmp89 = _L[210].join(tmp62, tmp91) |
| 14592 |
local tmp92 = tmp(function(a) |
| 14593 |
local x = a[1] |
| 14594 |
local y = a[2] |
| 14595 |
return x[4] == y[4] and (x[3] == y[3] and (x[2] == y[2] and x[1] == y[1])) |
| 14596 |
end) |
| 14597 |
local tmp93 |
| 14598 |
do |
| 14599 |
local tmp94 = tmp92({bibtex_aux_hash, bibtex_aux_hash2}) |
| 14600 |
tmp93 = not tmp94 |
| 14601 |
end |
| 14602 |
do |
| 14603 |
if tmp93 then |
| 14604 |
tmp90 = true |
| 14605 |
goto cont14 |
| 14606 |
end |
| 14607 |
local tmp94 = _L[215](NONE, tmp87) |
| 14608 |
tmp90 = _L[362](auxstatus1, tmp89, tmp94) |
| 14609 |
end |
| 14610 |
end |
| 14611 |
::cont14:: |
| 14612 |
if tmp90 then |
| 14613 |
else |
| 14614 |
goto else4 |
| 14615 |
end |
| 14616 |
do |
| 14617 |
local tmp91 = _L[208](tmp62) |
| 14618 |
local tmp92 = _L[211](tmp87) |
| 14619 |
_L[526](table_concat({n = 5, "cd", tmp91, "&&", bibtex, tmp92}, " "), NONE) |
| 14620 |
filelist4 = filelist3 |
| 14621 |
goto cont12 |
| 14622 |
end |
| 14623 |
::else4:: |
| 14624 |
do |
| 14625 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 14626 |
else |
| 14627 |
goto cont15 |
| 14628 |
end |
| 14629 |
_L[304]("No need to run BibTeX.") |
| 14630 |
end |
| 14631 |
::cont15:: |
| 14632 |
do |
| 14633 |
local status, exn = _handle(function() |
| 14634 |
local tmp91, tmp92 = _L[216].touch(tmp89) |
| 14635 |
if not tmp91 then |
| 14636 |
else |
| 14637 |
return nil |
| 14638 |
end |
| 14639 |
do |
| 14640 |
local tmp93 = _Error(tmp92) |
| 14641 |
_raise(tmp93, "fs-util.sml:28:25") |
| 14642 |
end |
| 14643 |
end) |
| 14644 |
if not status then |
| 14645 |
if __exn_instanceof(exn, _Error_tag) then |
| 14646 |
else |
| 14647 |
_raise(exn, nil) |
| 14648 |
end |
| 14649 |
do |
| 14650 |
local err = exn.payload |
| 14651 |
_L[302]("Failed to touch " .. tmp89 .. " (" .. err .. ")") |
| 14652 |
filelist4 = filelist3 |
| 14653 |
goto cont12 |
| 14654 |
end |
| 14655 |
end |
| 14656 |
end |
| 14657 |
filelist4 = filelist3 |
| 14658 |
goto cont12 |
| 14659 |
end |
| 14660 |
::else3:: |
| 14661 |
if exp.tag == "SOME" and exp.payload.tag == "BIBER" then |
| 14662 |
else |
| 14663 |
_raise(_Match, "main.sml:424:33") |
| 14664 |
end |
| 14665 |
do |
| 14666 |
local biber = exp.payload.payload |
| 14667 |
local tmp89 = foldl(function(a) |
| 14668 |
local file = a[1] |
| 14669 |
local filelist_acc = a[2] |
| 14670 |
local tmp90 = _L[214](file.path) |
| 14671 |
if tmp90 == "bcf" then |
| 14672 |
else |
| 14673 |
return filelist_acc |
| 14674 |
end |
| 14675 |
do |
| 14676 |
local bcffileinfo = {abspath = file.abspath, kind = _L[357], path = file.path} |
| 14677 |
local tmp91 = _L[210].replaceext(file.abspath, "bbl") |
| 14678 |
local updated_dot_bib |
| 14679 |
do |
| 14680 |
local ins = _L[115](file.abspath) |
| 14681 |
local tmp92 = false |
| 14682 |
::cont2:: |
| 14683 |
do |
| 14684 |
local a1 = tmp92 |
| 14685 |
local exp7 = _L[114](ins) |
| 14686 |
if exp7.tag == "NONE" then |
| 14687 |
else |
| 14688 |
goto else2 |
| 14689 |
end |
| 14690 |
_L[120](ins) |
| 14691 |
updated_dot_bib = a1 |
| 14692 |
goto cont |
| 14693 |
::else2:: |
| 14694 |
if exp7.tag == "SOME" then |
| 14695 |
else |
| 14696 |
_raise(_Match, "main.sml:470:65") |
| 14697 |
end |
| 14698 |
do |
| 14699 |
local tmp93 |
| 14700 |
do |
| 14701 |
local tmp94 = tmp22(exp7.payload, "<bcf:datasource .*>(.*)</bcf:datasource>") |
| 14702 |
if not tmp94 then |
| 14703 |
tmp92 = a1 |
| 14704 |
goto cont2 |
| 14705 |
end |
| 14706 |
tmp93 = _L[210].join(original_wd, tmp94) |
| 14707 |
local tmp95 = _L[218](tmp93) |
| 14708 |
if tmp95 then |
| 14709 |
else |
| 14710 |
goto else3 |
| 14711 |
end |
| 14712 |
do |
| 14713 |
local tmp96 = _L[215](NONE, tmp87) |
| 14714 |
local tmp97 = _L[362](auxstatus1, tmp93, tmp96) |
| 14715 |
local tmp98 = not tmp97 |
| 14716 |
if tmp98 then |
| 14717 |
else |
| 14718 |
tmp92 = a1 or tmp98 |
| 14719 |
goto cont2 |
| 14720 |
end |
| 14721 |
_L[304](tmp93 .. " is newer than aux") |
| 14722 |
tmp92 = a1 or tmp98 |
| 14723 |
goto cont2 |
| 14724 |
end |
| 14725 |
end |
| 14726 |
::else3:: |
| 14727 |
_L[302](tmp93 .. " is not accessible") |
| 14728 |
tmp92 = a1 |
| 14729 |
goto cont2 |
| 14730 |
end |
| 14731 |
end |
| 14732 |
end |
| 14733 |
::cont:: |
| 14734 |
local tmp92 |
| 14735 |
do |
| 14736 |
if updated_dot_bib then |
| 14737 |
tmp92 = true |
| 14738 |
goto cont1 |
| 14739 |
end |
| 14740 |
local tmp93 = _L[361]({bcffileinfo, nil}, auxstatus1) |
| 14741 |
if tmp93[1] then |
| 14742 |
tmp92 = true |
| 14743 |
else |
| 14744 |
tmp92 = _L[362](auxstatus1, tmp91, file.abspath) |
| 14745 |
end |
| 14746 |
end |
| 14747 |
::cont1:: |
| 14748 |
if tmp92 then |
| 14749 |
else |
| 14750 |
goto else1 |
| 14751 |
end |
| 14752 |
do |
| 14753 |
local tmp93 = _L[208](tmp62) |
| 14754 |
local tmp94 = _L[211](file.abspath) |
| 14755 |
_L[526](table_concat({n = 4, biber, "--output-directory", tmp93, tmp94}, " "), NONE) |
| 14756 |
return {{abspath = tmp91, kind = _L[357], path = tmp91}, filelist3} |
| 14757 |
end |
| 14758 |
::else1:: |
| 14759 |
do |
| 14760 |
local status, exn = _handle(function() |
| 14761 |
local tmp93, tmp94 = _L[216].touch(tmp91) |
| 14762 |
if not tmp93 then |
| 14763 |
else |
| 14764 |
return nil |
| 14765 |
end |
| 14766 |
do |
| 14767 |
local tmp95 = _Error(tmp94) |
| 14768 |
_raise(tmp95, "fs-util.sml:28:25") |
| 14769 |
end |
| 14770 |
end) |
| 14771 |
if not status then |
| 14772 |
if __exn_instanceof(exn, _Error_tag) then |
| 14773 |
else |
| 14774 |
_raise(exn, nil) |
| 14775 |
end |
| 14776 |
do |
| 14777 |
_L[302]("Failed to touch " .. tmp91 .. " (" .. exn.payload .. ")") |
| 14778 |
return filelist_acc |
| 14779 |
end |
| 14780 |
end |
| 14781 |
end |
| 14782 |
return filelist_acc |
| 14783 |
end |
| 14784 |
end) |
| 14785 |
local tmp90 = tmp89(filelist3) |
| 14786 |
filelist4 = tmp90(filelist3) |
| 14787 |
end |
| 14788 |
end |
| 14789 |
::cont12:: |
| 14790 |
local tmp89 = _L[49]("No pages of output.") |
| 14791 |
local tmp90 = tmp89(execlog) |
| 14792 |
if tmp90 then |
| 14793 |
exp6 = _L[528] |
| 14794 |
goto cont2 |
| 14795 |
end |
| 14796 |
local exp7 = _L[361](filelist4, auxstatus1) |
| 14797 |
local should_rerun = exp7[1] |
| 14798 |
local auxstatus2 = exp7[2] |
| 14799 |
local tmp91 |
| 14800 |
tmp91 = should_rerun or lightweight_mode |
| 14801 |
if tmp91 then |
| 14802 |
exp6 = {tag = "SHOULD_RERUN", payload = auxstatus2} |
| 14803 |
else |
| 14804 |
exp6 = _L[527] |
| 14805 |
end |
| 14806 |
end |
| 14807 |
end |
| 14808 |
::cont2:: |
| 14809 |
if exp6.tag == "NO_PAGES_OF_OUTPUT" then |
| 14810 |
else |
| 14811 |
goto else1 |
| 14812 |
end |
| 14813 |
_L[302]("No pages of output.") |
| 14814 |
tmp83 = false |
| 14815 |
goto cont |
| 14816 |
::else1:: |
| 14817 |
if exp6.tag == "NO_NEED_TO_RERUN" then |
| 14818 |
tmp83 = true |
| 14819 |
goto cont |
| 14820 |
end |
| 14821 |
if exp6.tag == "SHOULD_RERUN" then |
| 14822 |
else |
| 14823 |
_raise(_Match, "main.sml:533:20") |
| 14824 |
end |
| 14825 |
do |
| 14826 |
local auxstatus = exp6.payload |
| 14827 |
if tmp86 >= tmp60 then |
| 14828 |
else |
| 14829 |
tmp84 = tmp86 |
| 14830 |
tmp85 = auxstatus |
| 14831 |
goto cont1 |
| 14832 |
end |
| 14833 |
_L[302]("LaTeX should be run once more.") |
| 14834 |
tmp83 = true |
| 14835 |
end |
| 14836 |
end |
| 14837 |
end |
| 14838 |
::cont:: |
| 14839 |
if tmp83 then |
| 14840 |
else |
| 14841 |
return nil |
| 14842 |
end |
| 14843 |
do |
| 14844 |
do |
| 14845 |
local tmp84 = _L[232](tmp63, _L[231]) |
| 14846 |
local tmp85 |
| 14847 |
tmp85 = tmp84 or tmp56 |
| 14848 |
do |
| 14849 |
if tmp85 then |
| 14850 |
else |
| 14851 |
goto else1 |
| 14852 |
end |
| 14853 |
do |
| 14854 |
local tmp86 = tmp58 .. "." .. output_extension |
| 14855 |
local tmp87 = _L[210].join(tmp62, tmp86) |
| 14856 |
local onCopyError |
| 14857 |
if _L[220] then |
| 14858 |
onCopyError = {tag = "SOME", payload = function(a) |
| 14859 |
local output_format |
| 14860 |
if tmp63 == "DVI" then |
| 14861 |
output_format = "DVI" |
| 14862 |
elseif tmp63 == "PDF" then |
| 14863 |
output_format = "PDF" |
| 14864 |
else |
| 14865 |
_raise(_Match, "main.sml:551:85") |
| 14866 |
end |
| 14867 |
_L[301]("Failed to copy file. Some applications may be locking the " .. output_format .. " file.") |
| 14868 |
return false |
| 14869 |
end} |
| 14870 |
else |
| 14871 |
onCopyError = NONE |
| 14872 |
end |
| 14873 |
_L[526](_L[217].copy_command(tmp87, tmp61), onCopyError) |
| 14874 |
if tmp57 == nil then |
| 14875 |
goto cont1 |
| 14876 |
end |
| 14877 |
_L[302]("--dvipdfmx-option[s] are ignored.") |
| 14878 |
goto cont1 |
| 14879 |
end |
| 14880 |
::else1:: |
| 14881 |
local tmp86 = tmp58 .. "." .. "dvi" |
| 14882 |
local tmp87 = _L[210].join(tmp62, tmp86) |
| 14883 |
local tmp88 = _L[208](tmp61) |
| 14884 |
local tmp89 = _L[208](tmp87) |
| 14885 |
local tmp90 = {tmp89, nil} |
| 14886 |
local tmp91 |
| 14887 |
do |
| 14888 |
local tmp92 = revAppend(tmp57, nil) |
| 14889 |
tmp91 = revAppend(tmp92, tmp90) |
| 14890 |
end |
| 14891 |
_L[526](table_concat(_VectorOrArray_fromList({"dvipdfmx", {"-o", {tmp88, tmp91}}}), " "), NONE) |
| 14892 |
end |
| 14893 |
end |
| 14894 |
::cont1:: |
| 14895 |
do |
| 14896 |
local tmp84 = _L[232](tmp63, _L[230]) |
| 14897 |
do |
| 14898 |
if tmp84 then |
| 14899 |
else |
| 14900 |
goto cont2 |
| 14901 |
end |
| 14902 |
do |
| 14903 |
local tmp85 = getOpt(tmp69, "0") |
| 14904 |
local tmp86 = tmp4(tmp85) |
| 14905 |
local synctex_ext |
| 14906 |
if tmp86 > 0 then |
| 14907 |
synctex_ext = {tag = "SOME", payload = "synctex.gz"} |
| 14908 |
elseif tmp86 < 0 then |
| 14909 |
synctex_ext = {tag = "SOME", payload = "synctex"} |
| 14910 |
else |
| 14911 |
synctex_ext = NONE |
| 14912 |
end |
| 14913 |
if synctex_ext.tag == "SOME" then |
| 14914 |
elseif synctex_ext.tag == "NONE" then |
| 14915 |
goto cont2 |
| 14916 |
else |
| 14917 |
_raise(_Match, "main.sml:583:23") |
| 14918 |
end |
| 14919 |
do |
| 14920 |
local ext = synctex_ext.payload |
| 14921 |
local tmp87 = tmp58 .. "." .. ext |
| 14922 |
local tmp88 = _L[210].join(tmp62, tmp87) |
| 14923 |
local tmp89 = _L[210].replaceext(tmp61, ext) |
| 14924 |
_L[526](_L[217].copy_command(tmp88, tmp89), NONE) |
| 14925 |
end |
| 14926 |
end |
| 14927 |
end |
| 14928 |
end |
| 14929 |
::cont2:: |
| 14930 |
do |
| 14931 |
if exp3.tag == "SOME" then |
| 14932 |
elseif exp3.tag == "NONE" then |
| 14933 |
goto cont3 |
| 14934 |
else |
| 14935 |
_raise(_Match, "main.sml:590:16") |
| 14936 |
end |
| 14937 |
do |
| 14938 |
local make_depends, recorded, tmp84 |
| 14939 |
do |
| 14940 |
make_depends = exp3.payload |
| 14941 |
recorded = _L[360](recorderfile, tmp59, nil, _L[203]) |
| 14942 |
local tmp85 = _L[237](engine_type, _L[235]) |
| 14943 |
do |
| 14944 |
if tmp85 then |
| 14945 |
else |
| 14946 |
tmp84 = false |
| 14947 |
goto cont4 |
| 14948 |
end |
| 14949 |
tmp84 = _L[218](recorderfile2) |
| 14950 |
end |
| 14951 |
end |
| 14952 |
::cont4:: |
| 14953 |
local recorded1 |
| 14954 |
do |
| 14955 |
if tmp84 then |
| 14956 |
else |
| 14957 |
recorded1 = recorded |
| 14958 |
goto cont5 |
| 14959 |
end |
| 14960 |
do |
| 14961 |
local fileList = recorded[1] |
| 14962 |
recorded1 = _L[360](recorderfile2, tmp59, fileList, recorded[2]) |
| 14963 |
end |
| 14964 |
end |
| 14965 |
::cont5:: |
| 14966 |
local filelist, outs |
| 14967 |
do |
| 14968 |
local exp6 |
| 14969 |
do |
| 14970 |
local fileInfo = recorded1[1] |
| 14971 |
exp6 = _L[359](fileInfo, recorded1[2]) |
| 14972 |
end |
| 14973 |
filelist = exp6[1] |
| 14974 |
do |
| 14975 |
local tmp85, tmp86 = tmp7(make_depends, "w") |
| 14976 |
if tmp85 == nil then |
| 14977 |
else |
| 14978 |
local tmp87 = _L[113].mkOutstream |
| 14979 |
outs = tmp87({tag = "LUA_WRITABLE", payload = {buffer_mode = {_L[16]}, name = make_depends, writable = tmp85}}) |
| 14980 |
goto cont6 |
| 14981 |
end |
| 14982 |
do |
| 14983 |
local tmp87 = _Fail(tmp86) |
| 14984 |
_raise({tag = _L[9], payload = {cause = tmp87, ["function"] = "TextIO.openOut", name = make_depends}}, "text-io.sml:493:27") |
| 14985 |
end |
| 14986 |
end |
| 14987 |
end |
| 14988 |
::cont6:: |
| 14989 |
_L[124]({outs, tmp61 .. ":"}) |
| 14990 |
local tmp85 = app1(function(a) |
| 14991 |
if a.kind == "INPUT" then |
| 14992 |
else |
| 14993 |
return nil |
| 14994 |
end |
| 14995 |
do |
| 14996 |
return _L[124]({outs, " " .. a.path}) |
| 14997 |
end |
| 14998 |
end) |
| 14999 |
tmp85(filelist) |
| 15000 |
_L[124]({outs, "\n"}) |
| 15001 |
_L[121](outs) |
| 15002 |
end |
| 15003 |
end |
| 15004 |
::cont3:: |
| 15005 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 15006 |
else |
| 15007 |
return nil |
| 15008 |
end |
| 15009 |
do |
| 15010 |
return _L[304]("Command exited successfully") |
| 15011 |
end |
| 15012 |
end |
| 15013 |
end |
| 15014 |
_L[530] = function(a, a1) |
| 15015 |
local tmp54 = assert(a.new()) |
| 15016 |
local tmp55 = app1(function(file) |
| 15017 |
assert(tmp54:add(file)) |
| 15018 |
return nil |
| 15019 |
end) |
| 15020 |
tmp55(a1) |
| 15021 |
local tmp56 = assert(tmp54:next()) |
| 15022 |
if _ENV.CLUTTEX_VERBOSITY >= 2 then |
| 15023 |
else |
| 15024 |
tmp54:close() |
| 15025 |
return true |
| 15026 |
end |
| 15027 |
do |
| 15028 |
local tmp57 = tmp56.action .. " " |
| 15029 |
_L[304](tmp57 .. tmp56.path) |
| 15030 |
tmp54:close() |
| 15031 |
return true |
| 15032 |
end |
| 15033 |
end |
| 15034 |
_L[531] = function(a) |
| 15035 |
local tmp54 |
| 15036 |
do |
| 15037 |
local tmp55 = map(_L[208]) |
| 15038 |
local tmp56 = tmp55(a) |
| 15039 |
tmp54 = table_concat(_VectorOrArray_fromList({"fswatch", {"--one-event", {"--event=Updated", {"--", tmp56}}}}), " ") |
| 15040 |
do |
| 15041 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 15042 |
else |
| 15043 |
goto cont |
| 15044 |
end |
| 15045 |
_L[300](tmp54) |
| 15046 |
end |
| 15047 |
end |
| 15048 |
::cont:: |
| 15049 |
local tmp55 = assert(tmp8(tmp54, "r")) |
| 15050 |
local tmp56 = tmp55:lines() |
| 15051 |
::cont1:: |
| 15052 |
do |
| 15053 |
local tmp57 = tmp56() |
| 15054 |
if not tmp57 then |
| 15055 |
tmp55:close() |
| 15056 |
return false |
| 15057 |
end |
| 15058 |
local tmp58 = exists(function(path) |
| 15059 |
return tmp57 == path |
| 15060 |
end) |
| 15061 |
local tmp59 = tmp58(a) |
| 15062 |
if tmp59 then |
| 15063 |
tmp55:close() |
| 15064 |
return true |
| 15065 |
else |
| 15066 |
goto cont1 |
| 15067 |
end |
| 15068 |
end |
| 15069 |
end |
| 15070 |
_L[532] = function(a) |
| 15071 |
local tmp54 |
| 15072 |
do |
| 15073 |
local tmp55 = map(_L[208]) |
| 15074 |
local tmp56 = tmp55(a) |
| 15075 |
tmp54 = table_concat(_VectorOrArray_fromList({"inotifywait", {"--event=modify", {"--event=attrib", {"--format=%w", {"--quiet", tmp56}}}}}), " ") |
| 15076 |
do |
| 15077 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 15078 |
else |
| 15079 |
goto cont |
| 15080 |
end |
| 15081 |
_L[300](tmp54) |
| 15082 |
end |
| 15083 |
end |
| 15084 |
::cont:: |
| 15085 |
local tmp55 = assert(tmp8(tmp54, "r")) |
| 15086 |
local tmp56 = tmp55:lines() |
| 15087 |
::cont1:: |
| 15088 |
do |
| 15089 |
local tmp57 = tmp56() |
| 15090 |
if not tmp57 then |
| 15091 |
tmp55:close() |
| 15092 |
return false |
| 15093 |
end |
| 15094 |
local tmp58 = exists(function(path) |
| 15095 |
return tmp57 == path |
| 15096 |
end) |
| 15097 |
local tmp59 = tmp58(a) |
| 15098 |
if tmp59 then |
| 15099 |
tmp55:close() |
| 15100 |
return true |
| 15101 |
else |
| 15102 |
goto cont1 |
| 15103 |
end |
| 15104 |
end |
| 15105 |
end |
| 15106 |
do |
| 15107 |
do |
| 15108 |
_L[534] = #_L[154] |
| 15109 |
_L[533] = tabulate(_L[534], function(i) |
| 15110 |
return _L[154][_Int_add(i, 1)] |
| 15111 |
end) |
| 15112 |
end |
| 15113 |
do |
| 15114 |
_L[536], _L[537] = _L[349], _L[533] |
| 15115 |
::cont18:: |
| 15116 |
do |
| 15117 |
local _L1 = {} |
| 15118 |
_L1[1], _L1[2] = _L[536], _L[537] |
| 15119 |
do |
| 15120 |
if _L1[2] == nil then |
| 15121 |
_L1[3] = NONE |
| 15122 |
goto cont19 |
| 15123 |
end |
| 15124 |
_L1[4] = _L[525] |
| 15125 |
::cont20:: |
| 15126 |
do |
| 15127 |
local _L2 = {} |
| 15128 |
_L2[1] = _L1[4] |
| 15129 |
if _L2[1] == nil then |
| 15130 |
_L1[3] = NONE |
| 15131 |
goto cont19 |
| 15132 |
end |
| 15133 |
if _L2[1] ~= nil then |
| 15134 |
else |
| 15135 |
_raise(_Match, "handle-options.sml:63:41") |
| 15136 |
end |
| 15137 |
do |
| 15138 |
_L2[2] = _L2[1][1] |
| 15139 |
_L2[3] = _L2[1][2] |
| 15140 |
do |
| 15141 |
_L2[5] = _L2[2][1] |
| 15142 |
_L2[6] = _L2[2][2] |
| 15143 |
if _L1[2] == nil then |
| 15144 |
_L2[4] = NONE |
| 15145 |
goto cont21 |
| 15146 |
end |
| 15147 |
_L2[7] = _L2[5].tag == "SHORT" and _L2[6].tag == "SIMPLE" |
| 15148 |
_L2[8] = _L2[7] and _L1[2] ~= nil |
| 15149 |
if _L2[8] then |
| 15150 |
_L2[9] = _L2[5].payload |
| 15151 |
_L2[10] = _L2[6].payload |
| 15152 |
_L2[11] = _L1[2][1] |
| 15153 |
_L2[12] = _L1[2][2] |
| 15154 |
if _L2[11] == _L2[9] then |
| 15155 |
_L2[4] = {tag = "SOME", payload = {_L2[10], _L2[12]}} |
| 15156 |
goto cont21 |
| 15157 |
else |
| 15158 |
_L2[4] = NONE |
| 15159 |
goto cont21 |
| 15160 |
end |
| 15161 |
end |
| 15162 |
_L2[13] = _L2[5].tag == "SHORT" and _L2[6].tag == "WITH_ARG" |
| 15163 |
_L2[14] = _L2[13] and _L1[2] ~= nil |
| 15164 |
if _L2[14] then |
| 15165 |
else |
| 15166 |
goto else33 |
| 15167 |
end |
| 15168 |
do |
| 15169 |
_L2[15] = _L2[5].payload |
| 15170 |
_L2[16] = _L2[6].payload |
| 15171 |
_L2[17] = _L1[2][1] |
| 15172 |
_L2[18] = _L1[2][2] |
| 15173 |
if _L2[17] == _L2[15] then |
| 15174 |
else |
| 15175 |
goto else36 |
| 15176 |
end |
| 15177 |
do |
| 15178 |
if _L2[18] == nil then |
| 15179 |
else |
| 15180 |
goto else37 |
| 15181 |
end |
| 15182 |
do |
| 15183 |
_L2[19] = _Fail("argument missing after " .. _L2[15]) |
| 15184 |
_raise(_L2[19], "handle-options.sml:21:21") |
| 15185 |
end |
| 15186 |
::else37:: |
| 15187 |
if _L2[18] ~= nil then |
| 15188 |
else |
| 15189 |
_raise(_Match, "handle-options.sml:20:11") |
| 15190 |
end |
| 15191 |
do |
| 15192 |
_L2[20] = _L2[18][1] |
| 15193 |
_L2[21] = _L2[18][2] |
| 15194 |
_L2[22] = _L2[16](_L2[20]) |
| 15195 |
_L2[4] = {tag = "SOME", payload = {_L2[22], _L2[21]}} |
| 15196 |
goto cont21 |
| 15197 |
end |
| 15198 |
end |
| 15199 |
::else36:: |
| 15200 |
_L2[23] = isPrefix(_L2[15]) |
| 15201 |
_L2[24] = _L2[23](_L2[17]) |
| 15202 |
if _L2[24] then |
| 15203 |
else |
| 15204 |
_L2[4] = NONE |
| 15205 |
goto cont21 |
| 15206 |
end |
| 15207 |
do |
| 15208 |
_L2[25] = extract(_L2[17], #_L2[15], NONE) |
| 15209 |
_L2[26] = _L2[16](_L2[25]) |
| 15210 |
_L2[4] = {tag = "SOME", payload = {_L2[26], _L2[18]}} |
| 15211 |
goto cont21 |
| 15212 |
end |
| 15213 |
end |
| 15214 |
::else33:: |
| 15215 |
_L2[27] = _L2[5].tag == "SHORT" and _L2[6].tag == "WITH_OPTIONAL_ARG" |
| 15216 |
_L2[28] = _L2[27] and _L1[2] ~= nil |
| 15217 |
if _L2[28] then |
| 15218 |
else |
| 15219 |
goto else34 |
| 15220 |
end |
| 15221 |
do |
| 15222 |
_L2[29] = _L2[5].payload |
| 15223 |
_L2[30] = _L2[6].payload.default |
| 15224 |
_L2[31] = _L2[6].payload.action |
| 15225 |
_L2[32] = _L1[2][1] |
| 15226 |
_L2[33] = _L1[2][2] |
| 15227 |
if _L2[32] == _L2[29] then |
| 15228 |
else |
| 15229 |
goto else36 |
| 15230 |
end |
| 15231 |
do |
| 15232 |
_L2[34] = _L2[31](_L2[30]) |
| 15233 |
_L2[4] = {tag = "SOME", payload = {_L2[34], _L2[33]}} |
| 15234 |
goto cont21 |
| 15235 |
end |
| 15236 |
::else36:: |
| 15237 |
_L2[35] = isPrefix(_L2[29]) |
| 15238 |
_L2[36] = _L2[35](_L2[32]) |
| 15239 |
if _L2[36] then |
| 15240 |
else |
| 15241 |
_L2[4] = NONE |
| 15242 |
goto cont21 |
| 15243 |
end |
| 15244 |
do |
| 15245 |
_L2[37] = extract(_L2[32], #_L2[29], NONE) |
| 15246 |
_L2[38] = _L2[31](_L2[37]) |
| 15247 |
_L2[4] = {tag = "SOME", payload = {_L2[38], _L2[33]}} |
| 15248 |
goto cont21 |
| 15249 |
end |
| 15250 |
end |
| 15251 |
::else34:: |
| 15252 |
_L2[39] = _L2[5].tag == "LONG" and _L2[6].tag == "SIMPLE" |
| 15253 |
_L2[40] = _L2[39] and _L1[2] ~= nil |
| 15254 |
if _L2[40] then |
| 15255 |
_L2[41] = _L2[5].payload |
| 15256 |
_L2[42] = _L2[6].payload |
| 15257 |
_L2[43] = _L1[2][1] |
| 15258 |
_L2[44] = _L1[2][2] |
| 15259 |
if _L2[43] == _L2[41] then |
| 15260 |
_L2[4] = {tag = "SOME", payload = {_L2[42], _L2[44]}} |
| 15261 |
goto cont21 |
| 15262 |
else |
| 15263 |
_L2[4] = NONE |
| 15264 |
goto cont21 |
| 15265 |
end |
| 15266 |
end |
| 15267 |
_L2[45] = _L2[5].tag == "LONG" and _L2[6].tag == "WITH_ARG" |
| 15268 |
_L2[46] = _L2[45] and _L1[2] ~= nil |
| 15269 |
if _L2[46] then |
| 15270 |
else |
| 15271 |
goto else35 |
| 15272 |
end |
| 15273 |
do |
| 15274 |
_L2[47] = _L2[5].payload |
| 15275 |
_L2[48] = _L2[6].payload |
| 15276 |
_L2[49] = _L1[2][1] |
| 15277 |
_L2[50] = _L1[2][2] |
| 15278 |
if _L2[49] == _L2[47] then |
| 15279 |
else |
| 15280 |
goto else36 |
| 15281 |
end |
| 15282 |
do |
| 15283 |
if _L2[50] == nil then |
| 15284 |
else |
| 15285 |
goto else37 |
| 15286 |
end |
| 15287 |
do |
| 15288 |
_L2[51] = _Fail("argument missing after " .. _L2[47]) |
| 15289 |
_raise(_L2[51], "handle-options.sml:45:21") |
| 15290 |
end |
| 15291 |
::else37:: |
| 15292 |
if _L2[50] ~= nil then |
| 15293 |
else |
| 15294 |
_raise(_Match, "handle-options.sml:44:11") |
| 15295 |
end |
| 15296 |
do |
| 15297 |
_L2[52] = _L2[50][1] |
| 15298 |
_L2[53] = _L2[50][2] |
| 15299 |
_L2[54] = _L2[48](_L2[52]) |
| 15300 |
_L2[4] = {tag = "SOME", payload = {_L2[54], _L2[53]}} |
| 15301 |
goto cont21 |
| 15302 |
end |
| 15303 |
end |
| 15304 |
::else36:: |
| 15305 |
_L2[55] = isPrefix(_L2[47] .. "=") |
| 15306 |
_L2[56] = _L2[55](_L2[49]) |
| 15307 |
if _L2[56] then |
| 15308 |
else |
| 15309 |
_L2[4] = NONE |
| 15310 |
goto cont21 |
| 15311 |
end |
| 15312 |
do |
| 15313 |
_L2[57] = extract(_L2[49], _Int_add(#_L2[47], 1), NONE) |
| 15314 |
_L2[58] = _L2[48](_L2[57]) |
| 15315 |
_L2[4] = {tag = "SOME", payload = {_L2[58], _L2[50]}} |
| 15316 |
goto cont21 |
| 15317 |
end |
| 15318 |
end |
| 15319 |
::else35:: |
| 15320 |
_L2[59] = _L2[5].tag == "LONG" and _L2[6].tag == "WITH_OPTIONAL_ARG" |
| 15321 |
_L2[60] = _L2[59] and _L1[2] ~= nil |
| 15322 |
if _L2[60] then |
| 15323 |
else |
| 15324 |
_raise(_Match, "handle-options.sml:13:5") |
| 15325 |
end |
| 15326 |
do |
| 15327 |
_L2[61] = _L2[5].payload |
| 15328 |
_L2[62] = _L2[6].payload.default |
| 15329 |
_L2[63] = _L2[6].payload.action |
| 15330 |
_L2[64] = _L1[2][1] |
| 15331 |
_L2[65] = _L1[2][2] |
| 15332 |
if _L2[64] == _L2[61] then |
| 15333 |
else |
| 15334 |
goto else36 |
| 15335 |
end |
| 15336 |
do |
| 15337 |
_L2[66] = _L2[63](_L2[62]) |
| 15338 |
_L2[4] = {tag = "SOME", payload = {_L2[66], _L2[65]}} |
| 15339 |
goto cont21 |
| 15340 |
end |
| 15341 |
::else36:: |
| 15342 |
_L2[67] = isPrefix(_L2[61] .. "=") |
| 15343 |
_L2[68] = _L2[67](_L2[64]) |
| 15344 |
if _L2[68] then |
| 15345 |
else |
| 15346 |
_L2[4] = NONE |
| 15347 |
goto cont21 |
| 15348 |
end |
| 15349 |
do |
| 15350 |
_L2[69] = extract(_L2[64], _Int_add(#_L2[61], 1), NONE) |
| 15351 |
_L2[70] = _L2[63](_L2[69]) |
| 15352 |
_L2[4] = {tag = "SOME", payload = {_L2[70], _L2[65]}} |
| 15353 |
end |
| 15354 |
end |
| 15355 |
end |
| 15356 |
::cont21:: |
| 15357 |
if _L2[4].tag == "SOME" then |
| 15358 |
_L1[3] = {tag = "SOME", payload = _L2[4].payload} |
| 15359 |
elseif _L2[4].tag == "NONE" then |
| 15360 |
_L1[4] = _L2[3] |
| 15361 |
goto cont20 |
| 15362 |
else |
| 15363 |
_raise(_Match, "handle-options.sml:64:62") |
| 15364 |
end |
| 15365 |
end |
| 15366 |
end |
| 15367 |
end |
| 15368 |
::cont19:: |
| 15369 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_ENGINE" then |
| 15370 |
else |
| 15371 |
goto else2 |
| 15372 |
end |
| 15373 |
do |
| 15374 |
_L1[5] = _L1[3].payload[1].payload |
| 15375 |
_L1[6] = _L1[3].payload[2] |
| 15376 |
_L1[7] = _L1[1].engine |
| 15377 |
if _L1[7].tag == "NONE" then |
| 15378 |
_L1[8] = _L1[1].bibtex_or_biber |
| 15379 |
_L1[9] = _L1[1].change_directory |
| 15380 |
_L1[10] = _L1[1].check_driver |
| 15381 |
_L1[11] = _L1[1].color |
| 15382 |
_L1[12] = _L1[1].config_file |
| 15383 |
_L1[13] = _L1[1].dvipdfmx_extraoptions |
| 15384 |
_L1[14] = _L1[1].engine_executable |
| 15385 |
_L1[15] = _L1[1].file_line_error |
| 15386 |
_L1[16] = _L1[1].fmt |
| 15387 |
_L1[17] = _L1[1].fresh |
| 15388 |
_L1[18] = _L1[1].halt_on_error |
| 15389 |
_L1[19] = _L1[1].includeonly |
| 15390 |
_L1[20] = _L1[1].interaction |
| 15391 |
_L1[21] = _L1[1].jobname |
| 15392 |
_L1[22] = _L1[1].make_depends |
| 15393 |
_L1[23] = _L1[1].makeglossaries |
| 15394 |
_L1[24] = _L1[1].makeindex |
| 15395 |
_L1[25] = _L1[1].max_iterations |
| 15396 |
_L1[26] = _L1[1].output |
| 15397 |
_L1[27] = _L1[1].output_directory |
| 15398 |
_L1[28] = _L1[1].output_format |
| 15399 |
_L1[29] = _L1[1].package_support |
| 15400 |
_L1[30] = _L1[1].print_output_directory |
| 15401 |
_L1[31] = _L1[1].shell_escape |
| 15402 |
_L1[32] = _L1[1].source_date_epoch |
| 15403 |
_L1[33] = _L1[1].start_with_draft |
| 15404 |
_L1[34] = _L1[1].synctex |
| 15405 |
_L1[35] = _L1[1].tex_extraoptions |
| 15406 |
_L1[36] = _L1[1].watch |
| 15407 |
_L[536] = {bibtex_or_biber = _L1[8], change_directory = _L1[9], check_driver = _L1[10], color = _L1[11], config_file = _L1[12], dvipdfmx_extraoptions = _L1[13], engine = {tag = "SOME", payload = _L1[5]}, engine_executable = _L1[14], file_line_error = _L1[15], fmt = _L1[16], fresh = _L1[17], halt_on_error = _L1[18], includeonly = _L1[19], interaction = _L1[20], jobname = _L1[21], make_depends = _L1[22], makeglossaries = _L1[23], makeindex = _L1[24], max_iterations = _L1[25], output = _L1[26], output_directory = _L1[27], output_format = _L1[28], package_support = _L1[29], print_output_directory = _L1[30], shell_escape = _L1[31], source_date_epoch = _L1[32], start_with_draft = _L1[33], synctex = _L1[34], tex_extraoptions = _L1[35], watch = _L1[36]} |
| 15408 |
_L[537] = _L1[6] |
| 15409 |
goto cont18 |
| 15410 |
end |
| 15411 |
if _L1[7].tag == "SOME" then |
| 15412 |
else |
| 15413 |
_raise(_Match, "handle-options.sml:168:46") |
| 15414 |
end |
| 15415 |
_L[124]({_L[118], "multiple --engine options\n"}) |
| 15416 |
tmp15(1, true) |
| 15417 |
end |
| 15418 |
::else2:: |
| 15419 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_ENGINE_EXECUTABLE" then |
| 15420 |
else |
| 15421 |
goto else3 |
| 15422 |
end |
| 15423 |
do |
| 15424 |
_L1[37] = _L1[3].payload[1].payload |
| 15425 |
_L1[38] = _L1[3].payload[2] |
| 15426 |
_L1[39] = _L1[1].engine_executable |
| 15427 |
if _L1[39].tag == "NONE" then |
| 15428 |
_L1[40] = _L1[1].bibtex_or_biber |
| 15429 |
_L1[41] = _L1[1].change_directory |
| 15430 |
_L1[42] = _L1[1].check_driver |
| 15431 |
_L1[43] = _L1[1].color |
| 15432 |
_L1[44] = _L1[1].config_file |
| 15433 |
_L1[45] = _L1[1].dvipdfmx_extraoptions |
| 15434 |
_L1[46] = _L1[1].engine |
| 15435 |
_L1[47] = _L1[1].file_line_error |
| 15436 |
_L1[48] = _L1[1].fmt |
| 15437 |
_L1[49] = _L1[1].fresh |
| 15438 |
_L1[50] = _L1[1].halt_on_error |
| 15439 |
_L1[51] = _L1[1].includeonly |
| 15440 |
_L1[52] = _L1[1].interaction |
| 15441 |
_L1[53] = _L1[1].jobname |
| 15442 |
_L1[54] = _L1[1].make_depends |
| 15443 |
_L1[55] = _L1[1].makeglossaries |
| 15444 |
_L1[56] = _L1[1].makeindex |
| 15445 |
_L1[57] = _L1[1].max_iterations |
| 15446 |
_L1[58] = _L1[1].output |
| 15447 |
_L1[59] = _L1[1].output_directory |
| 15448 |
_L1[60] = _L1[1].output_format |
| 15449 |
_L1[61] = _L1[1].package_support |
| 15450 |
_L1[62] = _L1[1].print_output_directory |
| 15451 |
_L1[63] = _L1[1].shell_escape |
| 15452 |
_L1[64] = _L1[1].source_date_epoch |
| 15453 |
_L1[65] = _L1[1].start_with_draft |
| 15454 |
_L1[66] = _L1[1].synctex |
| 15455 |
_L1[67] = _L1[1].tex_extraoptions |
| 15456 |
_L1[68] = _L1[1].watch |
| 15457 |
_L[536] = {bibtex_or_biber = _L1[40], change_directory = _L1[41], check_driver = _L1[42], color = _L1[43], config_file = _L1[44], dvipdfmx_extraoptions = _L1[45], engine = _L1[46], engine_executable = {tag = "SOME", payload = _L1[37]}, file_line_error = _L1[47], fmt = _L1[48], fresh = _L1[49], halt_on_error = _L1[50], includeonly = _L1[51], interaction = _L1[52], jobname = _L1[53], make_depends = _L1[54], makeglossaries = _L1[55], makeindex = _L1[56], max_iterations = _L1[57], output = _L1[58], output_directory = _L1[59], output_format = _L1[60], package_support = _L1[61], print_output_directory = _L1[62], shell_escape = _L1[63], source_date_epoch = _L1[64], start_with_draft = _L1[65], synctex = _L1[66], tex_extraoptions = _L1[67], watch = _L1[68]} |
| 15458 |
_L[537] = _L1[38] |
| 15459 |
goto cont18 |
| 15460 |
end |
| 15461 |
if _L1[39].tag == "SOME" then |
| 15462 |
else |
| 15463 |
_raise(_Match, "handle-options.sml:172:61") |
| 15464 |
end |
| 15465 |
_L[124]({_L[118], "multiple --engine-executable options\n"}) |
| 15466 |
tmp15(1, true) |
| 15467 |
end |
| 15468 |
::else3:: |
| 15469 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_OUTPUT" then |
| 15470 |
else |
| 15471 |
goto else4 |
| 15472 |
end |
| 15473 |
do |
| 15474 |
_L1[69] = _L1[3].payload[1].payload |
| 15475 |
_L1[70] = _L1[3].payload[2] |
| 15476 |
_L1[71] = _L1[1].output |
| 15477 |
if _L1[71].tag == "NONE" then |
| 15478 |
_L1[72] = _L1[1].bibtex_or_biber |
| 15479 |
_L1[73] = _L1[1].change_directory |
| 15480 |
_L1[74] = _L1[1].check_driver |
| 15481 |
_L1[75] = _L1[1].color |
| 15482 |
_L1[76] = _L1[1].config_file |
| 15483 |
_L1[77] = _L1[1].dvipdfmx_extraoptions |
| 15484 |
_L1[78] = _L1[1].engine |
| 15485 |
_L1[79] = _L1[1].engine_executable |
| 15486 |
_L1[80] = _L1[1].file_line_error |
| 15487 |
_L1[81] = _L1[1].fmt |
| 15488 |
_L1[82] = _L1[1].fresh |
| 15489 |
_L1[83] = _L1[1].halt_on_error |
| 15490 |
_L1[84] = _L1[1].includeonly |
| 15491 |
_L1[85] = _L1[1].interaction |
| 15492 |
_L1[86] = _L1[1].jobname |
| 15493 |
_L1[87] = _L1[1].make_depends |
| 15494 |
_L1[88] = _L1[1].makeglossaries |
| 15495 |
_L1[89] = _L1[1].makeindex |
| 15496 |
_L1[90] = _L1[1].max_iterations |
| 15497 |
_L1[91] = _L1[1].output_directory |
| 15498 |
_L1[92] = _L1[1].output_format |
| 15499 |
_L1[93] = _L1[1].package_support |
| 15500 |
_L1[94] = _L1[1].print_output_directory |
| 15501 |
_L1[95] = _L1[1].shell_escape |
| 15502 |
_L1[96] = _L1[1].source_date_epoch |
| 15503 |
_L1[97] = _L1[1].start_with_draft |
| 15504 |
_L1[98] = _L1[1].synctex |
| 15505 |
_L1[99] = _L1[1].tex_extraoptions |
| 15506 |
_L1[100] = _L1[1].watch |
| 15507 |
_L[536] = {bibtex_or_biber = _L1[72], change_directory = _L1[73], check_driver = _L1[74], color = _L1[75], config_file = _L1[76], dvipdfmx_extraoptions = _L1[77], engine = _L1[78], engine_executable = _L1[79], file_line_error = _L1[80], fmt = _L1[81], fresh = _L1[82], halt_on_error = _L1[83], includeonly = _L1[84], interaction = _L1[85], jobname = _L1[86], make_depends = _L1[87], makeglossaries = _L1[88], makeindex = _L1[89], max_iterations = _L1[90], output = {tag = "SOME", payload = _L1[69]}, output_directory = _L1[91], output_format = _L1[92], package_support = _L1[93], print_output_directory = _L1[94], shell_escape = _L1[95], source_date_epoch = _L1[96], start_with_draft = _L1[97], synctex = _L1[98], tex_extraoptions = _L1[99], watch = _L1[100]} |
| 15508 |
_L[537] = _L1[70] |
| 15509 |
goto cont18 |
| 15510 |
end |
| 15511 |
if _L1[71].tag == "SOME" then |
| 15512 |
else |
| 15513 |
_raise(_Match, "handle-options.sml:176:46") |
| 15514 |
end |
| 15515 |
_L[124]({_L[118], "multiple --output options\n"}) |
| 15516 |
tmp15(1, true) |
| 15517 |
end |
| 15518 |
::else4:: |
| 15519 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_FRESH" then |
| 15520 |
else |
| 15521 |
goto else5 |
| 15522 |
end |
| 15523 |
do |
| 15524 |
_L1[101] = _L1[3].payload[2] |
| 15525 |
_L1[102] = _L1[1].fresh |
| 15526 |
if not _L1[102] then |
| 15527 |
_L1[103] = _L1[1].bibtex_or_biber |
| 15528 |
_L1[104] = _L1[1].change_directory |
| 15529 |
_L1[105] = _L1[1].check_driver |
| 15530 |
_L1[106] = _L1[1].color |
| 15531 |
_L1[107] = _L1[1].config_file |
| 15532 |
_L1[108] = _L1[1].dvipdfmx_extraoptions |
| 15533 |
_L1[109] = _L1[1].engine |
| 15534 |
_L1[110] = _L1[1].engine_executable |
| 15535 |
_L1[111] = _L1[1].file_line_error |
| 15536 |
_L1[112] = _L1[1].fmt |
| 15537 |
_L1[113] = _L1[1].halt_on_error |
| 15538 |
_L1[114] = _L1[1].includeonly |
| 15539 |
_L1[115] = _L1[1].interaction |
| 15540 |
_L1[116] = _L1[1].jobname |
| 15541 |
_L1[117] = _L1[1].make_depends |
| 15542 |
_L1[118] = _L1[1].makeglossaries |
| 15543 |
_L1[119] = _L1[1].makeindex |
| 15544 |
_L1[120] = _L1[1].max_iterations |
| 15545 |
_L1[121] = _L1[1].output |
| 15546 |
_L1[122] = _L1[1].output_directory |
| 15547 |
_L1[123] = _L1[1].output_format |
| 15548 |
_L1[124] = _L1[1].package_support |
| 15549 |
_L1[125] = _L1[1].print_output_directory |
| 15550 |
_L1[126] = _L1[1].shell_escape |
| 15551 |
_L1[127] = _L1[1].source_date_epoch |
| 15552 |
_L1[128] = _L1[1].start_with_draft |
| 15553 |
_L1[129] = _L1[1].synctex |
| 15554 |
_L1[130] = _L1[1].tex_extraoptions |
| 15555 |
_L[536] = {bibtex_or_biber = _L1[103], change_directory = _L1[104], check_driver = _L1[105], color = _L1[106], config_file = _L1[107], dvipdfmx_extraoptions = _L1[108], engine = _L1[109], engine_executable = _L1[110], file_line_error = _L1[111], fmt = _L1[112], fresh = true, halt_on_error = _L1[113], includeonly = _L1[114], interaction = _L1[115], jobname = _L1[116], make_depends = _L1[117], makeglossaries = _L1[118], makeindex = _L1[119], max_iterations = _L1[120], output = _L1[121], output_directory = _L1[122], output_format = _L1[123], package_support = _L1[124], print_output_directory = _L1[125], shell_escape = _L1[126], source_date_epoch = _L1[127], start_with_draft = _L1[128], synctex = _L1[129], tex_extraoptions = _L1[130], watch = _L1[1].watch} |
| 15556 |
_L[537] = _L1[101] |
| 15557 |
goto cont18 |
| 15558 |
end |
| 15559 |
if _L1[102] then |
| 15560 |
else |
| 15561 |
_raise(_Match, "handle-options.sml:180:38") |
| 15562 |
end |
| 15563 |
_L[124]({_L[118], "multiple --fresh options\n"}) |
| 15564 |
tmp15(1, true) |
| 15565 |
end |
| 15566 |
::else5:: |
| 15567 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_MAX_ITERATIONS" then |
| 15568 |
else |
| 15569 |
goto else6 |
| 15570 |
end |
| 15571 |
do |
| 15572 |
_L1[131] = _L1[3].payload[1].payload |
| 15573 |
_L1[132] = _L1[3].payload[2] |
| 15574 |
_L1[133] = _L1[1].max_iterations |
| 15575 |
if _L1[133].tag == "NONE" then |
| 15576 |
else |
| 15577 |
goto else33 |
| 15578 |
end |
| 15579 |
do |
| 15580 |
do |
| 15581 |
_L1[135] = scanString(function(a) |
| 15582 |
return function(a1) |
| 15583 |
local strm |
| 15584 |
do |
| 15585 |
local strm1 = _L[3](a, a1) |
| 15586 |
local exp = _L[7](a, strm1) |
| 15587 |
local isNegative = exp[1] |
| 15588 |
strm = exp[2] |
| 15589 |
if isNegative then |
| 15590 |
else |
| 15591 |
goto else1 |
| 15592 |
end |
| 15593 |
do |
| 15594 |
local exp1 = a(strm) |
| 15595 |
if exp1.tag == "SOME" then |
| 15596 |
elseif exp1.tag == "NONE" then |
| 15597 |
return NONE |
| 15598 |
else |
| 15599 |
_raise(_Match, "scan-num.sml:43:25") |
| 15600 |
end |
| 15601 |
do |
| 15602 |
local c = exp1.payload[1] |
| 15603 |
local strm_PRIME = exp1.payload[2] |
| 15604 |
if 48 <= c and c <= 57 then |
| 15605 |
else |
| 15606 |
return NONE |
| 15607 |
end |
| 15608 |
do |
| 15609 |
local tmp54, tmp55 |
| 15610 |
do |
| 15611 |
local tmp56 = _L[6](c) |
| 15612 |
local tmp57 = _Int_negate(tmp56) |
| 15613 |
tmp55, tmp54 = tmp57, strm_PRIME |
| 15614 |
end |
| 15615 |
::cont:: |
| 15616 |
do |
| 15617 |
local x, strm2 = tmp55, tmp54 |
| 15618 |
local exp2 = a(strm2) |
| 15619 |
if exp2.tag == "SOME" then |
| 15620 |
elseif exp2.tag == "NONE" then |
| 15621 |
return {tag = "SOME", payload = {x, strm2}} |
| 15622 |
else |
| 15623 |
_raise(_Match, "scan-num.sml:37:35") |
| 15624 |
end |
| 15625 |
do |
| 15626 |
local c1 = exp2.payload[1] |
| 15627 |
local strm_PRIME1 = exp2.payload[2] |
| 15628 |
if 48 <= c1 and c1 <= 57 then |
| 15629 |
else |
| 15630 |
return {tag = "SOME", payload = {x, strm2}} |
| 15631 |
end |
| 15632 |
do |
| 15633 |
local tmp56 = _Int_mul(10, x) |
| 15634 |
local tmp57 = _L[6](c1) |
| 15635 |
tmp55 = _Int_sub(tmp56, tmp57) |
| 15636 |
tmp54 = strm_PRIME1 |
| 15637 |
goto cont |
| 15638 |
end |
| 15639 |
end |
| 15640 |
end |
| 15641 |
end |
| 15642 |
end |
| 15643 |
end |
| 15644 |
end |
| 15645 |
::else1:: |
| 15646 |
local exp = a(strm) |
| 15647 |
if exp.tag == "SOME" then |
| 15648 |
elseif exp.tag == "NONE" then |
| 15649 |
return NONE |
| 15650 |
else |
| 15651 |
_raise(_Match, "scan-num.sml:29:25") |
| 15652 |
end |
| 15653 |
do |
| 15654 |
local c = exp.payload[1] |
| 15655 |
local strm_PRIME = exp.payload[2] |
| 15656 |
if 48 <= c and c <= 57 then |
| 15657 |
else |
| 15658 |
return NONE |
| 15659 |
end |
| 15660 |
do |
| 15661 |
local tmp54, tmp55 |
| 15662 |
do |
| 15663 |
local tmp56 = _L[6](c) |
| 15664 |
tmp55, tmp54 = tmp56, strm_PRIME |
| 15665 |
end |
| 15666 |
::cont:: |
| 15667 |
do |
| 15668 |
local x, strm1 = tmp55, tmp54 |
| 15669 |
local exp1 = a(strm1) |
| 15670 |
if exp1.tag == "SOME" then |
| 15671 |
elseif exp1.tag == "NONE" then |
| 15672 |
return {tag = "SOME", payload = {x, strm1}} |
| 15673 |
else |
| 15674 |
_raise(_Match, "scan-num.sml:23:35") |
| 15675 |
end |
| 15676 |
do |
| 15677 |
local c1 = exp1.payload[1] |
| 15678 |
local strm_PRIME1 = exp1.payload[2] |
| 15679 |
if 48 <= c1 and c1 <= 57 then |
| 15680 |
else |
| 15681 |
return {tag = "SOME", payload = {x, strm1}} |
| 15682 |
end |
| 15683 |
do |
| 15684 |
local tmp56 = _Int_mul(10, x) |
| 15685 |
local tmp57 = _L[6](c1) |
| 15686 |
tmp55 = _Int_add(tmp56, tmp57) |
| 15687 |
tmp54 = strm_PRIME1 |
| 15688 |
goto cont |
| 15689 |
end |
| 15690 |
end |
| 15691 |
end |
| 15692 |
end |
| 15693 |
end |
| 15694 |
end |
| 15695 |
end) |
| 15696 |
_L1[134] = _L1[135](_L1[131]) |
| 15697 |
end |
| 15698 |
if _L1[134].tag == "SOME" then |
| 15699 |
_L1[136] = _L1[134].payload |
| 15700 |
_L1[137] = _L1[1].bibtex_or_biber |
| 15701 |
_L1[138] = _L1[1].change_directory |
| 15702 |
_L1[139] = _L1[1].check_driver |
| 15703 |
_L1[140] = _L1[1].color |
| 15704 |
_L1[141] = _L1[1].config_file |
| 15705 |
_L1[142] = _L1[1].dvipdfmx_extraoptions |
| 15706 |
_L1[143] = _L1[1].engine |
| 15707 |
_L1[144] = _L1[1].engine_executable |
| 15708 |
_L1[145] = _L1[1].file_line_error |
| 15709 |
_L1[146] = _L1[1].fmt |
| 15710 |
_L1[147] = _L1[1].fresh |
| 15711 |
_L1[148] = _L1[1].halt_on_error |
| 15712 |
_L1[149] = _L1[1].includeonly |
| 15713 |
_L1[150] = _L1[1].interaction |
| 15714 |
_L1[151] = _L1[1].jobname |
| 15715 |
_L1[152] = _L1[1].make_depends |
| 15716 |
_L1[153] = _L1[1].makeglossaries |
| 15717 |
_L1[154] = _L1[1].makeindex |
| 15718 |
_L1[155] = _L1[1].output |
| 15719 |
_L1[156] = _L1[1].output_directory |
| 15720 |
_L1[157] = _L1[1].output_format |
| 15721 |
_L1[158] = _L1[1].package_support |
| 15722 |
_L1[159] = _L1[1].print_output_directory |
| 15723 |
_L1[160] = _L1[1].shell_escape |
| 15724 |
_L1[161] = _L1[1].source_date_epoch |
| 15725 |
_L1[162] = _L1[1].start_with_draft |
| 15726 |
_L1[163] = _L1[1].synctex |
| 15727 |
_L1[164] = _L1[1].tex_extraoptions |
| 15728 |
_L1[165] = _L1[1].watch |
| 15729 |
_L[536] = {bibtex_or_biber = _L1[137], change_directory = _L1[138], check_driver = _L1[139], color = _L1[140], config_file = _L1[141], dvipdfmx_extraoptions = _L1[142], engine = _L1[143], engine_executable = _L1[144], file_line_error = _L1[145], fmt = _L1[146], fresh = _L1[147], halt_on_error = _L1[148], includeonly = _L1[149], interaction = _L1[150], jobname = _L1[151], make_depends = _L1[152], makeglossaries = _L1[153], makeindex = _L1[154], max_iterations = {tag = "SOME", payload = _L1[136]}, output = _L1[155], output_directory = _L1[156], output_format = _L1[157], package_support = _L1[158], print_output_directory = _L1[159], shell_escape = _L1[160], source_date_epoch = _L1[161], start_with_draft = _L1[162], synctex = _L1[163], tex_extraoptions = _L1[164], watch = _L1[165]} |
| 15730 |
_L[537] = _L1[132] |
| 15731 |
goto cont18 |
| 15732 |
end |
| 15733 |
if _L1[134].tag == "NONE" then |
| 15734 |
else |
| 15735 |
_raise(_Match, "handle-options.sml:185:62") |
| 15736 |
end |
| 15737 |
_L[124]({_L[118], "invalid value for --max-iterations option\n"}) |
| 15738 |
tmp15(1, true) |
| 15739 |
end |
| 15740 |
::else33:: |
| 15741 |
if _L1[133].tag == "SOME" then |
| 15742 |
else |
| 15743 |
_raise(_Match, "handle-options.sml:184:49") |
| 15744 |
end |
| 15745 |
_L[124]({_L[118], "multiple --max-iterations options\n"}) |
| 15746 |
tmp15(1, true) |
| 15747 |
end |
| 15748 |
::else6:: |
| 15749 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_START_WITH_DRAFT" then |
| 15750 |
else |
| 15751 |
goto else7 |
| 15752 |
end |
| 15753 |
do |
| 15754 |
_L1[166] = _L1[3].payload[2] |
| 15755 |
_L1[167] = _L1[1].start_with_draft |
| 15756 |
if not _L1[167] then |
| 15757 |
_L1[168] = _L1[1].bibtex_or_biber |
| 15758 |
_L1[169] = _L1[1].change_directory |
| 15759 |
_L1[170] = _L1[1].check_driver |
| 15760 |
_L1[171] = _L1[1].color |
| 15761 |
_L1[172] = _L1[1].config_file |
| 15762 |
_L1[173] = _L1[1].dvipdfmx_extraoptions |
| 15763 |
_L1[174] = _L1[1].engine |
| 15764 |
_L1[175] = _L1[1].engine_executable |
| 15765 |
_L1[176] = _L1[1].file_line_error |
| 15766 |
_L1[177] = _L1[1].fmt |
| 15767 |
_L1[178] = _L1[1].fresh |
| 15768 |
_L1[179] = _L1[1].halt_on_error |
| 15769 |
_L1[180] = _L1[1].includeonly |
| 15770 |
_L1[181] = _L1[1].interaction |
| 15771 |
_L1[182] = _L1[1].jobname |
| 15772 |
_L1[183] = _L1[1].make_depends |
| 15773 |
_L1[184] = _L1[1].makeglossaries |
| 15774 |
_L1[185] = _L1[1].makeindex |
| 15775 |
_L1[186] = _L1[1].max_iterations |
| 15776 |
_L1[187] = _L1[1].output |
| 15777 |
_L1[188] = _L1[1].output_directory |
| 15778 |
_L1[189] = _L1[1].output_format |
| 15779 |
_L1[190] = _L1[1].package_support |
| 15780 |
_L1[191] = _L1[1].print_output_directory |
| 15781 |
_L1[192] = _L1[1].shell_escape |
| 15782 |
_L1[193] = _L1[1].source_date_epoch |
| 15783 |
_L1[194] = _L1[1].synctex |
| 15784 |
_L1[195] = _L1[1].tex_extraoptions |
| 15785 |
_L[536] = {bibtex_or_biber = _L1[168], change_directory = _L1[169], check_driver = _L1[170], color = _L1[171], config_file = _L1[172], dvipdfmx_extraoptions = _L1[173], engine = _L1[174], engine_executable = _L1[175], file_line_error = _L1[176], fmt = _L1[177], fresh = _L1[178], halt_on_error = _L1[179], includeonly = _L1[180], interaction = _L1[181], jobname = _L1[182], make_depends = _L1[183], makeglossaries = _L1[184], makeindex = _L1[185], max_iterations = _L1[186], output = _L1[187], output_directory = _L1[188], output_format = _L1[189], package_support = _L1[190], print_output_directory = _L1[191], shell_escape = _L1[192], source_date_epoch = _L1[193], start_with_draft = true, synctex = _L1[194], tex_extraoptions = _L1[195], watch = _L1[1].watch} |
| 15786 |
_L[537] = _L1[166] |
| 15787 |
goto cont18 |
| 15788 |
end |
| 15789 |
if _L1[167] then |
| 15790 |
else |
| 15791 |
_raise(_Match, "handle-options.sml:191:49") |
| 15792 |
end |
| 15793 |
_L[124]({_L[118], "multiple --start-with-draft options\n"}) |
| 15794 |
tmp15(1, true) |
| 15795 |
end |
| 15796 |
::else7:: |
| 15797 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_WATCH" then |
| 15798 |
else |
| 15799 |
goto else8 |
| 15800 |
end |
| 15801 |
do |
| 15802 |
_L1[196] = _L1[3].payload[1].payload |
| 15803 |
_L1[197] = _L1[3].payload[2] |
| 15804 |
_L1[198] = _L1[1].watch |
| 15805 |
if _L1[198].tag == "NONE" then |
| 15806 |
else |
| 15807 |
goto else33 |
| 15808 |
end |
| 15809 |
do |
| 15810 |
if _L1[196] == "fswatch" then |
| 15811 |
_L1[199] = {tag = "SOME", payload = _L[343]} |
| 15812 |
elseif _L1[196] == "inotifywait" then |
| 15813 |
_L1[199] = {tag = "SOME", payload = _L[344]} |
| 15814 |
elseif _L1[196] == "auto" then |
| 15815 |
_L1[199] = {tag = "SOME", payload = _L[345]} |
| 15816 |
else |
| 15817 |
_L1[199] = NONE |
| 15818 |
end |
| 15819 |
if _L1[199].tag == "SOME" then |
| 15820 |
_L1[200] = _L1[199].payload |
| 15821 |
_L1[201] = _L1[1].bibtex_or_biber |
| 15822 |
_L1[202] = _L1[1].change_directory |
| 15823 |
_L1[203] = _L1[1].check_driver |
| 15824 |
_L1[204] = _L1[1].color |
| 15825 |
_L1[205] = _L1[1].config_file |
| 15826 |
_L1[206] = _L1[1].dvipdfmx_extraoptions |
| 15827 |
_L1[207] = _L1[1].engine |
| 15828 |
_L1[208] = _L1[1].engine_executable |
| 15829 |
_L1[209] = _L1[1].file_line_error |
| 15830 |
_L1[210] = _L1[1].fmt |
| 15831 |
_L1[211] = _L1[1].fresh |
| 15832 |
_L1[212] = _L1[1].halt_on_error |
| 15833 |
_L1[213] = _L1[1].includeonly |
| 15834 |
_L1[214] = _L1[1].interaction |
| 15835 |
_L1[215] = _L1[1].jobname |
| 15836 |
_L1[216] = _L1[1].make_depends |
| 15837 |
_L1[217] = _L1[1].makeglossaries |
| 15838 |
_L1[218] = _L1[1].makeindex |
| 15839 |
_L1[219] = _L1[1].max_iterations |
| 15840 |
_L1[220] = _L1[1].output |
| 15841 |
_L1[221] = _L1[1].output_directory |
| 15842 |
_L1[222] = _L1[1].output_format |
| 15843 |
_L1[223] = _L1[1].package_support |
| 15844 |
_L1[224] = _L1[1].print_output_directory |
| 15845 |
_L1[225] = _L1[1].shell_escape |
| 15846 |
_L1[226] = _L1[1].source_date_epoch |
| 15847 |
_L1[227] = _L1[1].start_with_draft |
| 15848 |
_L1[228] = _L1[1].synctex |
| 15849 |
_L1[229] = _L1[1].tex_extraoptions |
| 15850 |
_L[536] = {bibtex_or_biber = _L1[201], change_directory = _L1[202], check_driver = _L1[203], color = _L1[204], config_file = _L1[205], dvipdfmx_extraoptions = _L1[206], engine = _L1[207], engine_executable = _L1[208], file_line_error = _L1[209], fmt = _L1[210], fresh = _L1[211], halt_on_error = _L1[212], includeonly = _L1[213], interaction = _L1[214], jobname = _L1[215], make_depends = _L1[216], makeglossaries = _L1[217], makeindex = _L1[218], max_iterations = _L1[219], output = _L1[220], output_directory = _L1[221], output_format = _L1[222], package_support = _L1[223], print_output_directory = _L1[224], shell_escape = _L1[225], source_date_epoch = _L1[226], start_with_draft = _L1[227], synctex = _L1[228], tex_extraoptions = _L1[229], watch = {tag = "SOME", payload = _L1[200]}} |
| 15851 |
_L[537] = _L1[197] |
| 15852 |
goto cont18 |
| 15853 |
end |
| 15854 |
if _L1[199].tag == "NONE" then |
| 15855 |
else |
| 15856 |
_raise(_Match, "handle-options.sml:196:58") |
| 15857 |
end |
| 15858 |
_L[124]({_L[118], "invalid value for --watch option\n"}) |
| 15859 |
tmp15(1, true) |
| 15860 |
end |
| 15861 |
::else33:: |
| 15862 |
if _L1[198].tag == "SOME" then |
| 15863 |
else |
| 15864 |
_raise(_Match, "handle-options.sml:195:45") |
| 15865 |
end |
| 15866 |
_L[124]({_L[118], "multiple --watch options\n"}) |
| 15867 |
tmp15(1, true) |
| 15868 |
end |
| 15869 |
::else8:: |
| 15870 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_HELP" then |
| 15871 |
else |
| 15872 |
goto else9 |
| 15873 |
end |
| 15874 |
_L[535] = _L[373]() |
| 15875 |
goto cont5 |
| 15876 |
::else9:: |
| 15877 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_VERSION" then |
| 15878 |
else |
| 15879 |
goto else10 |
| 15880 |
end |
| 15881 |
_L[124]({_L[118], "cluttex v0.7.0\n"}) |
| 15882 |
tmp15(0, true) |
| 15883 |
::else10:: |
| 15884 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_VERBOSE" then |
| 15885 |
_L1[230] = _L1[3].payload[2] |
| 15886 |
_ENV.CLUTTEX_VERBOSITY = _ENV.CLUTTEX_VERBOSITY + 1 |
| 15887 |
_L[536] = _L1[1] |
| 15888 |
_L[537] = _L1[230] |
| 15889 |
goto cont18 |
| 15890 |
end |
| 15891 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_COLOR" then |
| 15892 |
else |
| 15893 |
goto else11 |
| 15894 |
end |
| 15895 |
do |
| 15896 |
_L1[231] = _L1[3].payload[1].payload |
| 15897 |
_L1[232] = _L1[3].payload[2] |
| 15898 |
_L1[233] = _L1[1].color |
| 15899 |
if _L1[233].tag == "NONE" then |
| 15900 |
else |
| 15901 |
goto else33 |
| 15902 |
end |
| 15903 |
do |
| 15904 |
if _L1[231] == "always" then |
| 15905 |
_L1[234] = {tag = "SOME", payload = _L[276]} |
| 15906 |
elseif _L1[231] == "auto" then |
| 15907 |
_L1[234] = {tag = "SOME", payload = _L[277]} |
| 15908 |
elseif _L1[231] == "never" then |
| 15909 |
_L1[234] = {tag = "SOME", payload = _L[278]} |
| 15910 |
else |
| 15911 |
_L1[234] = NONE |
| 15912 |
end |
| 15913 |
if _L1[234].tag == "SOME" then |
| 15914 |
else |
| 15915 |
goto else34 |
| 15916 |
end |
| 15917 |
do |
| 15918 |
_L1[235] = _L1[234].payload |
| 15919 |
_L[280](_L1[235]) |
| 15920 |
_L1[236] = _L1[1].bibtex_or_biber |
| 15921 |
_L1[237] = _L1[1].change_directory |
| 15922 |
_L1[238] = _L1[1].check_driver |
| 15923 |
_L1[239] = _L1[1].config_file |
| 15924 |
_L1[240] = _L1[1].dvipdfmx_extraoptions |
| 15925 |
_L1[241] = _L1[1].engine |
| 15926 |
_L1[242] = _L1[1].engine_executable |
| 15927 |
_L1[243] = _L1[1].file_line_error |
| 15928 |
_L1[244] = _L1[1].fmt |
| 15929 |
_L1[245] = _L1[1].fresh |
| 15930 |
_L1[246] = _L1[1].halt_on_error |
| 15931 |
_L1[247] = _L1[1].includeonly |
| 15932 |
_L1[248] = _L1[1].interaction |
| 15933 |
_L1[249] = _L1[1].jobname |
| 15934 |
_L1[250] = _L1[1].make_depends |
| 15935 |
_L1[251] = _L1[1].makeglossaries |
| 15936 |
_L1[252] = _L1[1].makeindex |
| 15937 |
_L1[253] = _L1[1].max_iterations |
| 15938 |
_L1[254] = _L1[1].output |
| 15939 |
_L1[255] = _L1[1].output_directory |
| 15940 |
_L1[256] = _L1[1].output_format |
| 15941 |
_L1[257] = _L1[1].package_support |
| 15942 |
_L1[258] = _L1[1].print_output_directory |
| 15943 |
_L1[259] = _L1[1].shell_escape |
| 15944 |
_L1[260] = _L1[1].source_date_epoch |
| 15945 |
_L1[261] = _L1[1].start_with_draft |
| 15946 |
_L1[262] = _L1[1].synctex |
| 15947 |
_L1[263] = _L1[1].tex_extraoptions |
| 15948 |
_L1[264] = _L1[1].watch |
| 15949 |
_L[536] = {bibtex_or_biber = _L1[236], change_directory = _L1[237], check_driver = _L1[238], color = {tag = "SOME", payload = _L1[235]}, config_file = _L1[239], dvipdfmx_extraoptions = _L1[240], engine = _L1[241], engine_executable = _L1[242], file_line_error = _L1[243], fmt = _L1[244], fresh = _L1[245], halt_on_error = _L1[246], includeonly = _L1[247], interaction = _L1[248], jobname = _L1[249], make_depends = _L1[250], makeglossaries = _L1[251], makeindex = _L1[252], max_iterations = _L1[253], output = _L1[254], output_directory = _L1[255], output_format = _L1[256], package_support = _L1[257], print_output_directory = _L1[258], shell_escape = _L1[259], source_date_epoch = _L1[260], start_with_draft = _L1[261], synctex = _L1[262], tex_extraoptions = _L1[263], watch = _L1[264]} |
| 15950 |
_L[537] = _L1[232] |
| 15951 |
goto cont18 |
| 15952 |
end |
| 15953 |
::else34:: |
| 15954 |
if _L1[234].tag == "NONE" then |
| 15955 |
else |
| 15956 |
_raise(_Match, "handle-options.sml:208:56") |
| 15957 |
end |
| 15958 |
_L[124]({_L[118], "invalid value for --color option\n"}) |
| 15959 |
tmp15(1, true) |
| 15960 |
end |
| 15961 |
::else33:: |
| 15962 |
if _L1[233].tag == "SOME" then |
| 15963 |
else |
| 15964 |
_raise(_Match, "handle-options.sml:207:43") |
| 15965 |
end |
| 15966 |
_L[124]({_L[118], "multiple --color options\n"}) |
| 15967 |
tmp15(1, true) |
| 15968 |
end |
| 15969 |
::else11:: |
| 15970 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_CHANGE_DIRECTORY" then |
| 15971 |
else |
| 15972 |
goto else12 |
| 15973 |
end |
| 15974 |
do |
| 15975 |
_L1[265] = _L1[3].payload[1].payload |
| 15976 |
_L1[266] = _L1[3].payload[2] |
| 15977 |
_L1[267] = _L1[1].change_directory |
| 15978 |
if _L1[267].tag == "NONE" then |
| 15979 |
_L1[268] = _L1[1].bibtex_or_biber |
| 15980 |
_L1[269] = _L1[1].check_driver |
| 15981 |
_L1[270] = _L1[1].color |
| 15982 |
_L1[271] = _L1[1].config_file |
| 15983 |
_L1[272] = _L1[1].dvipdfmx_extraoptions |
| 15984 |
_L1[273] = _L1[1].engine |
| 15985 |
_L1[274] = _L1[1].engine_executable |
| 15986 |
_L1[275] = _L1[1].file_line_error |
| 15987 |
_L1[276] = _L1[1].fmt |
| 15988 |
_L1[277] = _L1[1].fresh |
| 15989 |
_L1[278] = _L1[1].halt_on_error |
| 15990 |
_L1[279] = _L1[1].includeonly |
| 15991 |
_L1[280] = _L1[1].interaction |
| 15992 |
_L1[281] = _L1[1].jobname |
| 15993 |
_L1[282] = _L1[1].make_depends |
| 15994 |
_L1[283] = _L1[1].makeglossaries |
| 15995 |
_L1[284] = _L1[1].makeindex |
| 15996 |
_L1[285] = _L1[1].max_iterations |
| 15997 |
_L1[286] = _L1[1].output |
| 15998 |
_L1[287] = _L1[1].output_directory |
| 15999 |
_L1[288] = _L1[1].output_format |
| 16000 |
_L1[289] = _L1[1].package_support |
| 16001 |
_L1[290] = _L1[1].print_output_directory |
| 16002 |
_L1[291] = _L1[1].shell_escape |
| 16003 |
_L1[292] = _L1[1].source_date_epoch |
| 16004 |
_L1[293] = _L1[1].start_with_draft |
| 16005 |
_L1[294] = _L1[1].synctex |
| 16006 |
_L1[295] = _L1[1].tex_extraoptions |
| 16007 |
_L1[296] = _L1[1].watch |
| 16008 |
_L[536] = {bibtex_or_biber = _L1[268], change_directory = {tag = "SOME", payload = _L1[265]}, check_driver = _L1[269], color = _L1[270], config_file = _L1[271], dvipdfmx_extraoptions = _L1[272], engine = _L1[273], engine_executable = _L1[274], file_line_error = _L1[275], fmt = _L1[276], fresh = _L1[277], halt_on_error = _L1[278], includeonly = _L1[279], interaction = _L1[280], jobname = _L1[281], make_depends = _L1[282], makeglossaries = _L1[283], makeindex = _L1[284], max_iterations = _L1[285], output = _L1[286], output_directory = _L1[287], output_format = _L1[288], package_support = _L1[289], print_output_directory = _L1[290], shell_escape = _L1[291], source_date_epoch = _L1[292], start_with_draft = _L1[293], synctex = _L1[294], tex_extraoptions = _L1[295], watch = _L1[296]} |
| 16009 |
_L[537] = _L1[266] |
| 16010 |
goto cont18 |
| 16011 |
end |
| 16012 |
if _L1[267].tag == "SOME" then |
| 16013 |
else |
| 16014 |
_raise(_Match, "handle-options.sml:216:51") |
| 16015 |
end |
| 16016 |
_L[124]({_L[118], "multiple --change-directory options\n"}) |
| 16017 |
tmp15(1, true) |
| 16018 |
end |
| 16019 |
::else12:: |
| 16020 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_INCLUDEONLY" then |
| 16021 |
else |
| 16022 |
goto else13 |
| 16023 |
end |
| 16024 |
do |
| 16025 |
_L1[297] = _L1[3].payload[1].payload |
| 16026 |
_L1[298] = _L1[3].payload[2] |
| 16027 |
_L1[299] = _L1[1].includeonly |
| 16028 |
if _L1[299].tag == "NONE" then |
| 16029 |
_L1[300] = _L1[1].bibtex_or_biber |
| 16030 |
_L1[301] = _L1[1].change_directory |
| 16031 |
_L1[302] = _L1[1].check_driver |
| 16032 |
_L1[303] = _L1[1].color |
| 16033 |
_L1[304] = _L1[1].config_file |
| 16034 |
_L1[305] = _L1[1].dvipdfmx_extraoptions |
| 16035 |
_L1[306] = _L1[1].engine |
| 16036 |
_L1[307] = _L1[1].engine_executable |
| 16037 |
_L1[308] = _L1[1].file_line_error |
| 16038 |
_L1[309] = _L1[1].fmt |
| 16039 |
_L1[310] = _L1[1].fresh |
| 16040 |
_L1[311] = _L1[1].halt_on_error |
| 16041 |
_L1[312] = _L1[1].interaction |
| 16042 |
_L1[313] = _L1[1].jobname |
| 16043 |
_L1[314] = _L1[1].make_depends |
| 16044 |
_L1[315] = _L1[1].makeglossaries |
| 16045 |
_L1[316] = _L1[1].makeindex |
| 16046 |
_L1[317] = _L1[1].max_iterations |
| 16047 |
_L1[318] = _L1[1].output |
| 16048 |
_L1[319] = _L1[1].output_directory |
| 16049 |
_L1[320] = _L1[1].output_format |
| 16050 |
_L1[321] = _L1[1].package_support |
| 16051 |
_L1[322] = _L1[1].print_output_directory |
| 16052 |
_L1[323] = _L1[1].shell_escape |
| 16053 |
_L1[324] = _L1[1].source_date_epoch |
| 16054 |
_L1[325] = _L1[1].start_with_draft |
| 16055 |
_L1[326] = _L1[1].synctex |
| 16056 |
_L1[327] = _L1[1].tex_extraoptions |
| 16057 |
_L1[328] = _L1[1].watch |
| 16058 |
_L[536] = {bibtex_or_biber = _L1[300], change_directory = _L1[301], check_driver = _L1[302], color = _L1[303], config_file = _L1[304], dvipdfmx_extraoptions = _L1[305], engine = _L1[306], engine_executable = _L1[307], file_line_error = _L1[308], fmt = _L1[309], fresh = _L1[310], halt_on_error = _L1[311], includeonly = {tag = "SOME", payload = _L1[297]}, interaction = _L1[312], jobname = _L1[313], make_depends = _L1[314], makeglossaries = _L1[315], makeindex = _L1[316], max_iterations = _L1[317], output = _L1[318], output_directory = _L1[319], output_format = _L1[320], package_support = _L1[321], print_output_directory = _L1[322], shell_escape = _L1[323], source_date_epoch = _L1[324], start_with_draft = _L1[325], synctex = _L1[326], tex_extraoptions = _L1[327], watch = _L1[328]} |
| 16059 |
_L[537] = _L1[298] |
| 16060 |
goto cont18 |
| 16061 |
end |
| 16062 |
if _L1[299].tag == "SOME" then |
| 16063 |
else |
| 16064 |
_raise(_Match, "handle-options.sml:220:46") |
| 16065 |
end |
| 16066 |
_L[124]({_L[118], "multiple --includeonly options\n"}) |
| 16067 |
tmp15(1, true) |
| 16068 |
end |
| 16069 |
::else13:: |
| 16070 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_MAKE_DEPENDS" then |
| 16071 |
else |
| 16072 |
goto else14 |
| 16073 |
end |
| 16074 |
do |
| 16075 |
_L1[329] = _L1[3].payload[1].payload |
| 16076 |
_L1[330] = _L1[3].payload[2] |
| 16077 |
_L1[331] = _L1[1].make_depends |
| 16078 |
if _L1[331].tag == "NONE" then |
| 16079 |
_L1[332] = _L1[1].bibtex_or_biber |
| 16080 |
_L1[333] = _L1[1].change_directory |
| 16081 |
_L1[334] = _L1[1].check_driver |
| 16082 |
_L1[335] = _L1[1].color |
| 16083 |
_L1[336] = _L1[1].config_file |
| 16084 |
_L1[337] = _L1[1].dvipdfmx_extraoptions |
| 16085 |
_L1[338] = _L1[1].engine |
| 16086 |
_L1[339] = _L1[1].engine_executable |
| 16087 |
_L1[340] = _L1[1].file_line_error |
| 16088 |
_L1[341] = _L1[1].fmt |
| 16089 |
_L1[342] = _L1[1].fresh |
| 16090 |
_L1[343] = _L1[1].halt_on_error |
| 16091 |
_L1[344] = _L1[1].includeonly |
| 16092 |
_L1[345] = _L1[1].interaction |
| 16093 |
_L1[346] = _L1[1].jobname |
| 16094 |
_L1[347] = _L1[1].makeglossaries |
| 16095 |
_L1[348] = _L1[1].makeindex |
| 16096 |
_L1[349] = _L1[1].max_iterations |
| 16097 |
_L1[350] = _L1[1].output |
| 16098 |
_L1[351] = _L1[1].output_directory |
| 16099 |
_L1[352] = _L1[1].output_format |
| 16100 |
_L1[353] = _L1[1].package_support |
| 16101 |
_L1[354] = _L1[1].print_output_directory |
| 16102 |
_L1[355] = _L1[1].shell_escape |
| 16103 |
_L1[356] = _L1[1].source_date_epoch |
| 16104 |
_L1[357] = _L1[1].start_with_draft |
| 16105 |
_L1[358] = _L1[1].synctex |
| 16106 |
_L1[359] = _L1[1].tex_extraoptions |
| 16107 |
_L1[360] = _L1[1].watch |
| 16108 |
_L[536] = {bibtex_or_biber = _L1[332], change_directory = _L1[333], check_driver = _L1[334], color = _L1[335], config_file = _L1[336], dvipdfmx_extraoptions = _L1[337], engine = _L1[338], engine_executable = _L1[339], file_line_error = _L1[340], fmt = _L1[341], fresh = _L1[342], halt_on_error = _L1[343], includeonly = _L1[344], interaction = _L1[345], jobname = _L1[346], make_depends = {tag = "SOME", payload = _L1[329]}, makeglossaries = _L1[347], makeindex = _L1[348], max_iterations = _L1[349], output = _L1[350], output_directory = _L1[351], output_format = _L1[352], package_support = _L1[353], print_output_directory = _L1[354], shell_escape = _L1[355], source_date_epoch = _L1[356], start_with_draft = _L1[357], synctex = _L1[358], tex_extraoptions = _L1[359], watch = _L1[360]} |
| 16109 |
_L[537] = _L1[330] |
| 16110 |
goto cont18 |
| 16111 |
end |
| 16112 |
if _L1[331].tag == "SOME" then |
| 16113 |
else |
| 16114 |
_raise(_Match, "handle-options.sml:224:47") |
| 16115 |
end |
| 16116 |
_L[124]({_L[118], "multiple --make-depends options\n"}) |
| 16117 |
tmp15(1, true) |
| 16118 |
end |
| 16119 |
::else14:: |
| 16120 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_PRINT_OUTPUT_DIRECTORY" then |
| 16121 |
else |
| 16122 |
goto else15 |
| 16123 |
end |
| 16124 |
do |
| 16125 |
_L1[361] = _L1[3].payload[2] |
| 16126 |
_L1[362] = _L1[1].print_output_directory |
| 16127 |
if not _L1[362] then |
| 16128 |
_L1[363] = _L1[1].bibtex_or_biber |
| 16129 |
_L1[364] = _L1[1].change_directory |
| 16130 |
_L1[365] = _L1[1].check_driver |
| 16131 |
_L1[366] = _L1[1].color |
| 16132 |
_L1[367] = _L1[1].config_file |
| 16133 |
_L1[368] = _L1[1].dvipdfmx_extraoptions |
| 16134 |
_L1[369] = _L1[1].engine |
| 16135 |
_L1[370] = _L1[1].engine_executable |
| 16136 |
_L1[371] = _L1[1].file_line_error |
| 16137 |
_L1[372] = _L1[1].fmt |
| 16138 |
_L1[373] = _L1[1].fresh |
| 16139 |
_L1[374] = _L1[1].halt_on_error |
| 16140 |
_L1[375] = _L1[1].includeonly |
| 16141 |
_L1[376] = _L1[1].interaction |
| 16142 |
_L1[377] = _L1[1].jobname |
| 16143 |
_L1[378] = _L1[1].make_depends |
| 16144 |
_L1[379] = _L1[1].makeglossaries |
| 16145 |
_L1[380] = _L1[1].makeindex |
| 16146 |
_L1[381] = _L1[1].max_iterations |
| 16147 |
_L1[382] = _L1[1].output |
| 16148 |
_L1[383] = _L1[1].output_directory |
| 16149 |
_L1[384] = _L1[1].output_format |
| 16150 |
_L1[385] = _L1[1].package_support |
| 16151 |
_L1[386] = _L1[1].shell_escape |
| 16152 |
_L1[387] = _L1[1].source_date_epoch |
| 16153 |
_L1[388] = _L1[1].start_with_draft |
| 16154 |
_L1[389] = _L1[1].synctex |
| 16155 |
_L1[390] = _L1[1].tex_extraoptions |
| 16156 |
_L[536] = {bibtex_or_biber = _L1[363], change_directory = _L1[364], check_driver = _L1[365], color = _L1[366], config_file = _L1[367], dvipdfmx_extraoptions = _L1[368], engine = _L1[369], engine_executable = _L1[370], file_line_error = _L1[371], fmt = _L1[372], fresh = _L1[373], halt_on_error = _L1[374], includeonly = _L1[375], interaction = _L1[376], jobname = _L1[377], make_depends = _L1[378], makeglossaries = _L1[379], makeindex = _L1[380], max_iterations = _L1[381], output = _L1[382], output_directory = _L1[383], output_format = _L1[384], package_support = _L1[385], print_output_directory = true, shell_escape = _L1[386], source_date_epoch = _L1[387], start_with_draft = _L1[388], synctex = _L1[389], tex_extraoptions = _L1[390], watch = _L1[1].watch} |
| 16157 |
_L[537] = _L1[361] |
| 16158 |
goto cont18 |
| 16159 |
end |
| 16160 |
if _L1[362] then |
| 16161 |
else |
| 16162 |
_raise(_Match, "handle-options.sml:228:55") |
| 16163 |
end |
| 16164 |
_L[124]({_L[118], "multiple --print-output-directory options\n"}) |
| 16165 |
tmp15(1, true) |
| 16166 |
end |
| 16167 |
::else15:: |
| 16168 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_PACKAGE_SUPPORT" then |
| 16169 |
else |
| 16170 |
goto else16 |
| 16171 |
end |
| 16172 |
do |
| 16173 |
_L1[391] = _L1[3].payload[1].payload |
| 16174 |
_L1[392] = _L1[3].payload[2] |
| 16175 |
do |
| 16176 |
do |
| 16177 |
_L1[395] = foldr(_COLON_COLON, nil) |
| 16178 |
_L1[396] = #_L1[391] |
| 16179 |
_L1[397] = _VectorOrArray_tabulate({_L1[396], function(i) |
| 16180 |
return sub1({_L1[391], i}) |
| 16181 |
end}) |
| 16182 |
_L1[394] = _L1[395](_L1[397]) |
| 16183 |
end |
| 16184 |
_L1[398], _L1[399], _L1[400] = nil, nil, _L1[394] |
| 16185 |
::cont21:: |
| 16186 |
do |
| 16187 |
local _L2 = {} |
| 16188 |
_L2[1], _L2[2], _L2[3] = _L1[398], _L1[399], _L1[400] |
| 16189 |
if _L2[3] == nil then |
| 16190 |
else |
| 16191 |
goto else33 |
| 16192 |
end |
| 16193 |
do |
| 16194 |
if _L2[2] == nil then |
| 16195 |
else |
| 16196 |
goto else34 |
| 16197 |
end |
| 16198 |
_L1[393] = revAppend(_L2[1], nil) |
| 16199 |
goto cont20 |
| 16200 |
::else34:: |
| 16201 |
_L2[4] = implodeRev(_L2[2]) |
| 16202 |
_L1[393] = revAppend({_L2[4], _L2[1]}, nil) |
| 16203 |
goto cont20 |
| 16204 |
end |
| 16205 |
::else33:: |
| 16206 |
if _L2[3] ~= nil then |
| 16207 |
else |
| 16208 |
_raise(_Match, "string-1.sml:73:26") |
| 16209 |
end |
| 16210 |
do |
| 16211 |
_L2[5] = _L2[3][1] |
| 16212 |
_L2[6] = _L2[3][2] |
| 16213 |
if _L2[5] == 44 then |
| 16214 |
_L2[7] = true |
| 16215 |
else |
| 16216 |
_L2[7] = isSpace(_L2[5]) |
| 16217 |
end |
| 16218 |
if _L2[7] then |
| 16219 |
else |
| 16220 |
_L1[398] = _L2[1] |
| 16221 |
_L1[399] = {_L2[5], _L2[2]} |
| 16222 |
_L1[400] = _L2[6] |
| 16223 |
goto cont21 |
| 16224 |
end |
| 16225 |
do |
| 16226 |
if _L2[2] == nil then |
| 16227 |
_L1[398] = _L2[1] |
| 16228 |
_L1[399] = nil |
| 16229 |
_L1[400] = _L2[6] |
| 16230 |
goto cont21 |
| 16231 |
end |
| 16232 |
_L2[8] = implodeRev(_L2[2]) |
| 16233 |
_L1[398] = {_L2[8], _L2[1]} |
| 16234 |
_L1[399] = nil |
| 16235 |
_L1[400] = _L2[6] |
| 16236 |
goto cont21 |
| 16237 |
end |
| 16238 |
end |
| 16239 |
end |
| 16240 |
end |
| 16241 |
::cont20:: |
| 16242 |
_L1[401] = foldl(function(a) |
| 16243 |
if a[1] == "minted" then |
| 16244 |
local ps = a[2] |
| 16245 |
return {epstopdf = ps.epstopdf, minted = true, pdfx = ps.pdfx} |
| 16246 |
end |
| 16247 |
if a[1] == "epstopdf" then |
| 16248 |
local ps = a[2] |
| 16249 |
return {epstopdf = true, minted = ps.minted, pdfx = ps.pdfx} |
| 16250 |
end |
| 16251 |
if a[1] == "pdfx" then |
| 16252 |
local ps = a[2] |
| 16253 |
return {epstopdf = ps.epstopdf, minted = ps.minted, pdfx = true} |
| 16254 |
end |
| 16255 |
local pkg = a[1] |
| 16256 |
local ps = a[2] |
| 16257 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 16258 |
else |
| 16259 |
return ps |
| 16260 |
end |
| 16261 |
do |
| 16262 |
_L[302]("ClutTeX provides no special support for '" .. pkg .. "'.") |
| 16263 |
return ps |
| 16264 |
end |
| 16265 |
end) |
| 16266 |
_L1[402] = _L1[401](_L1[1].package_support) |
| 16267 |
_L1[403] = _L1[402](_L1[393]) |
| 16268 |
_L1[404] = _L1[1].bibtex_or_biber |
| 16269 |
_L1[405] = _L1[1].change_directory |
| 16270 |
_L1[406] = _L1[1].check_driver |
| 16271 |
_L1[407] = _L1[1].color |
| 16272 |
_L1[408] = _L1[1].config_file |
| 16273 |
_L1[409] = _L1[1].dvipdfmx_extraoptions |
| 16274 |
_L1[410] = _L1[1].engine |
| 16275 |
_L1[411] = _L1[1].engine_executable |
| 16276 |
_L1[412] = _L1[1].file_line_error |
| 16277 |
_L1[413] = _L1[1].fmt |
| 16278 |
_L1[414] = _L1[1].fresh |
| 16279 |
_L1[415] = _L1[1].halt_on_error |
| 16280 |
_L1[416] = _L1[1].includeonly |
| 16281 |
_L1[417] = _L1[1].interaction |
| 16282 |
_L1[418] = _L1[1].jobname |
| 16283 |
_L1[419] = _L1[1].make_depends |
| 16284 |
_L1[420] = _L1[1].makeglossaries |
| 16285 |
_L1[421] = _L1[1].makeindex |
| 16286 |
_L1[422] = _L1[1].max_iterations |
| 16287 |
_L1[423] = _L1[1].output |
| 16288 |
_L1[424] = _L1[1].output_directory |
| 16289 |
_L1[425] = _L1[1].output_format |
| 16290 |
_L1[426] = _L1[1].print_output_directory |
| 16291 |
_L1[427] = _L1[1].shell_escape |
| 16292 |
_L1[428] = _L1[1].source_date_epoch |
| 16293 |
_L1[429] = _L1[1].start_with_draft |
| 16294 |
_L1[430] = _L1[1].synctex |
| 16295 |
_L1[431] = _L1[1].tex_extraoptions |
| 16296 |
_L[536] = {bibtex_or_biber = _L1[404], change_directory = _L1[405], check_driver = _L1[406], color = _L1[407], config_file = _L1[408], dvipdfmx_extraoptions = _L1[409], engine = _L1[410], engine_executable = _L1[411], file_line_error = _L1[412], fmt = _L1[413], fresh = _L1[414], halt_on_error = _L1[415], includeonly = _L1[416], interaction = _L1[417], jobname = _L1[418], make_depends = _L1[419], makeglossaries = _L1[420], makeindex = _L1[421], max_iterations = _L1[422], output = _L1[423], output_directory = _L1[424], output_format = _L1[425], package_support = _L1[403], print_output_directory = _L1[426], shell_escape = _L1[427], source_date_epoch = _L1[428], start_with_draft = _L1[429], synctex = _L1[430], tex_extraoptions = _L1[431], watch = _L1[1].watch} |
| 16297 |
_L[537] = _L1[392] |
| 16298 |
goto cont18 |
| 16299 |
end |
| 16300 |
::else16:: |
| 16301 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_CHECK_DRIVER" then |
| 16302 |
else |
| 16303 |
goto else17 |
| 16304 |
end |
| 16305 |
do |
| 16306 |
_L1[432] = _L1[3].payload[1].payload |
| 16307 |
_L1[433] = _L1[3].payload[2] |
| 16308 |
_L1[434] = _L1[1].check_driver |
| 16309 |
if _L1[434].tag == "NONE" then |
| 16310 |
else |
| 16311 |
goto else33 |
| 16312 |
end |
| 16313 |
do |
| 16314 |
if _L1[432] == "dvipdfmx" then |
| 16315 |
_L1[435] = {tag = "SOME", payload = _L[340]} |
| 16316 |
elseif _L1[432] == "dvips" then |
| 16317 |
_L1[435] = {tag = "SOME", payload = _L[341]} |
| 16318 |
elseif _L1[432] == "dvisvgm" then |
| 16319 |
_L1[435] = {tag = "SOME", payload = _L[342]} |
| 16320 |
else |
| 16321 |
_L1[435] = NONE |
| 16322 |
end |
| 16323 |
if _L1[435].tag == "SOME" then |
| 16324 |
_L1[436] = _L1[435].payload |
| 16325 |
_L1[437] = _L1[1].bibtex_or_biber |
| 16326 |
_L1[438] = _L1[1].change_directory |
| 16327 |
_L1[439] = _L1[1].color |
| 16328 |
_L1[440] = _L1[1].config_file |
| 16329 |
_L1[441] = _L1[1].dvipdfmx_extraoptions |
| 16330 |
_L1[442] = _L1[1].engine |
| 16331 |
_L1[443] = _L1[1].engine_executable |
| 16332 |
_L1[444] = _L1[1].file_line_error |
| 16333 |
_L1[445] = _L1[1].fmt |
| 16334 |
_L1[446] = _L1[1].fresh |
| 16335 |
_L1[447] = _L1[1].halt_on_error |
| 16336 |
_L1[448] = _L1[1].includeonly |
| 16337 |
_L1[449] = _L1[1].interaction |
| 16338 |
_L1[450] = _L1[1].jobname |
| 16339 |
_L1[451] = _L1[1].make_depends |
| 16340 |
_L1[452] = _L1[1].makeglossaries |
| 16341 |
_L1[453] = _L1[1].makeindex |
| 16342 |
_L1[454] = _L1[1].max_iterations |
| 16343 |
_L1[455] = _L1[1].output |
| 16344 |
_L1[456] = _L1[1].output_directory |
| 16345 |
_L1[457] = _L1[1].output_format |
| 16346 |
_L1[458] = _L1[1].package_support |
| 16347 |
_L1[459] = _L1[1].print_output_directory |
| 16348 |
_L1[460] = _L1[1].shell_escape |
| 16349 |
_L1[461] = _L1[1].source_date_epoch |
| 16350 |
_L1[462] = _L1[1].start_with_draft |
| 16351 |
_L1[463] = _L1[1].synctex |
| 16352 |
_L1[464] = _L1[1].tex_extraoptions |
| 16353 |
_L1[465] = _L1[1].watch |
| 16354 |
_L[536] = {bibtex_or_biber = _L1[437], change_directory = _L1[438], check_driver = {tag = "SOME", payload = _L1[436]}, color = _L1[439], config_file = _L1[440], dvipdfmx_extraoptions = _L1[441], engine = _L1[442], engine_executable = _L1[443], file_line_error = _L1[444], fmt = _L1[445], fresh = _L1[446], halt_on_error = _L1[447], includeonly = _L1[448], interaction = _L1[449], jobname = _L1[450], make_depends = _L1[451], makeglossaries = _L1[452], makeindex = _L1[453], max_iterations = _L1[454], output = _L1[455], output_directory = _L1[456], output_format = _L1[457], package_support = _L1[458], print_output_directory = _L1[459], shell_escape = _L1[460], source_date_epoch = _L1[461], start_with_draft = _L1[462], synctex = _L1[463], tex_extraoptions = _L1[464], watch = _L1[465]} |
| 16355 |
_L[537] = _L1[433] |
| 16356 |
goto cont18 |
| 16357 |
end |
| 16358 |
if _L1[435].tag == "NONE" then |
| 16359 |
else |
| 16360 |
_raise(_Match, "handle-options.sml:246:65") |
| 16361 |
end |
| 16362 |
_L[124]({_L[118], "invalid value for --check-driver option\n"}) |
| 16363 |
tmp15(1, true) |
| 16364 |
end |
| 16365 |
::else33:: |
| 16366 |
if _L1[434].tag == "SOME" then |
| 16367 |
else |
| 16368 |
_raise(_Match, "handle-options.sml:245:52") |
| 16369 |
end |
| 16370 |
_L[124]({_L[118], "multiple --check-driver options\n"}) |
| 16371 |
tmp15(1, true) |
| 16372 |
end |
| 16373 |
::else17:: |
| 16374 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_SOURCE_DATE_EPOCH" then |
| 16375 |
else |
| 16376 |
goto else18 |
| 16377 |
end |
| 16378 |
do |
| 16379 |
_L1[466] = _L1[3].payload[1].payload |
| 16380 |
_L1[467] = _L1[3].payload[2] |
| 16381 |
_L1[468] = _L1[1].source_date_epoch |
| 16382 |
if _L1[468].tag == "NONE" then |
| 16383 |
else |
| 16384 |
goto else33 |
| 16385 |
end |
| 16386 |
do |
| 16387 |
do |
| 16388 |
if _L1[466] == "now" then |
| 16389 |
_L1[469] = {tag = "SOME", payload = _L[347]} |
| 16390 |
goto cont20 |
| 16391 |
end |
| 16392 |
do |
| 16393 |
if #_L1[466] > 0 then |
| 16394 |
else |
| 16395 |
_L1[470] = false |
| 16396 |
goto cont21 |
| 16397 |
end |
| 16398 |
do |
| 16399 |
_L1[471] = tmp32(isDigit) |
| 16400 |
_L1[470] = _L1[471](_L1[466]) |
| 16401 |
end |
| 16402 |
end |
| 16403 |
::cont21:: |
| 16404 |
if _L1[470] then |
| 16405 |
_L1[469] = {tag = "SOME", payload = {tag = "RAW", payload = _L1[466]}} |
| 16406 |
else |
| 16407 |
_L1[469] = NONE |
| 16408 |
end |
| 16409 |
end |
| 16410 |
::cont20:: |
| 16411 |
if _L1[469].tag == "SOME" then |
| 16412 |
_L1[472] = _L1[469].payload |
| 16413 |
_L1[473] = _L1[1].bibtex_or_biber |
| 16414 |
_L1[474] = _L1[1].change_directory |
| 16415 |
_L1[475] = _L1[1].check_driver |
| 16416 |
_L1[476] = _L1[1].color |
| 16417 |
_L1[477] = _L1[1].config_file |
| 16418 |
_L1[478] = _L1[1].dvipdfmx_extraoptions |
| 16419 |
_L1[479] = _L1[1].engine |
| 16420 |
_L1[480] = _L1[1].engine_executable |
| 16421 |
_L1[481] = _L1[1].file_line_error |
| 16422 |
_L1[482] = _L1[1].fmt |
| 16423 |
_L1[483] = _L1[1].fresh |
| 16424 |
_L1[484] = _L1[1].halt_on_error |
| 16425 |
_L1[485] = _L1[1].includeonly |
| 16426 |
_L1[486] = _L1[1].interaction |
| 16427 |
_L1[487] = _L1[1].jobname |
| 16428 |
_L1[488] = _L1[1].make_depends |
| 16429 |
_L1[489] = _L1[1].makeglossaries |
| 16430 |
_L1[490] = _L1[1].makeindex |
| 16431 |
_L1[491] = _L1[1].max_iterations |
| 16432 |
_L1[492] = _L1[1].output |
| 16433 |
_L1[493] = _L1[1].output_directory |
| 16434 |
_L1[494] = _L1[1].output_format |
| 16435 |
_L1[495] = _L1[1].package_support |
| 16436 |
_L1[496] = _L1[1].print_output_directory |
| 16437 |
_L1[497] = _L1[1].shell_escape |
| 16438 |
_L1[498] = _L1[1].start_with_draft |
| 16439 |
_L1[499] = _L1[1].synctex |
| 16440 |
_L1[500] = _L1[1].tex_extraoptions |
| 16441 |
_L1[501] = _L1[1].watch |
| 16442 |
_L[536] = {bibtex_or_biber = _L1[473], change_directory = _L1[474], check_driver = _L1[475], color = _L1[476], config_file = _L1[477], dvipdfmx_extraoptions = _L1[478], engine = _L1[479], engine_executable = _L1[480], file_line_error = _L1[481], fmt = _L1[482], fresh = _L1[483], halt_on_error = _L1[484], includeonly = _L1[485], interaction = _L1[486], jobname = _L1[487], make_depends = _L1[488], makeglossaries = _L1[489], makeindex = _L1[490], max_iterations = _L1[491], output = _L1[492], output_directory = _L1[493], output_format = _L1[494], package_support = _L1[495], print_output_directory = _L1[496], shell_escape = _L1[497], source_date_epoch = {tag = "SOME", payload = _L1[472]}, start_with_draft = _L1[498], synctex = _L1[499], tex_extraoptions = _L1[500], watch = _L1[501]} |
| 16443 |
_L[537] = _L1[467] |
| 16444 |
goto cont18 |
| 16445 |
end |
| 16446 |
if _L1[469].tag == "NONE" then |
| 16447 |
else |
| 16448 |
_raise(_Match, "handle-options.sml:253:68") |
| 16449 |
end |
| 16450 |
_L[124]({_L[118], "invalid value for --source-date-epoch option\n"}) |
| 16451 |
tmp15(1, true) |
| 16452 |
end |
| 16453 |
::else33:: |
| 16454 |
if _L1[468].tag == "SOME" then |
| 16455 |
else |
| 16456 |
_raise(_Match, "handle-options.sml:252:55") |
| 16457 |
end |
| 16458 |
_L[124]({_L[118], "multiple --source-date-epoch options\n"}) |
| 16459 |
tmp15(1, true) |
| 16460 |
end |
| 16461 |
::else18:: |
| 16462 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_SYNCTEX" then |
| 16463 |
else |
| 16464 |
goto else19 |
| 16465 |
end |
| 16466 |
do |
| 16467 |
_L1[502] = _L1[3].payload[1].payload |
| 16468 |
_L1[503] = _L1[3].payload[2] |
| 16469 |
_L1[504] = _L1[1].synctex |
| 16470 |
if _L1[504].tag == "NONE" then |
| 16471 |
_L1[505] = _L1[1].bibtex_or_biber |
| 16472 |
_L1[506] = _L1[1].change_directory |
| 16473 |
_L1[507] = _L1[1].check_driver |
| 16474 |
_L1[508] = _L1[1].color |
| 16475 |
_L1[509] = _L1[1].config_file |
| 16476 |
_L1[510] = _L1[1].dvipdfmx_extraoptions |
| 16477 |
_L1[511] = _L1[1].engine |
| 16478 |
_L1[512] = _L1[1].engine_executable |
| 16479 |
_L1[513] = _L1[1].file_line_error |
| 16480 |
_L1[514] = _L1[1].fmt |
| 16481 |
_L1[515] = _L1[1].fresh |
| 16482 |
_L1[516] = _L1[1].halt_on_error |
| 16483 |
_L1[517] = _L1[1].includeonly |
| 16484 |
_L1[518] = _L1[1].interaction |
| 16485 |
_L1[519] = _L1[1].jobname |
| 16486 |
_L1[520] = _L1[1].make_depends |
| 16487 |
_L1[521] = _L1[1].makeglossaries |
| 16488 |
_L1[522] = _L1[1].makeindex |
| 16489 |
_L1[523] = _L1[1].max_iterations |
| 16490 |
_L1[524] = _L1[1].output |
| 16491 |
_L1[525] = _L1[1].output_directory |
| 16492 |
_L1[526] = _L1[1].output_format |
| 16493 |
_L1[527] = _L1[1].package_support |
| 16494 |
_L1[528] = _L1[1].print_output_directory |
| 16495 |
_L1[529] = _L1[1].shell_escape |
| 16496 |
_L1[530] = _L1[1].source_date_epoch |
| 16497 |
_L1[531] = _L1[1].start_with_draft |
| 16498 |
_L1[532] = _L1[1].tex_extraoptions |
| 16499 |
_L1[533] = _L1[1].watch |
| 16500 |
_L[536] = {bibtex_or_biber = _L1[505], change_directory = _L1[506], check_driver = _L1[507], color = _L1[508], config_file = _L1[509], dvipdfmx_extraoptions = _L1[510], engine = _L1[511], engine_executable = _L1[512], file_line_error = _L1[513], fmt = _L1[514], fresh = _L1[515], halt_on_error = _L1[516], includeonly = _L1[517], interaction = _L1[518], jobname = _L1[519], make_depends = _L1[520], makeglossaries = _L1[521], makeindex = _L1[522], max_iterations = _L1[523], output = _L1[524], output_directory = _L1[525], output_format = _L1[526], package_support = _L1[527], print_output_directory = _L1[528], shell_escape = _L1[529], source_date_epoch = _L1[530], start_with_draft = _L1[531], synctex = {tag = "SOME", payload = _L1[502]}, tex_extraoptions = _L1[532], watch = _L1[533]} |
| 16501 |
_L[537] = _L1[503] |
| 16502 |
goto cont18 |
| 16503 |
end |
| 16504 |
if _L1[504].tag == "SOME" then |
| 16505 |
else |
| 16506 |
_raise(_Match, "handle-options.sml:259:42") |
| 16507 |
end |
| 16508 |
_L[124]({_L[118], "multiple --synctex options\n"}) |
| 16509 |
tmp15(1, true) |
| 16510 |
end |
| 16511 |
::else19:: |
| 16512 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_FILE_LINE_ERROR" then |
| 16513 |
_L1[534] = _L1[3].payload[1].payload |
| 16514 |
_L1[535] = _L1[3].payload[2] |
| 16515 |
_L1[536] = _L1[1].bibtex_or_biber |
| 16516 |
_L1[537] = _L1[1].change_directory |
| 16517 |
_L1[538] = _L1[1].check_driver |
| 16518 |
_L1[539] = _L1[1].color |
| 16519 |
_L1[540] = _L1[1].config_file |
| 16520 |
_L1[541] = _L1[1].dvipdfmx_extraoptions |
| 16521 |
_L1[542] = _L1[1].engine |
| 16522 |
_L1[543] = _L1[1].engine_executable |
| 16523 |
_L1[544] = _L1[1].fmt |
| 16524 |
_L1[545] = _L1[1].fresh |
| 16525 |
_L1[546] = _L1[1].halt_on_error |
| 16526 |
_L1[547] = _L1[1].includeonly |
| 16527 |
_L1[548] = _L1[1].interaction |
| 16528 |
_L1[549] = _L1[1].jobname |
| 16529 |
_L1[550] = _L1[1].make_depends |
| 16530 |
_L1[551] = _L1[1].makeglossaries |
| 16531 |
_L1[552] = _L1[1].makeindex |
| 16532 |
_L1[553] = _L1[1].max_iterations |
| 16533 |
_L1[554] = _L1[1].output |
| 16534 |
_L1[555] = _L1[1].output_directory |
| 16535 |
_L1[556] = _L1[1].output_format |
| 16536 |
_L1[557] = _L1[1].package_support |
| 16537 |
_L1[558] = _L1[1].print_output_directory |
| 16538 |
_L1[559] = _L1[1].shell_escape |
| 16539 |
_L1[560] = _L1[1].source_date_epoch |
| 16540 |
_L1[561] = _L1[1].start_with_draft |
| 16541 |
_L1[562] = _L1[1].synctex |
| 16542 |
_L1[563] = _L1[1].tex_extraoptions |
| 16543 |
_L[536] = {bibtex_or_biber = _L1[536], change_directory = _L1[537], check_driver = _L1[538], color = _L1[539], config_file = _L1[540], dvipdfmx_extraoptions = _L1[541], engine = _L1[542], engine_executable = _L1[543], file_line_error = _L1[534], fmt = _L1[544], fresh = _L1[545], halt_on_error = _L1[546], includeonly = _L1[547], interaction = _L1[548], jobname = _L1[549], make_depends = _L1[550], makeglossaries = _L1[551], makeindex = _L1[552], max_iterations = _L1[553], output = _L1[554], output_directory = _L1[555], output_format = _L1[556], package_support = _L1[557], print_output_directory = _L1[558], shell_escape = _L1[559], source_date_epoch = _L1[560], start_with_draft = _L1[561], synctex = _L1[562], tex_extraoptions = _L1[563], watch = _L1[1].watch} |
| 16544 |
_L[537] = _L1[535] |
| 16545 |
goto cont18 |
| 16546 |
end |
| 16547 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_INTERACTION" then |
| 16548 |
else |
| 16549 |
goto else20 |
| 16550 |
end |
| 16551 |
do |
| 16552 |
_L1[564] = _L1[3].payload[1].payload |
| 16553 |
_L1[565] = _L1[3].payload[2] |
| 16554 |
_L1[566] = _L1[1].interaction |
| 16555 |
if _L1[566].tag == "NONE" then |
| 16556 |
else |
| 16557 |
goto else33 |
| 16558 |
end |
| 16559 |
do |
| 16560 |
if _L1[564] == "batchmode" then |
| 16561 |
_L1[567] = {tag = "SOME", payload = _L[222]} |
| 16562 |
elseif _L1[564] == "nonstopmode" then |
| 16563 |
_L1[567] = {tag = "SOME", payload = _L[223]} |
| 16564 |
elseif _L1[564] == "scrollmode" then |
| 16565 |
_L1[567] = {tag = "SOME", payload = _L[224]} |
| 16566 |
elseif _L1[564] == "errorstopmode" then |
| 16567 |
_L1[567] = {tag = "SOME", payload = _L[225]} |
| 16568 |
else |
| 16569 |
_L1[567] = NONE |
| 16570 |
end |
| 16571 |
if _L1[567].tag == "SOME" then |
| 16572 |
_L1[568] = _L1[567].payload |
| 16573 |
_L1[569] = _L1[1].bibtex_or_biber |
| 16574 |
_L1[570] = _L1[1].change_directory |
| 16575 |
_L1[571] = _L1[1].check_driver |
| 16576 |
_L1[572] = _L1[1].color |
| 16577 |
_L1[573] = _L1[1].config_file |
| 16578 |
_L1[574] = _L1[1].dvipdfmx_extraoptions |
| 16579 |
_L1[575] = _L1[1].engine |
| 16580 |
_L1[576] = _L1[1].engine_executable |
| 16581 |
_L1[577] = _L1[1].file_line_error |
| 16582 |
_L1[578] = _L1[1].fmt |
| 16583 |
_L1[579] = _L1[1].fresh |
| 16584 |
_L1[580] = _L1[1].halt_on_error |
| 16585 |
_L1[581] = _L1[1].includeonly |
| 16586 |
_L1[582] = _L1[1].jobname |
| 16587 |
_L1[583] = _L1[1].make_depends |
| 16588 |
_L1[584] = _L1[1].makeglossaries |
| 16589 |
_L1[585] = _L1[1].makeindex |
| 16590 |
_L1[586] = _L1[1].max_iterations |
| 16591 |
_L1[587] = _L1[1].output |
| 16592 |
_L1[588] = _L1[1].output_directory |
| 16593 |
_L1[589] = _L1[1].output_format |
| 16594 |
_L1[590] = _L1[1].package_support |
| 16595 |
_L1[591] = _L1[1].print_output_directory |
| 16596 |
_L1[592] = _L1[1].shell_escape |
| 16597 |
_L1[593] = _L1[1].source_date_epoch |
| 16598 |
_L1[594] = _L1[1].start_with_draft |
| 16599 |
_L1[595] = _L1[1].synctex |
| 16600 |
_L1[596] = _L1[1].tex_extraoptions |
| 16601 |
_L1[597] = _L1[1].watch |
| 16602 |
_L[536] = {bibtex_or_biber = _L1[569], change_directory = _L1[570], check_driver = _L1[571], color = _L1[572], config_file = _L1[573], dvipdfmx_extraoptions = _L1[574], engine = _L1[575], engine_executable = _L1[576], file_line_error = _L1[577], fmt = _L1[578], fresh = _L1[579], halt_on_error = _L1[580], includeonly = _L1[581], interaction = {tag = "SOME", payload = _L1[568]}, jobname = _L1[582], make_depends = _L1[583], makeglossaries = _L1[584], makeindex = _L1[585], max_iterations = _L1[586], output = _L1[587], output_directory = _L1[588], output_format = _L1[589], package_support = _L1[590], print_output_directory = _L1[591], shell_escape = _L1[592], source_date_epoch = _L1[593], start_with_draft = _L1[594], synctex = _L1[595], tex_extraoptions = _L1[596], watch = _L1[597]} |
| 16603 |
_L[537] = _L1[565] |
| 16604 |
goto cont18 |
| 16605 |
end |
| 16606 |
if _L1[567].tag == "NONE" then |
| 16607 |
else |
| 16608 |
_raise(_Match, "handle-options.sml:265:59") |
| 16609 |
end |
| 16610 |
_L[124]({_L[118], "invalid argument for --interaction\n"}) |
| 16611 |
tmp15(1, true) |
| 16612 |
end |
| 16613 |
::else33:: |
| 16614 |
if _L1[566].tag == "SOME" then |
| 16615 |
else |
| 16616 |
_raise(_Match, "handle-options.sml:264:46") |
| 16617 |
end |
| 16618 |
_L[124]({_L[118], "multiple --interaction options\n"}) |
| 16619 |
tmp15(1, true) |
| 16620 |
end |
| 16621 |
::else20:: |
| 16622 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_HALT_ON_ERROR" then |
| 16623 |
_L1[598] = _L1[3].payload[1].payload |
| 16624 |
_L1[599] = _L1[3].payload[2] |
| 16625 |
_L1[600] = _L1[1].bibtex_or_biber |
| 16626 |
_L1[601] = _L1[1].change_directory |
| 16627 |
_L1[602] = _L1[1].check_driver |
| 16628 |
_L1[603] = _L1[1].color |
| 16629 |
_L1[604] = _L1[1].config_file |
| 16630 |
_L1[605] = _L1[1].dvipdfmx_extraoptions |
| 16631 |
_L1[606] = _L1[1].engine |
| 16632 |
_L1[607] = _L1[1].engine_executable |
| 16633 |
_L1[608] = _L1[1].file_line_error |
| 16634 |
_L1[609] = _L1[1].fmt |
| 16635 |
_L1[610] = _L1[1].fresh |
| 16636 |
_L1[611] = _L1[1].includeonly |
| 16637 |
_L1[612] = _L1[1].interaction |
| 16638 |
_L1[613] = _L1[1].jobname |
| 16639 |
_L1[614] = _L1[1].make_depends |
| 16640 |
_L1[615] = _L1[1].makeglossaries |
| 16641 |
_L1[616] = _L1[1].makeindex |
| 16642 |
_L1[617] = _L1[1].max_iterations |
| 16643 |
_L1[618] = _L1[1].output |
| 16644 |
_L1[619] = _L1[1].output_directory |
| 16645 |
_L1[620] = _L1[1].output_format |
| 16646 |
_L1[621] = _L1[1].package_support |
| 16647 |
_L1[622] = _L1[1].print_output_directory |
| 16648 |
_L1[623] = _L1[1].shell_escape |
| 16649 |
_L1[624] = _L1[1].source_date_epoch |
| 16650 |
_L1[625] = _L1[1].start_with_draft |
| 16651 |
_L1[626] = _L1[1].synctex |
| 16652 |
_L1[627] = _L1[1].tex_extraoptions |
| 16653 |
_L[536] = {bibtex_or_biber = _L1[600], change_directory = _L1[601], check_driver = _L1[602], color = _L1[603], config_file = _L1[604], dvipdfmx_extraoptions = _L1[605], engine = _L1[606], engine_executable = _L1[607], file_line_error = _L1[608], fmt = _L1[609], fresh = _L1[610], halt_on_error = _L1[598], includeonly = _L1[611], interaction = _L1[612], jobname = _L1[613], make_depends = _L1[614], makeglossaries = _L1[615], makeindex = _L1[616], max_iterations = _L1[617], output = _L1[618], output_directory = _L1[619], output_format = _L1[620], package_support = _L1[621], print_output_directory = _L1[622], shell_escape = _L1[623], source_date_epoch = _L1[624], start_with_draft = _L1[625], synctex = _L1[626], tex_extraoptions = _L1[627], watch = _L1[1].watch} |
| 16654 |
_L[537] = _L1[599] |
| 16655 |
goto cont18 |
| 16656 |
end |
| 16657 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_SHELL_ESCAPE" then |
| 16658 |
else |
| 16659 |
goto else21 |
| 16660 |
end |
| 16661 |
do |
| 16662 |
_L1[628] = _L1[3].payload[1].payload |
| 16663 |
_L1[629] = _L1[3].payload[2] |
| 16664 |
_L1[630] = _L1[1].shell_escape |
| 16665 |
if _L1[630].tag == "NONE" then |
| 16666 |
_L1[631] = _L1[1].bibtex_or_biber |
| 16667 |
_L1[632] = _L1[1].change_directory |
| 16668 |
_L1[633] = _L1[1].check_driver |
| 16669 |
_L1[634] = _L1[1].color |
| 16670 |
_L1[635] = _L1[1].config_file |
| 16671 |
_L1[636] = _L1[1].dvipdfmx_extraoptions |
| 16672 |
_L1[637] = _L1[1].engine |
| 16673 |
_L1[638] = _L1[1].engine_executable |
| 16674 |
_L1[639] = _L1[1].file_line_error |
| 16675 |
_L1[640] = _L1[1].fmt |
| 16676 |
_L1[641] = _L1[1].fresh |
| 16677 |
_L1[642] = _L1[1].halt_on_error |
| 16678 |
_L1[643] = _L1[1].includeonly |
| 16679 |
_L1[644] = _L1[1].interaction |
| 16680 |
_L1[645] = _L1[1].jobname |
| 16681 |
_L1[646] = _L1[1].make_depends |
| 16682 |
_L1[647] = _L1[1].makeglossaries |
| 16683 |
_L1[648] = _L1[1].makeindex |
| 16684 |
_L1[649] = _L1[1].max_iterations |
| 16685 |
_L1[650] = _L1[1].output |
| 16686 |
_L1[651] = _L1[1].output_directory |
| 16687 |
_L1[652] = _L1[1].output_format |
| 16688 |
_L1[653] = _L1[1].package_support |
| 16689 |
_L1[654] = _L1[1].print_output_directory |
| 16690 |
_L1[655] = _L1[1].source_date_epoch |
| 16691 |
_L1[656] = _L1[1].start_with_draft |
| 16692 |
_L1[657] = _L1[1].synctex |
| 16693 |
_L1[658] = _L1[1].tex_extraoptions |
| 16694 |
_L1[659] = _L1[1].watch |
| 16695 |
_L[536] = {bibtex_or_biber = _L1[631], change_directory = _L1[632], check_driver = _L1[633], color = _L1[634], config_file = _L1[635], dvipdfmx_extraoptions = _L1[636], engine = _L1[637], engine_executable = _L1[638], file_line_error = _L1[639], fmt = _L1[640], fresh = _L1[641], halt_on_error = _L1[642], includeonly = _L1[643], interaction = _L1[644], jobname = _L1[645], make_depends = _L1[646], makeglossaries = _L1[647], makeindex = _L1[648], max_iterations = _L1[649], output = _L1[650], output_directory = _L1[651], output_format = _L1[652], package_support = _L1[653], print_output_directory = _L1[654], shell_escape = {tag = "SOME", payload = _L1[628]}, source_date_epoch = _L1[655], start_with_draft = _L1[656], synctex = _L1[657], tex_extraoptions = _L1[658], watch = _L1[659]} |
| 16696 |
_L[537] = _L1[629] |
| 16697 |
goto cont18 |
| 16698 |
end |
| 16699 |
if _L1[630].tag == "SOME" then |
| 16700 |
else |
| 16701 |
_raise(_Match, "handle-options.sml:272:48") |
| 16702 |
end |
| 16703 |
_L[124]({_L[118], "multiple --(no-)shell-escape / --shell-restricted options\n"}) |
| 16704 |
tmp15(1, true) |
| 16705 |
end |
| 16706 |
::else21:: |
| 16707 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_JOBNAME" then |
| 16708 |
else |
| 16709 |
goto else22 |
| 16710 |
end |
| 16711 |
do |
| 16712 |
_L1[660] = _L1[3].payload[1].payload |
| 16713 |
_L1[661] = _L1[3].payload[2] |
| 16714 |
_L1[662] = _L1[1].jobname |
| 16715 |
if _L1[662].tag == "NONE" then |
| 16716 |
_L1[663] = _L1[1].bibtex_or_biber |
| 16717 |
_L1[664] = _L1[1].change_directory |
| 16718 |
_L1[665] = _L1[1].check_driver |
| 16719 |
_L1[666] = _L1[1].color |
| 16720 |
_L1[667] = _L1[1].config_file |
| 16721 |
_L1[668] = _L1[1].dvipdfmx_extraoptions |
| 16722 |
_L1[669] = _L1[1].engine |
| 16723 |
_L1[670] = _L1[1].engine_executable |
| 16724 |
_L1[671] = _L1[1].file_line_error |
| 16725 |
_L1[672] = _L1[1].fmt |
| 16726 |
_L1[673] = _L1[1].fresh |
| 16727 |
_L1[674] = _L1[1].halt_on_error |
| 16728 |
_L1[675] = _L1[1].includeonly |
| 16729 |
_L1[676] = _L1[1].interaction |
| 16730 |
_L1[677] = _L1[1].make_depends |
| 16731 |
_L1[678] = _L1[1].makeglossaries |
| 16732 |
_L1[679] = _L1[1].makeindex |
| 16733 |
_L1[680] = _L1[1].max_iterations |
| 16734 |
_L1[681] = _L1[1].output |
| 16735 |
_L1[682] = _L1[1].output_directory |
| 16736 |
_L1[683] = _L1[1].output_format |
| 16737 |
_L1[684] = _L1[1].package_support |
| 16738 |
_L1[685] = _L1[1].print_output_directory |
| 16739 |
_L1[686] = _L1[1].shell_escape |
| 16740 |
_L1[687] = _L1[1].source_date_epoch |
| 16741 |
_L1[688] = _L1[1].start_with_draft |
| 16742 |
_L1[689] = _L1[1].synctex |
| 16743 |
_L1[690] = _L1[1].tex_extraoptions |
| 16744 |
_L1[691] = _L1[1].watch |
| 16745 |
_L[536] = {bibtex_or_biber = _L1[663], change_directory = _L1[664], check_driver = _L1[665], color = _L1[666], config_file = _L1[667], dvipdfmx_extraoptions = _L1[668], engine = _L1[669], engine_executable = _L1[670], file_line_error = _L1[671], fmt = _L1[672], fresh = _L1[673], halt_on_error = _L1[674], includeonly = _L1[675], interaction = _L1[676], jobname = {tag = "SOME", payload = _L1[660]}, make_depends = _L1[677], makeglossaries = _L1[678], makeindex = _L1[679], max_iterations = _L1[680], output = _L1[681], output_directory = _L1[682], output_format = _L1[683], package_support = _L1[684], print_output_directory = _L1[685], shell_escape = _L1[686], source_date_epoch = _L1[687], start_with_draft = _L1[688], synctex = _L1[689], tex_extraoptions = _L1[690], watch = _L1[691]} |
| 16746 |
_L[537] = _L1[661] |
| 16747 |
goto cont18 |
| 16748 |
end |
| 16749 |
if _L1[662].tag == "SOME" then |
| 16750 |
else |
| 16751 |
_raise(_Match, "handle-options.sml:276:42") |
| 16752 |
end |
| 16753 |
_L[124]({_L[118], "multiple --jobname options\n"}) |
| 16754 |
tmp15(1, true) |
| 16755 |
end |
| 16756 |
::else22:: |
| 16757 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_FMT" then |
| 16758 |
else |
| 16759 |
goto else23 |
| 16760 |
end |
| 16761 |
do |
| 16762 |
_L1[692] = _L1[3].payload[1].payload |
| 16763 |
_L1[693] = _L1[3].payload[2] |
| 16764 |
_L1[694] = _L1[1].fmt |
| 16765 |
if _L1[694].tag == "NONE" then |
| 16766 |
_L1[695] = _L1[1].bibtex_or_biber |
| 16767 |
_L1[696] = _L1[1].change_directory |
| 16768 |
_L1[697] = _L1[1].check_driver |
| 16769 |
_L1[698] = _L1[1].color |
| 16770 |
_L1[699] = _L1[1].config_file |
| 16771 |
_L1[700] = _L1[1].dvipdfmx_extraoptions |
| 16772 |
_L1[701] = _L1[1].engine |
| 16773 |
_L1[702] = _L1[1].engine_executable |
| 16774 |
_L1[703] = _L1[1].file_line_error |
| 16775 |
_L1[704] = _L1[1].fresh |
| 16776 |
_L1[705] = _L1[1].halt_on_error |
| 16777 |
_L1[706] = _L1[1].includeonly |
| 16778 |
_L1[707] = _L1[1].interaction |
| 16779 |
_L1[708] = _L1[1].jobname |
| 16780 |
_L1[709] = _L1[1].make_depends |
| 16781 |
_L1[710] = _L1[1].makeglossaries |
| 16782 |
_L1[711] = _L1[1].makeindex |
| 16783 |
_L1[712] = _L1[1].max_iterations |
| 16784 |
_L1[713] = _L1[1].output |
| 16785 |
_L1[714] = _L1[1].output_directory |
| 16786 |
_L1[715] = _L1[1].output_format |
| 16787 |
_L1[716] = _L1[1].package_support |
| 16788 |
_L1[717] = _L1[1].print_output_directory |
| 16789 |
_L1[718] = _L1[1].shell_escape |
| 16790 |
_L1[719] = _L1[1].source_date_epoch |
| 16791 |
_L1[720] = _L1[1].start_with_draft |
| 16792 |
_L1[721] = _L1[1].synctex |
| 16793 |
_L1[722] = _L1[1].tex_extraoptions |
| 16794 |
_L1[723] = _L1[1].watch |
| 16795 |
_L[536] = {bibtex_or_biber = _L1[695], change_directory = _L1[696], check_driver = _L1[697], color = _L1[698], config_file = _L1[699], dvipdfmx_extraoptions = _L1[700], engine = _L1[701], engine_executable = _L1[702], file_line_error = _L1[703], fmt = {tag = "SOME", payload = _L1[692]}, fresh = _L1[704], halt_on_error = _L1[705], includeonly = _L1[706], interaction = _L1[707], jobname = _L1[708], make_depends = _L1[709], makeglossaries = _L1[710], makeindex = _L1[711], max_iterations = _L1[712], output = _L1[713], output_directory = _L1[714], output_format = _L1[715], package_support = _L1[716], print_output_directory = _L1[717], shell_escape = _L1[718], source_date_epoch = _L1[719], start_with_draft = _L1[720], synctex = _L1[721], tex_extraoptions = _L1[722], watch = _L1[723]} |
| 16796 |
_L[537] = _L1[693] |
| 16797 |
goto cont18 |
| 16798 |
end |
| 16799 |
if _L1[694].tag == "SOME" then |
| 16800 |
else |
| 16801 |
_raise(_Match, "handle-options.sml:280:38") |
| 16802 |
end |
| 16803 |
_L[124]({_L[118], "multiple --fmt options\n"}) |
| 16804 |
tmp15(1, true) |
| 16805 |
end |
| 16806 |
::else23:: |
| 16807 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_OUTPUT_DIRECTORY" then |
| 16808 |
else |
| 16809 |
goto else24 |
| 16810 |
end |
| 16811 |
do |
| 16812 |
_L1[724] = _L1[3].payload[1].payload |
| 16813 |
_L1[725] = _L1[3].payload[2] |
| 16814 |
_L1[726] = _L1[1].output_directory |
| 16815 |
if _L1[726].tag == "NONE" then |
| 16816 |
_L1[727] = _L1[1].bibtex_or_biber |
| 16817 |
_L1[728] = _L1[1].change_directory |
| 16818 |
_L1[729] = _L1[1].check_driver |
| 16819 |
_L1[730] = _L1[1].color |
| 16820 |
_L1[731] = _L1[1].config_file |
| 16821 |
_L1[732] = _L1[1].dvipdfmx_extraoptions |
| 16822 |
_L1[733] = _L1[1].engine |
| 16823 |
_L1[734] = _L1[1].engine_executable |
| 16824 |
_L1[735] = _L1[1].file_line_error |
| 16825 |
_L1[736] = _L1[1].fmt |
| 16826 |
_L1[737] = _L1[1].fresh |
| 16827 |
_L1[738] = _L1[1].halt_on_error |
| 16828 |
_L1[739] = _L1[1].includeonly |
| 16829 |
_L1[740] = _L1[1].interaction |
| 16830 |
_L1[741] = _L1[1].jobname |
| 16831 |
_L1[742] = _L1[1].make_depends |
| 16832 |
_L1[743] = _L1[1].makeglossaries |
| 16833 |
_L1[744] = _L1[1].makeindex |
| 16834 |
_L1[745] = _L1[1].max_iterations |
| 16835 |
_L1[746] = _L1[1].output |
| 16836 |
_L1[747] = _L1[1].output_format |
| 16837 |
_L1[748] = _L1[1].package_support |
| 16838 |
_L1[749] = _L1[1].print_output_directory |
| 16839 |
_L1[750] = _L1[1].shell_escape |
| 16840 |
_L1[751] = _L1[1].source_date_epoch |
| 16841 |
_L1[752] = _L1[1].start_with_draft |
| 16842 |
_L1[753] = _L1[1].synctex |
| 16843 |
_L1[754] = _L1[1].tex_extraoptions |
| 16844 |
_L1[755] = _L1[1].watch |
| 16845 |
_L[536] = {bibtex_or_biber = _L1[727], change_directory = _L1[728], check_driver = _L1[729], color = _L1[730], config_file = _L1[731], dvipdfmx_extraoptions = _L1[732], engine = _L1[733], engine_executable = _L1[734], file_line_error = _L1[735], fmt = _L1[736], fresh = _L1[737], halt_on_error = _L1[738], includeonly = _L1[739], interaction = _L1[740], jobname = _L1[741], make_depends = _L1[742], makeglossaries = _L1[743], makeindex = _L1[744], max_iterations = _L1[745], output = _L1[746], output_directory = {tag = "SOME", payload = _L1[724]}, output_format = _L1[747], package_support = _L1[748], print_output_directory = _L1[749], shell_escape = _L1[750], source_date_epoch = _L1[751], start_with_draft = _L1[752], synctex = _L1[753], tex_extraoptions = _L1[754], watch = _L1[755]} |
| 16846 |
_L[537] = _L1[725] |
| 16847 |
goto cont18 |
| 16848 |
end |
| 16849 |
if _L1[726].tag == "SOME" then |
| 16850 |
else |
| 16851 |
_raise(_Match, "handle-options.sml:284:51") |
| 16852 |
end |
| 16853 |
_L[124]({_L[118], "multiple --output-directory options\n"}) |
| 16854 |
tmp15(1, true) |
| 16855 |
end |
| 16856 |
::else24:: |
| 16857 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_OUTPUT_FORMAT" then |
| 16858 |
else |
| 16859 |
goto else25 |
| 16860 |
end |
| 16861 |
do |
| 16862 |
_L1[756] = _L1[3].payload[1].payload |
| 16863 |
_L1[757] = _L1[3].payload[2] |
| 16864 |
_L1[758] = _L1[1].output_format |
| 16865 |
if _L1[758].tag == "NONE" then |
| 16866 |
else |
| 16867 |
goto else33 |
| 16868 |
end |
| 16869 |
do |
| 16870 |
if _L1[756] == "pdf" then |
| 16871 |
_L1[759] = {tag = "SOME", payload = _L[230]} |
| 16872 |
elseif _L1[756] == "dvi" then |
| 16873 |
_L1[759] = {tag = "SOME", payload = _L[231]} |
| 16874 |
else |
| 16875 |
_L1[759] = NONE |
| 16876 |
end |
| 16877 |
if _L1[759].tag == "SOME" then |
| 16878 |
_L1[760] = _L1[759].payload |
| 16879 |
_L1[761] = _L1[1].bibtex_or_biber |
| 16880 |
_L1[762] = _L1[1].change_directory |
| 16881 |
_L1[763] = _L1[1].check_driver |
| 16882 |
_L1[764] = _L1[1].color |
| 16883 |
_L1[765] = _L1[1].config_file |
| 16884 |
_L1[766] = _L1[1].dvipdfmx_extraoptions |
| 16885 |
_L1[767] = _L1[1].engine |
| 16886 |
_L1[768] = _L1[1].engine_executable |
| 16887 |
_L1[769] = _L1[1].file_line_error |
| 16888 |
_L1[770] = _L1[1].fmt |
| 16889 |
_L1[771] = _L1[1].fresh |
| 16890 |
_L1[772] = _L1[1].halt_on_error |
| 16891 |
_L1[773] = _L1[1].includeonly |
| 16892 |
_L1[774] = _L1[1].interaction |
| 16893 |
_L1[775] = _L1[1].jobname |
| 16894 |
_L1[776] = _L1[1].make_depends |
| 16895 |
_L1[777] = _L1[1].makeglossaries |
| 16896 |
_L1[778] = _L1[1].makeindex |
| 16897 |
_L1[779] = _L1[1].max_iterations |
| 16898 |
_L1[780] = _L1[1].output |
| 16899 |
_L1[781] = _L1[1].output_directory |
| 16900 |
_L1[782] = _L1[1].package_support |
| 16901 |
_L1[783] = _L1[1].print_output_directory |
| 16902 |
_L1[784] = _L1[1].shell_escape |
| 16903 |
_L1[785] = _L1[1].source_date_epoch |
| 16904 |
_L1[786] = _L1[1].start_with_draft |
| 16905 |
_L1[787] = _L1[1].synctex |
| 16906 |
_L1[788] = _L1[1].tex_extraoptions |
| 16907 |
_L1[789] = _L1[1].watch |
| 16908 |
_L[536] = {bibtex_or_biber = _L1[761], change_directory = _L1[762], check_driver = _L1[763], color = _L1[764], config_file = _L1[765], dvipdfmx_extraoptions = _L1[766], engine = _L1[767], engine_executable = _L1[768], file_line_error = _L1[769], fmt = _L1[770], fresh = _L1[771], halt_on_error = _L1[772], includeonly = _L1[773], interaction = _L1[774], jobname = _L1[775], make_depends = _L1[776], makeglossaries = _L1[777], makeindex = _L1[778], max_iterations = _L1[779], output = _L1[780], output_directory = _L1[781], output_format = {tag = "SOME", payload = _L1[760]}, package_support = _L1[782], print_output_directory = _L1[783], shell_escape = _L1[784], source_date_epoch = _L1[785], start_with_draft = _L1[786], synctex = _L1[787], tex_extraoptions = _L1[788], watch = _L1[789]} |
| 16909 |
_L[537] = _L1[757] |
| 16910 |
goto cont18 |
| 16911 |
end |
| 16912 |
if _L1[759].tag == "NONE" then |
| 16913 |
else |
| 16914 |
_raise(_Match, "handle-options.sml:289:66") |
| 16915 |
end |
| 16916 |
_L[124]({_L[118], "invalid value for --output-format option\n"}) |
| 16917 |
tmp15(1, true) |
| 16918 |
end |
| 16919 |
::else33:: |
| 16920 |
if _L1[758].tag == "SOME" then |
| 16921 |
else |
| 16922 |
_raise(_Match, "handle-options.sml:288:53") |
| 16923 |
end |
| 16924 |
_L[124]({_L[118], "multiple --output-format options\n"}) |
| 16925 |
tmp15(1, true) |
| 16926 |
end |
| 16927 |
::else25:: |
| 16928 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_TEX_OPTION" then |
| 16929 |
else |
| 16930 |
goto else26 |
| 16931 |
end |
| 16932 |
do |
| 16933 |
_L1[790] = _L1[3].payload[1].payload |
| 16934 |
_L1[791] = _L1[3].payload[2] |
| 16935 |
_L1[792] = _L[208](_L1[790]) |
| 16936 |
_L1[793] = _L1[1].bibtex_or_biber |
| 16937 |
_L1[794] = _L1[1].change_directory |
| 16938 |
_L1[795] = _L1[1].check_driver |
| 16939 |
_L1[796] = _L1[1].color |
| 16940 |
_L1[797] = _L1[1].config_file |
| 16941 |
_L1[798] = _L1[1].dvipdfmx_extraoptions |
| 16942 |
_L1[799] = _L1[1].engine |
| 16943 |
_L1[800] = _L1[1].engine_executable |
| 16944 |
_L1[801] = _L1[1].file_line_error |
| 16945 |
_L1[802] = _L1[1].fmt |
| 16946 |
_L1[803] = _L1[1].fresh |
| 16947 |
_L1[804] = _L1[1].halt_on_error |
| 16948 |
_L1[805] = _L1[1].includeonly |
| 16949 |
_L1[806] = _L1[1].interaction |
| 16950 |
_L1[807] = _L1[1].jobname |
| 16951 |
_L1[808] = _L1[1].make_depends |
| 16952 |
_L1[809] = _L1[1].makeglossaries |
| 16953 |
_L1[810] = _L1[1].makeindex |
| 16954 |
_L1[811] = _L1[1].max_iterations |
| 16955 |
_L1[812] = _L1[1].output |
| 16956 |
_L1[813] = _L1[1].output_directory |
| 16957 |
_L1[814] = _L1[1].output_format |
| 16958 |
_L1[815] = _L1[1].package_support |
| 16959 |
_L1[816] = _L1[1].print_output_directory |
| 16960 |
_L1[817] = _L1[1].shell_escape |
| 16961 |
_L1[818] = _L1[1].source_date_epoch |
| 16962 |
_L1[819] = _L1[1].start_with_draft |
| 16963 |
_L1[820] = _L1[1].synctex |
| 16964 |
_L1[821] = _L1[1].watch |
| 16965 |
_L[536] = {bibtex_or_biber = _L1[793], change_directory = _L1[794], check_driver = _L1[795], color = _L1[796], config_file = _L1[797], dvipdfmx_extraoptions = _L1[798], engine = _L1[799], engine_executable = _L1[800], file_line_error = _L1[801], fmt = _L1[802], fresh = _L1[803], halt_on_error = _L1[804], includeonly = _L1[805], interaction = _L1[806], jobname = _L1[807], make_depends = _L1[808], makeglossaries = _L1[809], makeindex = _L1[810], max_iterations = _L1[811], output = _L1[812], output_directory = _L1[813], output_format = _L1[814], package_support = _L1[815], print_output_directory = _L1[816], shell_escape = _L1[817], source_date_epoch = _L1[818], start_with_draft = _L1[819], synctex = _L1[820], tex_extraoptions = {_L1[792], _L1[1].tex_extraoptions}, watch = _L1[821]} |
| 16966 |
_L[537] = _L1[791] |
| 16967 |
goto cont18 |
| 16968 |
end |
| 16969 |
::else26:: |
| 16970 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_TEX_OPTIONS" then |
| 16971 |
_L1[822] = _L1[3].payload[1].payload |
| 16972 |
_L1[823] = _L1[3].payload[2] |
| 16973 |
_L1[824] = _L1[1].bibtex_or_biber |
| 16974 |
_L1[825] = _L1[1].change_directory |
| 16975 |
_L1[826] = _L1[1].check_driver |
| 16976 |
_L1[827] = _L1[1].color |
| 16977 |
_L1[828] = _L1[1].config_file |
| 16978 |
_L1[829] = _L1[1].dvipdfmx_extraoptions |
| 16979 |
_L1[830] = _L1[1].engine |
| 16980 |
_L1[831] = _L1[1].engine_executable |
| 16981 |
_L1[832] = _L1[1].file_line_error |
| 16982 |
_L1[833] = _L1[1].fmt |
| 16983 |
_L1[834] = _L1[1].fresh |
| 16984 |
_L1[835] = _L1[1].halt_on_error |
| 16985 |
_L1[836] = _L1[1].includeonly |
| 16986 |
_L1[837] = _L1[1].interaction |
| 16987 |
_L1[838] = _L1[1].jobname |
| 16988 |
_L1[839] = _L1[1].make_depends |
| 16989 |
_L1[840] = _L1[1].makeglossaries |
| 16990 |
_L1[841] = _L1[1].makeindex |
| 16991 |
_L1[842] = _L1[1].max_iterations |
| 16992 |
_L1[843] = _L1[1].output |
| 16993 |
_L1[844] = _L1[1].output_directory |
| 16994 |
_L1[845] = _L1[1].output_format |
| 16995 |
_L1[846] = _L1[1].package_support |
| 16996 |
_L1[847] = _L1[1].print_output_directory |
| 16997 |
_L1[848] = _L1[1].shell_escape |
| 16998 |
_L1[849] = _L1[1].source_date_epoch |
| 16999 |
_L1[850] = _L1[1].start_with_draft |
| 17000 |
_L1[851] = _L1[1].synctex |
| 17001 |
_L1[852] = _L1[1].watch |
| 17002 |
_L[536] = {bibtex_or_biber = _L1[824], change_directory = _L1[825], check_driver = _L1[826], color = _L1[827], config_file = _L1[828], dvipdfmx_extraoptions = _L1[829], engine = _L1[830], engine_executable = _L1[831], file_line_error = _L1[832], fmt = _L1[833], fresh = _L1[834], halt_on_error = _L1[835], includeonly = _L1[836], interaction = _L1[837], jobname = _L1[838], make_depends = _L1[839], makeglossaries = _L1[840], makeindex = _L1[841], max_iterations = _L1[842], output = _L1[843], output_directory = _L1[844], output_format = _L1[845], package_support = _L1[846], print_output_directory = _L1[847], shell_escape = _L1[848], source_date_epoch = _L1[849], start_with_draft = _L1[850], synctex = _L1[851], tex_extraoptions = {_L1[822], _L1[1].tex_extraoptions}, watch = _L1[852]} |
| 17003 |
_L[537] = _L1[823] |
| 17004 |
goto cont18 |
| 17005 |
end |
| 17006 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_DVIPDFMX_OPTION" then |
| 17007 |
else |
| 17008 |
goto else27 |
| 17009 |
end |
| 17010 |
do |
| 17011 |
_L1[853] = _L1[3].payload[1].payload |
| 17012 |
_L1[854] = _L1[3].payload[2] |
| 17013 |
_L1[855] = _L[208](_L1[853]) |
| 17014 |
_L1[856] = _L1[1].bibtex_or_biber |
| 17015 |
_L1[857] = _L1[1].change_directory |
| 17016 |
_L1[858] = _L1[1].check_driver |
| 17017 |
_L1[859] = _L1[1].color |
| 17018 |
_L1[860] = _L1[1].config_file |
| 17019 |
_L1[861] = _L1[1].engine |
| 17020 |
_L1[862] = _L1[1].engine_executable |
| 17021 |
_L1[863] = _L1[1].file_line_error |
| 17022 |
_L1[864] = _L1[1].fmt |
| 17023 |
_L1[865] = _L1[1].fresh |
| 17024 |
_L1[866] = _L1[1].halt_on_error |
| 17025 |
_L1[867] = _L1[1].includeonly |
| 17026 |
_L1[868] = _L1[1].interaction |
| 17027 |
_L1[869] = _L1[1].jobname |
| 17028 |
_L1[870] = _L1[1].make_depends |
| 17029 |
_L1[871] = _L1[1].makeglossaries |
| 17030 |
_L1[872] = _L1[1].makeindex |
| 17031 |
_L1[873] = _L1[1].max_iterations |
| 17032 |
_L1[874] = _L1[1].output |
| 17033 |
_L1[875] = _L1[1].output_directory |
| 17034 |
_L1[876] = _L1[1].output_format |
| 17035 |
_L1[877] = _L1[1].package_support |
| 17036 |
_L1[878] = _L1[1].print_output_directory |
| 17037 |
_L1[879] = _L1[1].shell_escape |
| 17038 |
_L1[880] = _L1[1].source_date_epoch |
| 17039 |
_L1[881] = _L1[1].start_with_draft |
| 17040 |
_L1[882] = _L1[1].synctex |
| 17041 |
_L1[883] = _L1[1].tex_extraoptions |
| 17042 |
_L1[884] = _L1[1].watch |
| 17043 |
_L[536] = {bibtex_or_biber = _L1[856], change_directory = _L1[857], check_driver = _L1[858], color = _L1[859], config_file = _L1[860], dvipdfmx_extraoptions = {_L1[855], _L1[1].dvipdfmx_extraoptions}, engine = _L1[861], engine_executable = _L1[862], file_line_error = _L1[863], fmt = _L1[864], fresh = _L1[865], halt_on_error = _L1[866], includeonly = _L1[867], interaction = _L1[868], jobname = _L1[869], make_depends = _L1[870], makeglossaries = _L1[871], makeindex = _L1[872], max_iterations = _L1[873], output = _L1[874], output_directory = _L1[875], output_format = _L1[876], package_support = _L1[877], print_output_directory = _L1[878], shell_escape = _L1[879], source_date_epoch = _L1[880], start_with_draft = _L1[881], synctex = _L1[882], tex_extraoptions = _L1[883], watch = _L1[884]} |
| 17044 |
_L[537] = _L1[854] |
| 17045 |
goto cont18 |
| 17046 |
end |
| 17047 |
::else27:: |
| 17048 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_DVIPDFMX_OPTIONS" then |
| 17049 |
_L1[885] = _L1[3].payload[1].payload |
| 17050 |
_L1[886] = _L1[3].payload[2] |
| 17051 |
_L1[887] = _L1[1].bibtex_or_biber |
| 17052 |
_L1[888] = _L1[1].change_directory |
| 17053 |
_L1[889] = _L1[1].check_driver |
| 17054 |
_L1[890] = _L1[1].color |
| 17055 |
_L1[891] = _L1[1].config_file |
| 17056 |
_L1[892] = _L1[1].dvipdfmx_extraoptions |
| 17057 |
_L1[893] = _L1[1].engine |
| 17058 |
_L1[894] = _L1[1].engine_executable |
| 17059 |
_L1[895] = _L1[1].file_line_error |
| 17060 |
_L1[896] = _L1[1].fmt |
| 17061 |
_L1[897] = _L1[1].fresh |
| 17062 |
_L1[898] = _L1[1].halt_on_error |
| 17063 |
_L1[899] = _L1[1].includeonly |
| 17064 |
_L1[900] = _L1[1].interaction |
| 17065 |
_L1[901] = _L1[1].jobname |
| 17066 |
_L1[902] = _L1[1].make_depends |
| 17067 |
_L1[903] = _L1[1].makeglossaries |
| 17068 |
_L1[904] = _L1[1].makeindex |
| 17069 |
_L1[905] = _L1[1].max_iterations |
| 17070 |
_L1[906] = _L1[1].output |
| 17071 |
_L1[907] = _L1[1].output_directory |
| 17072 |
_L1[908] = _L1[1].output_format |
| 17073 |
_L1[909] = _L1[1].package_support |
| 17074 |
_L1[910] = _L1[1].print_output_directory |
| 17075 |
_L1[911] = _L1[1].shell_escape |
| 17076 |
_L1[912] = _L1[1].source_date_epoch |
| 17077 |
_L1[913] = _L1[1].start_with_draft |
| 17078 |
_L1[914] = _L1[1].synctex |
| 17079 |
_L1[915] = _L1[1].watch |
| 17080 |
_L[536] = {bibtex_or_biber = _L1[887], change_directory = _L1[888], check_driver = _L1[889], color = _L1[890], config_file = _L1[891], dvipdfmx_extraoptions = _L1[892], engine = _L1[893], engine_executable = _L1[894], file_line_error = _L1[895], fmt = _L1[896], fresh = _L1[897], halt_on_error = _L1[898], includeonly = _L1[899], interaction = _L1[900], jobname = _L1[901], make_depends = _L1[902], makeglossaries = _L1[903], makeindex = _L1[904], max_iterations = _L1[905], output = _L1[906], output_directory = _L1[907], output_format = _L1[908], package_support = _L1[909], print_output_directory = _L1[910], shell_escape = _L1[911], source_date_epoch = _L1[912], start_with_draft = _L1[913], synctex = _L1[914], tex_extraoptions = {_L1[885], _L1[1].dvipdfmx_extraoptions}, watch = _L1[915]} |
| 17081 |
_L[537] = _L1[886] |
| 17082 |
goto cont18 |
| 17083 |
end |
| 17084 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_MAKEINDEX" then |
| 17085 |
else |
| 17086 |
goto else28 |
| 17087 |
end |
| 17088 |
do |
| 17089 |
_L1[916] = _L1[3].payload[1].payload |
| 17090 |
_L1[917] = _L1[3].payload[2] |
| 17091 |
_L1[918] = _L1[1].makeindex |
| 17092 |
if _L1[918].tag == "NONE" then |
| 17093 |
_L1[919] = _L1[1].bibtex_or_biber |
| 17094 |
_L1[920] = _L1[1].change_directory |
| 17095 |
_L1[921] = _L1[1].check_driver |
| 17096 |
_L1[922] = _L1[1].color |
| 17097 |
_L1[923] = _L1[1].config_file |
| 17098 |
_L1[924] = _L1[1].dvipdfmx_extraoptions |
| 17099 |
_L1[925] = _L1[1].engine |
| 17100 |
_L1[926] = _L1[1].engine_executable |
| 17101 |
_L1[927] = _L1[1].file_line_error |
| 17102 |
_L1[928] = _L1[1].fmt |
| 17103 |
_L1[929] = _L1[1].fresh |
| 17104 |
_L1[930] = _L1[1].halt_on_error |
| 17105 |
_L1[931] = _L1[1].includeonly |
| 17106 |
_L1[932] = _L1[1].interaction |
| 17107 |
_L1[933] = _L1[1].jobname |
| 17108 |
_L1[934] = _L1[1].make_depends |
| 17109 |
_L1[935] = _L1[1].makeglossaries |
| 17110 |
_L1[936] = _L1[1].max_iterations |
| 17111 |
_L1[937] = _L1[1].output |
| 17112 |
_L1[938] = _L1[1].output_directory |
| 17113 |
_L1[939] = _L1[1].output_format |
| 17114 |
_L1[940] = _L1[1].package_support |
| 17115 |
_L1[941] = _L1[1].print_output_directory |
| 17116 |
_L1[942] = _L1[1].shell_escape |
| 17117 |
_L1[943] = _L1[1].source_date_epoch |
| 17118 |
_L1[944] = _L1[1].start_with_draft |
| 17119 |
_L1[945] = _L1[1].synctex |
| 17120 |
_L1[946] = _L1[1].tex_extraoptions |
| 17121 |
_L1[947] = _L1[1].watch |
| 17122 |
_L[536] = {bibtex_or_biber = _L1[919], change_directory = _L1[920], check_driver = _L1[921], color = _L1[922], config_file = _L1[923], dvipdfmx_extraoptions = _L1[924], engine = _L1[925], engine_executable = _L1[926], file_line_error = _L1[927], fmt = _L1[928], fresh = _L1[929], halt_on_error = _L1[930], includeonly = _L1[931], interaction = _L1[932], jobname = _L1[933], make_depends = _L1[934], makeglossaries = _L1[935], makeindex = {tag = "SOME", payload = _L1[916]}, max_iterations = _L1[936], output = _L1[937], output_directory = _L1[938], output_format = _L1[939], package_support = _L1[940], print_output_directory = _L1[941], shell_escape = _L1[942], source_date_epoch = _L1[943], start_with_draft = _L1[944], synctex = _L1[945], tex_extraoptions = _L1[946], watch = _L1[947]} |
| 17123 |
_L[537] = _L1[917] |
| 17124 |
goto cont18 |
| 17125 |
end |
| 17126 |
if _L1[918].tag == "SOME" then |
| 17127 |
else |
| 17128 |
_raise(_Match, "handle-options.sml:303:44") |
| 17129 |
end |
| 17130 |
_L[124]({_L[118], "multiple --makeindex options\n"}) |
| 17131 |
tmp15(1, true) |
| 17132 |
end |
| 17133 |
::else28:: |
| 17134 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_BIBTEX" then |
| 17135 |
else |
| 17136 |
goto else29 |
| 17137 |
end |
| 17138 |
do |
| 17139 |
_L1[948] = _L1[3].payload[1].payload |
| 17140 |
_L1[949] = _L1[3].payload[2] |
| 17141 |
_L1[950] = _L1[1].bibtex_or_biber |
| 17142 |
if _L1[950].tag == "NONE" then |
| 17143 |
_L1[951] = _L1[1].change_directory |
| 17144 |
_L1[952] = _L1[1].check_driver |
| 17145 |
_L1[953] = _L1[1].color |
| 17146 |
_L1[954] = _L1[1].config_file |
| 17147 |
_L1[955] = _L1[1].dvipdfmx_extraoptions |
| 17148 |
_L1[956] = _L1[1].engine |
| 17149 |
_L1[957] = _L1[1].engine_executable |
| 17150 |
_L1[958] = _L1[1].file_line_error |
| 17151 |
_L1[959] = _L1[1].fmt |
| 17152 |
_L1[960] = _L1[1].fresh |
| 17153 |
_L1[961] = _L1[1].halt_on_error |
| 17154 |
_L1[962] = _L1[1].includeonly |
| 17155 |
_L1[963] = _L1[1].interaction |
| 17156 |
_L1[964] = _L1[1].jobname |
| 17157 |
_L1[965] = _L1[1].make_depends |
| 17158 |
_L1[966] = _L1[1].makeglossaries |
| 17159 |
_L1[967] = _L1[1].makeindex |
| 17160 |
_L1[968] = _L1[1].max_iterations |
| 17161 |
_L1[969] = _L1[1].output |
| 17162 |
_L1[970] = _L1[1].output_directory |
| 17163 |
_L1[971] = _L1[1].output_format |
| 17164 |
_L1[972] = _L1[1].package_support |
| 17165 |
_L1[973] = _L1[1].print_output_directory |
| 17166 |
_L1[974] = _L1[1].shell_escape |
| 17167 |
_L1[975] = _L1[1].source_date_epoch |
| 17168 |
_L1[976] = _L1[1].start_with_draft |
| 17169 |
_L1[977] = _L1[1].synctex |
| 17170 |
_L1[978] = _L1[1].tex_extraoptions |
| 17171 |
_L1[979] = _L1[1].watch |
| 17172 |
_L[536] = {bibtex_or_biber = {tag = "SOME", payload = {tag = "BIBTEX", payload = _L1[948]}}, change_directory = _L1[951], check_driver = _L1[952], color = _L1[953], config_file = _L1[954], dvipdfmx_extraoptions = _L1[955], engine = _L1[956], engine_executable = _L1[957], file_line_error = _L1[958], fmt = _L1[959], fresh = _L1[960], halt_on_error = _L1[961], includeonly = _L1[962], interaction = _L1[963], jobname = _L1[964], make_depends = _L1[965], makeglossaries = _L1[966], makeindex = _L1[967], max_iterations = _L1[968], output = _L1[969], output_directory = _L1[970], output_format = _L1[971], package_support = _L1[972], print_output_directory = _L1[973], shell_escape = _L1[974], source_date_epoch = _L1[975], start_with_draft = _L1[976], synctex = _L1[977], tex_extraoptions = _L1[978], watch = _L1[979]} |
| 17173 |
_L[537] = _L1[949] |
| 17174 |
goto cont18 |
| 17175 |
end |
| 17176 |
if _L1[950].tag == "SOME" then |
| 17177 |
else |
| 17178 |
_raise(_Match, "handle-options.sml:307:41") |
| 17179 |
end |
| 17180 |
_L[124]({_L[118], "multiple --bibtex / --biber options\n"}) |
| 17181 |
tmp15(1, true) |
| 17182 |
end |
| 17183 |
::else29:: |
| 17184 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_BIBER" then |
| 17185 |
else |
| 17186 |
goto else30 |
| 17187 |
end |
| 17188 |
do |
| 17189 |
_L1[980] = _L1[3].payload[1].payload |
| 17190 |
_L1[981] = _L1[3].payload[2] |
| 17191 |
_L1[982] = _L1[1].bibtex_or_biber |
| 17192 |
if _L1[982].tag == "NONE" then |
| 17193 |
_L1[983] = _L1[1].change_directory |
| 17194 |
_L1[984] = _L1[1].check_driver |
| 17195 |
_L1[985] = _L1[1].color |
| 17196 |
_L1[986] = _L1[1].config_file |
| 17197 |
_L1[987] = _L1[1].dvipdfmx_extraoptions |
| 17198 |
_L1[988] = _L1[1].engine |
| 17199 |
_L1[989] = _L1[1].engine_executable |
| 17200 |
_L1[990] = _L1[1].file_line_error |
| 17201 |
_L1[991] = _L1[1].fmt |
| 17202 |
_L1[992] = _L1[1].fresh |
| 17203 |
_L1[993] = _L1[1].halt_on_error |
| 17204 |
_L1[994] = _L1[1].includeonly |
| 17205 |
_L1[995] = _L1[1].interaction |
| 17206 |
_L1[996] = _L1[1].jobname |
| 17207 |
_L1[997] = _L1[1].make_depends |
| 17208 |
_L1[998] = _L1[1].makeglossaries |
| 17209 |
_L1[999] = _L1[1].makeindex |
| 17210 |
_L1[1000] = _L1[1].max_iterations |
| 17211 |
_L1[1001] = _L1[1].output |
| 17212 |
_L1[1002] = _L1[1].output_directory |
| 17213 |
_L1[1003] = _L1[1].output_format |
| 17214 |
_L1[1004] = _L1[1].package_support |
| 17215 |
_L1[1005] = _L1[1].print_output_directory |
| 17216 |
_L1[1006] = _L1[1].shell_escape |
| 17217 |
_L1[1007] = _L1[1].source_date_epoch |
| 17218 |
_L1[1008] = _L1[1].start_with_draft |
| 17219 |
_L1[1009] = _L1[1].synctex |
| 17220 |
_L1[1010] = _L1[1].tex_extraoptions |
| 17221 |
_L1[1011] = _L1[1].watch |
| 17222 |
_L[536] = {bibtex_or_biber = {tag = "SOME", payload = {tag = "BIBER", payload = _L1[980]}}, change_directory = _L1[983], check_driver = _L1[984], color = _L1[985], config_file = _L1[986], dvipdfmx_extraoptions = _L1[987], engine = _L1[988], engine_executable = _L1[989], file_line_error = _L1[990], fmt = _L1[991], fresh = _L1[992], halt_on_error = _L1[993], includeonly = _L1[994], interaction = _L1[995], jobname = _L1[996], make_depends = _L1[997], makeglossaries = _L1[998], makeindex = _L1[999], max_iterations = _L1[1000], output = _L1[1001], output_directory = _L1[1002], output_format = _L1[1003], package_support = _L1[1004], print_output_directory = _L1[1005], shell_escape = _L1[1006], source_date_epoch = _L1[1007], start_with_draft = _L1[1008], synctex = _L1[1009], tex_extraoptions = _L1[1010], watch = _L1[1011]} |
| 17223 |
_L[537] = _L1[981] |
| 17224 |
goto cont18 |
| 17225 |
end |
| 17226 |
if _L1[982].tag == "SOME" then |
| 17227 |
else |
| 17228 |
_raise(_Match, "handle-options.sml:311:40") |
| 17229 |
end |
| 17230 |
_L[124]({_L[118], "multiple --bibtex / --biber options\n"}) |
| 17231 |
tmp15(1, true) |
| 17232 |
end |
| 17233 |
::else30:: |
| 17234 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_MAKEGLOSSARIES" then |
| 17235 |
else |
| 17236 |
goto else31 |
| 17237 |
end |
| 17238 |
do |
| 17239 |
_L1[1012] = _L1[3].payload[1].payload |
| 17240 |
_L1[1013] = _L1[3].payload[2] |
| 17241 |
_L1[1014] = _L1[1].makeglossaries |
| 17242 |
if _L1[1014].tag == "NONE" then |
| 17243 |
_L1[1015] = _L1[1].bibtex_or_biber |
| 17244 |
_L1[1016] = _L1[1].change_directory |
| 17245 |
_L1[1017] = _L1[1].check_driver |
| 17246 |
_L1[1018] = _L1[1].color |
| 17247 |
_L1[1019] = _L1[1].config_file |
| 17248 |
_L1[1020] = _L1[1].dvipdfmx_extraoptions |
| 17249 |
_L1[1021] = _L1[1].engine |
| 17250 |
_L1[1022] = _L1[1].engine_executable |
| 17251 |
_L1[1023] = _L1[1].file_line_error |
| 17252 |
_L1[1024] = _L1[1].fmt |
| 17253 |
_L1[1025] = _L1[1].fresh |
| 17254 |
_L1[1026] = _L1[1].halt_on_error |
| 17255 |
_L1[1027] = _L1[1].includeonly |
| 17256 |
_L1[1028] = _L1[1].interaction |
| 17257 |
_L1[1029] = _L1[1].jobname |
| 17258 |
_L1[1030] = _L1[1].make_depends |
| 17259 |
_L1[1031] = _L1[1].makeindex |
| 17260 |
_L1[1032] = _L1[1].max_iterations |
| 17261 |
_L1[1033] = _L1[1].output |
| 17262 |
_L1[1034] = _L1[1].output_directory |
| 17263 |
_L1[1035] = _L1[1].output_format |
| 17264 |
_L1[1036] = _L1[1].package_support |
| 17265 |
_L1[1037] = _L1[1].print_output_directory |
| 17266 |
_L1[1038] = _L1[1].shell_escape |
| 17267 |
_L1[1039] = _L1[1].source_date_epoch |
| 17268 |
_L1[1040] = _L1[1].start_with_draft |
| 17269 |
_L1[1041] = _L1[1].synctex |
| 17270 |
_L1[1042] = _L1[1].tex_extraoptions |
| 17271 |
_L1[1043] = _L1[1].watch |
| 17272 |
_L[536] = {bibtex_or_biber = _L1[1015], change_directory = _L1[1016], check_driver = _L1[1017], color = _L1[1018], config_file = _L1[1019], dvipdfmx_extraoptions = _L1[1020], engine = _L1[1021], engine_executable = _L1[1022], file_line_error = _L1[1023], fmt = _L1[1024], fresh = _L1[1025], halt_on_error = _L1[1026], includeonly = _L1[1027], interaction = _L1[1028], jobname = _L1[1029], make_depends = _L1[1030], makeglossaries = {tag = "SOME", payload = _L1[1012]}, makeindex = _L1[1031], max_iterations = _L1[1032], output = _L1[1033], output_directory = _L1[1034], output_format = _L1[1035], package_support = _L1[1036], print_output_directory = _L1[1037], shell_escape = _L1[1038], source_date_epoch = _L1[1039], start_with_draft = _L1[1040], synctex = _L1[1041], tex_extraoptions = _L1[1042], watch = _L1[1043]} |
| 17273 |
_L[537] = _L1[1013] |
| 17274 |
goto cont18 |
| 17275 |
end |
| 17276 |
if _L1[1014].tag == "SOME" then |
| 17277 |
else |
| 17278 |
_raise(_Match, "handle-options.sml:315:49") |
| 17279 |
end |
| 17280 |
_L[124]({_L[118], "multiple --makeglossaries options\n"}) |
| 17281 |
tmp15(1, true) |
| 17282 |
end |
| 17283 |
::else31:: |
| 17284 |
if _L1[3].tag == "SOME" and _L1[3].payload[1].tag == "OPT_CONFIG_FILE" then |
| 17285 |
else |
| 17286 |
goto else32 |
| 17287 |
end |
| 17288 |
do |
| 17289 |
_L1[1044] = _L1[3].payload[1].payload |
| 17290 |
_L1[1045] = _L1[3].payload[2] |
| 17291 |
_L1[1046] = _L1[1].config_file |
| 17292 |
if _L1[1046].tag == "NONE" then |
| 17293 |
_L1[1047] = _L1[1].bibtex_or_biber |
| 17294 |
_L1[1048] = _L1[1].change_directory |
| 17295 |
_L1[1049] = _L1[1].check_driver |
| 17296 |
_L1[1050] = _L1[1].color |
| 17297 |
_L1[1051] = _L1[1].dvipdfmx_extraoptions |
| 17298 |
_L1[1052] = _L1[1].engine |
| 17299 |
_L1[1053] = _L1[1].engine_executable |
| 17300 |
_L1[1054] = _L1[1].file_line_error |
| 17301 |
_L1[1055] = _L1[1].fmt |
| 17302 |
_L1[1056] = _L1[1].fresh |
| 17303 |
_L1[1057] = _L1[1].halt_on_error |
| 17304 |
_L1[1058] = _L1[1].includeonly |
| 17305 |
_L1[1059] = _L1[1].interaction |
| 17306 |
_L1[1060] = _L1[1].jobname |
| 17307 |
_L1[1061] = _L1[1].make_depends |
| 17308 |
_L1[1062] = _L1[1].makeglossaries |
| 17309 |
_L1[1063] = _L1[1].makeindex |
| 17310 |
_L1[1064] = _L1[1].max_iterations |
| 17311 |
_L1[1065] = _L1[1].output |
| 17312 |
_L1[1066] = _L1[1].output_directory |
| 17313 |
_L1[1067] = _L1[1].output_format |
| 17314 |
_L1[1068] = _L1[1].package_support |
| 17315 |
_L1[1069] = _L1[1].print_output_directory |
| 17316 |
_L1[1070] = _L1[1].shell_escape |
| 17317 |
_L1[1071] = _L1[1].source_date_epoch |
| 17318 |
_L1[1072] = _L1[1].start_with_draft |
| 17319 |
_L1[1073] = _L1[1].synctex |
| 17320 |
_L1[1074] = _L1[1].tex_extraoptions |
| 17321 |
_L1[1075] = _L1[1].watch |
| 17322 |
_L[536] = {bibtex_or_biber = _L1[1047], change_directory = _L1[1048], check_driver = _L1[1049], color = _L1[1050], config_file = {tag = "SOME", payload = _L1[1044]}, dvipdfmx_extraoptions = _L1[1051], engine = _L1[1052], engine_executable = _L1[1053], file_line_error = _L1[1054], fmt = _L1[1055], fresh = _L1[1056], halt_on_error = _L1[1057], includeonly = _L1[1058], interaction = _L1[1059], jobname = _L1[1060], make_depends = _L1[1061], makeglossaries = _L1[1062], makeindex = _L1[1063], max_iterations = _L1[1064], output = _L1[1065], output_directory = _L1[1066], output_format = _L1[1067], package_support = _L1[1068], print_output_directory = _L1[1069], shell_escape = _L1[1070], source_date_epoch = _L1[1071], start_with_draft = _L1[1072], synctex = _L1[1073], tex_extraoptions = _L1[1074], watch = _L1[1075]} |
| 17323 |
_L[537] = _L1[1045] |
| 17324 |
goto cont18 |
| 17325 |
end |
| 17326 |
if _L1[1046].tag == "SOME" then |
| 17327 |
else |
| 17328 |
_raise(_Match, "handle-options.sml:319:46") |
| 17329 |
end |
| 17330 |
_L[124]({_L[118], "multiple --config-file options\n"}) |
| 17331 |
tmp15(1, true) |
| 17332 |
end |
| 17333 |
::else32:: |
| 17334 |
if _L1[3].tag == "NONE" then |
| 17335 |
else |
| 17336 |
_raise(_Match, "handle-options.sml:167:7") |
| 17337 |
end |
| 17338 |
do |
| 17339 |
if _L1[2] ~= nil and _L1[2][1] == "--" then |
| 17340 |
_L[535] = {_L1[1], _L1[2][2]} |
| 17341 |
goto cont5 |
| 17342 |
end |
| 17343 |
if _L1[2] ~= nil then |
| 17344 |
else |
| 17345 |
if _L1[2] == nil then |
| 17346 |
else |
| 17347 |
_raise(_Match, "handle-options.sml:323:20") |
| 17348 |
end |
| 17349 |
_L[535] = _L[373]() |
| 17350 |
goto cont5 |
| 17351 |
end |
| 17352 |
do |
| 17353 |
_L1[1076] = _L1[2][1] |
| 17354 |
_L1[1077] = isPrefix("-") |
| 17355 |
_L1[1078] = _L1[1077](_L1[1076]) |
| 17356 |
if _L1[1078] then |
| 17357 |
else |
| 17358 |
_L[535] = {_L1[1], _L1[2]} |
| 17359 |
goto cont5 |
| 17360 |
end |
| 17361 |
_L[124]({_L[118], "Unrecognized option: " .. _L1[1076] .. ".\n" .. "\n"}) |
| 17362 |
tmp15(1, true) |
| 17363 |
end |
| 17364 |
end |
| 17365 |
end |
| 17366 |
end |
| 17367 |
::cont5:: |
| 17368 |
_L[538] = _L[535][1] |
| 17369 |
_L[539] = _L[535][2] |
| 17370 |
_L[540] = _L[538].config_file |
| 17371 |
do |
| 17372 |
if _L[540].tag == "SOME" then |
| 17373 |
_L[542] = {tag = "SOME", payload = _L[540].payload} |
| 17374 |
goto cont18 |
| 17375 |
end |
| 17376 |
if _L[540].tag == "NONE" then |
| 17377 |
do |
| 17378 |
_L[544] = tmp16("CLUTTEX_CONFIG_FILE") |
| 17379 |
if _L[544] == nil then |
| 17380 |
_L[543] = NONE |
| 17381 |
else |
| 17382 |
_L[543] = {tag = "SOME", payload = _L[544]} |
| 17383 |
end |
| 17384 |
end |
| 17385 |
if _L[543].tag == "SOME" then |
| 17386 |
_L[542] = {tag = "SOME", payload = _L[543].payload} |
| 17387 |
goto cont18 |
| 17388 |
end |
| 17389 |
if _L[543].tag == "NONE" then |
| 17390 |
if _L[220] then |
| 17391 |
do |
| 17392 |
_L[546] = tmp16("APPDATA") |
| 17393 |
if _L[546] == nil then |
| 17394 |
_L[545] = NONE |
| 17395 |
else |
| 17396 |
_L[545] = {tag = "SOME", payload = _L[546]} |
| 17397 |
end |
| 17398 |
end |
| 17399 |
if _L[545].tag == "SOME" then |
| 17400 |
_L[542] = {tag = "SOME", payload = _L[545].payload .. "\\cluttex\\config.toml"} |
| 17401 |
goto cont18 |
| 17402 |
elseif _L[545].tag == "NONE" then |
| 17403 |
_L[542] = NONE |
| 17404 |
goto cont18 |
| 17405 |
else |
| 17406 |
_raise(_Match, "main.sml:754:45") |
| 17407 |
end |
| 17408 |
end |
| 17409 |
do |
| 17410 |
_L[548] = tmp16("XDG_CONFIG_HOME") |
| 17411 |
if _L[548] == nil then |
| 17412 |
_L[547] = NONE |
| 17413 |
else |
| 17414 |
_L[547] = {tag = "SOME", payload = _L[548]} |
| 17415 |
end |
| 17416 |
end |
| 17417 |
if _L[547].tag == "SOME" then |
| 17418 |
_L[542] = {tag = "SOME", payload = _L[547].payload .. "/cluttex/config.toml"} |
| 17419 |
goto cont18 |
| 17420 |
end |
| 17421 |
if _L[547].tag == "NONE" then |
| 17422 |
do |
| 17423 |
_L[550] = tmp16("HOME") |
| 17424 |
if _L[550] == nil then |
| 17425 |
_L[549] = NONE |
| 17426 |
else |
| 17427 |
_L[549] = {tag = "SOME", payload = _L[550]} |
| 17428 |
end |
| 17429 |
end |
| 17430 |
if _L[549].tag == "SOME" then |
| 17431 |
_L[542] = {tag = "SOME", payload = _L[549].payload .. "/.config/cluttex/config.toml"} |
| 17432 |
elseif _L[549].tag == "NONE" then |
| 17433 |
_L[542] = NONE |
| 17434 |
else |
| 17435 |
_raise(_Match, "main.sml:760:57") |
| 17436 |
end |
| 17437 |
else |
| 17438 |
_raise(_Match, "main.sml:758:45") |
| 17439 |
end |
| 17440 |
else |
| 17441 |
_raise(_Match, "main.sml:751:30") |
| 17442 |
end |
| 17443 |
else |
| 17444 |
_raise(_Match, "main.sml:750:5") |
| 17445 |
end |
| 17446 |
::cont18:: |
| 17447 |
if _L[542].tag == "NONE" then |
| 17448 |
_L[541] = _L[363] |
| 17449 |
goto cont6 |
| 17450 |
end |
| 17451 |
if _L[542].tag == "SOME" then |
| 17452 |
else |
| 17453 |
_raise(_Match, "main.sml:764:32") |
| 17454 |
end |
| 17455 |
do |
| 17456 |
_L[551] = _L[542].payload |
| 17457 |
_L[552], _L[553] = _handle(function() |
| 17458 |
local tmp54, tmp55, expect, skipWhiteSpace, skipWhiteSpaceAndGetc, skipUntilNewline, skipWhiteSpaceOrComment, skipWhiteSpaceOrCommentOrNewlineAndGetc, skipOptionalNewline, go, checkAllowedChar, go1, go2, readHexInt, readOctInt, readBinInt, readSigned, readUnsigned |
| 17459 |
do |
| 17460 |
local ins = _L[115](_L[551]) |
| 17461 |
tmp54 = _L[122](ins) |
| 17462 |
tmp55 = function(strm, state) |
| 17463 |
local tmp56 = _L[94](strm) |
| 17464 |
if state == "START" and tmp56.tag == "NONE" then |
| 17465 |
return NONE |
| 17466 |
end |
| 17467 |
if tmp56.tag == "NONE" then |
| 17468 |
_raise(_L[172], "validate_utf8.sml:67:22") |
| 17469 |
end |
| 17470 |
if tmp56.tag == "SOME" then |
| 17471 |
local c = tmp56.payload[1] |
| 17472 |
local strm1 = tmp56.payload[2] |
| 17473 |
local tmp57 |
| 17474 |
if state == "START" then |
| 17475 |
if c < 128 then |
| 17476 |
tmp57 = _L[173] |
| 17477 |
goto cont |
| 17478 |
end |
| 17479 |
if c < 224 then |
| 17480 |
if 194 <= c then |
| 17481 |
tmp57 = _L[178] |
| 17482 |
goto cont |
| 17483 |
else |
| 17484 |
_raise(_L[172], "validate_utf8.sml:30:55") |
| 17485 |
end |
| 17486 |
elseif c == 224 then |
| 17487 |
tmp57 = _L[174] |
| 17488 |
goto cont |
| 17489 |
elseif c == 237 then |
| 17490 |
tmp57 = _L[175] |
| 17491 |
goto cont |
| 17492 |
elseif c < 240 then |
| 17493 |
tmp57 = _L[179] |
| 17494 |
goto cont |
| 17495 |
elseif c == 240 then |
| 17496 |
tmp57 = _L[176] |
| 17497 |
goto cont |
| 17498 |
elseif c < 244 then |
| 17499 |
tmp57 = _L[180] |
| 17500 |
goto cont |
| 17501 |
elseif c == 244 then |
| 17502 |
tmp57 = _L[177] |
| 17503 |
goto cont |
| 17504 |
else |
| 17505 |
_raise(_L[172], "validate_utf8.sml:44:11") |
| 17506 |
end |
| 17507 |
end |
| 17508 |
if state == "TAIL_1" then |
| 17509 |
if 128 <= c then |
| 17510 |
if c < 192 then |
| 17511 |
tmp57 = _L[173] |
| 17512 |
goto cont |
| 17513 |
else |
| 17514 |
_raise(_L[172], "validate_utf8.sml:47:14") |
| 17515 |
end |
| 17516 |
else |
| 17517 |
_raise(_L[172], "validate_utf8.sml:47:14") |
| 17518 |
end |
| 17519 |
end |
| 17520 |
if state == "MID_1_OF_3_E0" then |
| 17521 |
if 160 <= c then |
| 17522 |
if c < 192 then |
| 17523 |
tmp57 = _L[178] |
| 17524 |
goto cont |
| 17525 |
else |
| 17526 |
_raise(_L[172], "validate_utf8.sml:50:14") |
| 17527 |
end |
| 17528 |
else |
| 17529 |
_raise(_L[172], "validate_utf8.sml:50:14") |
| 17530 |
end |
| 17531 |
end |
| 17532 |
if state == "MID_1_OF_3_ED" then |
| 17533 |
if 128 <= c then |
| 17534 |
if c < 160 then |
| 17535 |
tmp57 = _L[178] |
| 17536 |
goto cont |
| 17537 |
else |
| 17538 |
_raise(_L[172], "validate_utf8.sml:53:14") |
| 17539 |
end |
| 17540 |
else |
| 17541 |
_raise(_L[172], "validate_utf8.sml:53:14") |
| 17542 |
end |
| 17543 |
end |
| 17544 |
if state == "TAIL_2" then |
| 17545 |
if 128 <= c then |
| 17546 |
if c < 192 then |
| 17547 |
tmp57 = _L[178] |
| 17548 |
goto cont |
| 17549 |
else |
| 17550 |
_raise(_L[172], "validate_utf8.sml:56:14") |
| 17551 |
end |
| 17552 |
else |
| 17553 |
_raise(_L[172], "validate_utf8.sml:56:14") |
| 17554 |
end |
| 17555 |
end |
| 17556 |
if state == "MID_1_OF_4_F0" then |
| 17557 |
if 144 <= c then |
| 17558 |
if c < 192 then |
| 17559 |
tmp57 = _L[179] |
| 17560 |
goto cont |
| 17561 |
else |
| 17562 |
_raise(_L[172], "validate_utf8.sml:59:14") |
| 17563 |
end |
| 17564 |
else |
| 17565 |
_raise(_L[172], "validate_utf8.sml:59:14") |
| 17566 |
end |
| 17567 |
end |
| 17568 |
if state == "TAIL_3" then |
| 17569 |
if 128 <= c then |
| 17570 |
if c < 192 then |
| 17571 |
tmp57 = _L[179] |
| 17572 |
goto cont |
| 17573 |
else |
| 17574 |
_raise(_L[172], "validate_utf8.sml:62:14") |
| 17575 |
end |
| 17576 |
else |
| 17577 |
_raise(_L[172], "validate_utf8.sml:62:14") |
| 17578 |
end |
| 17579 |
end |
| 17580 |
if state == "MID_1_OF_4_F4" then |
| 17581 |
if 128 <= c then |
| 17582 |
if c < 144 then |
| 17583 |
tmp57 = _L[179] |
| 17584 |
else |
| 17585 |
_raise(_L[172], "validate_utf8.sml:65:14") |
| 17586 |
end |
| 17587 |
else |
| 17588 |
_raise(_L[172], "validate_utf8.sml:65:14") |
| 17589 |
end |
| 17590 |
else |
| 17591 |
_raise(_Match, "validate_utf8.sml:26:7") |
| 17592 |
end |
| 17593 |
::cont:: |
| 17594 |
return {tag = "SOME", payload = {c, {strm1, tmp57}}} |
| 17595 |
else |
| 17596 |
_raise(_Match, "validate_utf8.sml:66:7") |
| 17597 |
end |
| 17598 |
end |
| 17599 |
expect = function(c, strm, state) |
| 17600 |
local exp = tmp55(strm, state) |
| 17601 |
if exp.tag == "NONE" then |
| 17602 |
else |
| 17603 |
goto else1 |
| 17604 |
end |
| 17605 |
do |
| 17606 |
local tmp56 = toString(c) |
| 17607 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = tmp56}}}, "parse_toml.sml:16:5") |
| 17608 |
end |
| 17609 |
::else1:: |
| 17610 |
if exp.tag == "SOME" then |
| 17611 |
else |
| 17612 |
_raise(_Match, "parse_toml.sml:28:9") |
| 17613 |
end |
| 17614 |
do |
| 17615 |
local c_PRIME = exp.payload[1] |
| 17616 |
local strm_PRIME = exp.payload[2] |
| 17617 |
if c == c_PRIME then |
| 17618 |
return strm_PRIME |
| 17619 |
end |
| 17620 |
local tmp56 = toString(c) |
| 17621 |
local tmp57 = toString(c_PRIME) |
| 17622 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp57, expected = tmp56}}}, "parse_toml.sml:19:5") |
| 17623 |
end |
| 17624 |
end |
| 17625 |
skipWhiteSpace = function(a) |
| 17626 |
local tmp56 = a |
| 17627 |
::cont:: |
| 17628 |
do |
| 17629 |
local a1 = tmp56 |
| 17630 |
local exp |
| 17631 |
do |
| 17632 |
local strm = a1[1] |
| 17633 |
exp = tmp55(strm, a1[2]) |
| 17634 |
end |
| 17635 |
if exp.tag == "NONE" then |
| 17636 |
return a1 |
| 17637 |
end |
| 17638 |
if exp.tag == "SOME" then |
| 17639 |
local c = exp.payload[1] |
| 17640 |
local strm_PRIME = exp.payload[2] |
| 17641 |
if c == 32 then |
| 17642 |
tmp56 = strm_PRIME |
| 17643 |
goto cont |
| 17644 |
elseif c == 9 then |
| 17645 |
tmp56 = strm_PRIME |
| 17646 |
goto cont |
| 17647 |
else |
| 17648 |
return a1 |
| 17649 |
end |
| 17650 |
else |
| 17651 |
_raise(_Match, "parse_toml.sml:34:9") |
| 17652 |
end |
| 17653 |
end |
| 17654 |
end |
| 17655 |
skipWhiteSpaceAndGetc = function(strm, state) |
| 17656 |
local tmp56, tmp57 = strm, state |
| 17657 |
::cont:: |
| 17658 |
do |
| 17659 |
local strm1, state1 = tmp56, tmp57 |
| 17660 |
local exp = tmp55(strm1, state1) |
| 17661 |
if exp.tag == "SOME" and exp.payload[1] == 32 then |
| 17662 |
local strm_PRIME = exp.payload[2] |
| 17663 |
local strm2 = strm_PRIME[1] |
| 17664 |
tmp56 = strm2 |
| 17665 |
tmp57 = strm_PRIME[2] |
| 17666 |
goto cont |
| 17667 |
elseif exp.tag == "SOME" and exp.payload[1] == 9 then |
| 17668 |
local strm_PRIME = exp.payload[2] |
| 17669 |
local strm2 = strm_PRIME[1] |
| 17670 |
tmp56 = strm2 |
| 17671 |
tmp57 = strm_PRIME[2] |
| 17672 |
goto cont |
| 17673 |
else |
| 17674 |
return exp |
| 17675 |
end |
| 17676 |
end |
| 17677 |
end |
| 17678 |
skipUntilNewline = function(a) |
| 17679 |
local tmp56 = a |
| 17680 |
::cont:: |
| 17681 |
do |
| 17682 |
local exp |
| 17683 |
do |
| 17684 |
local a1 = tmp56 |
| 17685 |
do |
| 17686 |
local strm = a1[1] |
| 17687 |
exp = tmp55(strm, a1[2]) |
| 17688 |
end |
| 17689 |
if exp.tag == "NONE" then |
| 17690 |
return a1 |
| 17691 |
end |
| 17692 |
if exp.tag == "SOME" and exp.payload[1] == 10 then |
| 17693 |
return exp.payload[2] |
| 17694 |
end |
| 17695 |
if exp.tag == "SOME" and exp.payload[1] == 13 then |
| 17696 |
else |
| 17697 |
goto else1 |
| 17698 |
end |
| 17699 |
do |
| 17700 |
local strm_PRIME = exp.payload[2] |
| 17701 |
local strm = strm_PRIME[1] |
| 17702 |
return expect(10, strm, strm_PRIME[2]) |
| 17703 |
end |
| 17704 |
end |
| 17705 |
::else1:: |
| 17706 |
if exp.tag == "SOME" then |
| 17707 |
else |
| 17708 |
_raise(_Match, "parse_toml.sml:47:9") |
| 17709 |
end |
| 17710 |
do |
| 17711 |
local c = exp.payload[1] |
| 17712 |
local strm_PRIME = exp.payload[2] |
| 17713 |
local tmp57 |
| 17714 |
do |
| 17715 |
if c <= 127 then |
| 17716 |
else |
| 17717 |
tmp57 = false |
| 17718 |
goto cont1 |
| 17719 |
end |
| 17720 |
do |
| 17721 |
local tmp58 = isPrint(c) |
| 17722 |
tmp57 = not tmp58 |
| 17723 |
end |
| 17724 |
end |
| 17725 |
::cont1:: |
| 17726 |
if tmp57 then |
| 17727 |
else |
| 17728 |
tmp56 = strm_PRIME |
| 17729 |
goto cont |
| 17730 |
end |
| 17731 |
do |
| 17732 |
local tmp58 = toString(c) |
| 17733 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp58, expected = "printable character"}}}, "parse_toml.sml:19:5") |
| 17734 |
end |
| 17735 |
end |
| 17736 |
end |
| 17737 |
end |
| 17738 |
skipWhiteSpaceOrComment = function(a) |
| 17739 |
local tmp56 = a |
| 17740 |
::cont:: |
| 17741 |
do |
| 17742 |
local exp |
| 17743 |
do |
| 17744 |
local a1 = tmp56 |
| 17745 |
do |
| 17746 |
local strm = a1[1] |
| 17747 |
exp = tmp55(strm, a1[2]) |
| 17748 |
end |
| 17749 |
if exp.tag == "NONE" then |
| 17750 |
return a1 |
| 17751 |
end |
| 17752 |
if exp.tag == "SOME" and exp.payload[1] == 35 then |
| 17753 |
else |
| 17754 |
goto else1 |
| 17755 |
end |
| 17756 |
do |
| 17757 |
return skipUntilNewline(exp.payload[2]) |
| 17758 |
end |
| 17759 |
end |
| 17760 |
::else1:: |
| 17761 |
if exp.tag == "SOME" and exp.payload[1] == 32 then |
| 17762 |
tmp56 = exp.payload[2] |
| 17763 |
goto cont |
| 17764 |
end |
| 17765 |
if exp.tag == "SOME" and exp.payload[1] == 9 then |
| 17766 |
tmp56 = exp.payload[2] |
| 17767 |
goto cont |
| 17768 |
end |
| 17769 |
if exp.tag == "SOME" and exp.payload[1] == 13 then |
| 17770 |
else |
| 17771 |
goto else2 |
| 17772 |
end |
| 17773 |
do |
| 17774 |
local strm_PRIME = exp.payload[2] |
| 17775 |
local strm = strm_PRIME[1] |
| 17776 |
return expect(10, strm, strm_PRIME[2]) |
| 17777 |
end |
| 17778 |
::else2:: |
| 17779 |
if exp.tag == "SOME" and exp.payload[1] == 10 then |
| 17780 |
return exp.payload[2] |
| 17781 |
end |
| 17782 |
if exp.tag == "SOME" then |
| 17783 |
else |
| 17784 |
_raise(_Match, "parse_toml.sml:56:9") |
| 17785 |
end |
| 17786 |
do |
| 17787 |
local tmp57 = toString(exp.payload[1]) |
| 17788 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp57, expected = "whitespace or comment"}}}, "parse_toml.sml:19:5") |
| 17789 |
end |
| 17790 |
end |
| 17791 |
end |
| 17792 |
skipWhiteSpaceOrCommentOrNewlineAndGetc = function(a) |
| 17793 |
local tmp56 = a |
| 17794 |
::cont:: |
| 17795 |
do |
| 17796 |
local a1 = tmp56 |
| 17797 |
local exp |
| 17798 |
do |
| 17799 |
local strm = a1[1] |
| 17800 |
exp = tmp55(strm, a1[2]) |
| 17801 |
end |
| 17802 |
if exp.tag == "SOME" and exp.payload[1] == 35 then |
| 17803 |
elseif exp.tag == "SOME" and exp.payload[1] == 32 then |
| 17804 |
tmp56 = exp.payload[2] |
| 17805 |
goto cont |
| 17806 |
elseif exp.tag == "SOME" and exp.payload[1] == 9 then |
| 17807 |
tmp56 = exp.payload[2] |
| 17808 |
goto cont |
| 17809 |
else |
| 17810 |
if exp.tag == "SOME" and exp.payload[1] == 13 then |
| 17811 |
elseif exp.tag == "SOME" and exp.payload[1] == 10 then |
| 17812 |
tmp56 = exp.payload[2] |
| 17813 |
goto cont |
| 17814 |
else |
| 17815 |
return exp |
| 17816 |
end |
| 17817 |
do |
| 17818 |
local strm_PRIME = exp.payload[2] |
| 17819 |
local strm = strm_PRIME[1] |
| 17820 |
tmp56 = expect(10, strm, strm_PRIME[2]) |
| 17821 |
goto cont |
| 17822 |
end |
| 17823 |
end |
| 17824 |
tmp56 = skipUntilNewline(exp.payload[2]) |
| 17825 |
goto cont |
| 17826 |
end |
| 17827 |
end |
| 17828 |
skipOptionalNewline = function(a) |
| 17829 |
local exp |
| 17830 |
do |
| 17831 |
local strm = a[1] |
| 17832 |
exp = tmp55(strm, a[2]) |
| 17833 |
end |
| 17834 |
if exp.tag == "SOME" and exp.payload[1] == 10 then |
| 17835 |
return exp.payload[2] |
| 17836 |
else |
| 17837 |
if exp.tag == "SOME" and exp.payload[1] == 13 then |
| 17838 |
else |
| 17839 |
return a |
| 17840 |
end |
| 17841 |
do |
| 17842 |
local strm_PRIME = exp.payload[2] |
| 17843 |
local strm = strm_PRIME[1] |
| 17844 |
return expect(10, strm, strm_PRIME[2]) |
| 17845 |
end |
| 17846 |
end |
| 17847 |
end |
| 17848 |
local skipWhiteSpaceOrNewline = function(a) |
| 17849 |
local tmp56 = a |
| 17850 |
::cont:: |
| 17851 |
do |
| 17852 |
local a1 = tmp56 |
| 17853 |
local exp |
| 17854 |
do |
| 17855 |
local strm = a1[1] |
| 17856 |
exp = tmp55(strm, a1[2]) |
| 17857 |
end |
| 17858 |
if exp.tag == "NONE" then |
| 17859 |
return a1 |
| 17860 |
end |
| 17861 |
if exp.tag == "SOME" and exp.payload[1] == 13 then |
| 17862 |
else |
| 17863 |
goto else1 |
| 17864 |
end |
| 17865 |
do |
| 17866 |
local strm_PRIME = exp.payload[2] |
| 17867 |
local strm = strm_PRIME[1] |
| 17868 |
tmp56 = expect(10, strm, strm_PRIME[2]) |
| 17869 |
goto cont |
| 17870 |
end |
| 17871 |
::else1:: |
| 17872 |
if exp.tag == "SOME" then |
| 17873 |
local c = exp.payload[1] |
| 17874 |
local strm_PRIME = exp.payload[2] |
| 17875 |
if c == 32 then |
| 17876 |
tmp56 = strm_PRIME |
| 17877 |
goto cont |
| 17878 |
elseif c == 9 then |
| 17879 |
tmp56 = strm_PRIME |
| 17880 |
goto cont |
| 17881 |
elseif c == 10 then |
| 17882 |
tmp56 = strm_PRIME |
| 17883 |
goto cont |
| 17884 |
else |
| 17885 |
return a1 |
| 17886 |
end |
| 17887 |
else |
| 17888 |
_raise(_Match, "parse_toml.sml:83:9") |
| 17889 |
end |
| 17890 |
end |
| 17891 |
end |
| 17892 |
local readHexDigit = function(strm, state) |
| 17893 |
local exp = tmp55(strm, state) |
| 17894 |
if exp.tag == "NONE" then |
| 17895 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "hexadecimal digit"}}}, "parse_toml.sml:16:5") |
| 17896 |
end |
| 17897 |
if exp.tag == "SOME" then |
| 17898 |
else |
| 17899 |
_raise(_Match, "parse_toml.sml:93:9") |
| 17900 |
end |
| 17901 |
do |
| 17902 |
local c = exp.payload[1] |
| 17903 |
local strm_PRIME = exp.payload[2] |
| 17904 |
if 48 <= c and c <= 57 then |
| 17905 |
return {_Int_sub(c, 48), strm_PRIME} |
| 17906 |
end |
| 17907 |
if 65 <= c and c <= 70 then |
| 17908 |
return {_Int_sub(c, 55), strm_PRIME} |
| 17909 |
end |
| 17910 |
if 97 <= c and c <= 102 then |
| 17911 |
return {_Int_sub(c, 87), strm_PRIME} |
| 17912 |
end |
| 17913 |
local tmp56 = toString(c) |
| 17914 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "hexadecimal digit"}}}, "parse_toml.sml:19:5") |
| 17915 |
end |
| 17916 |
end |
| 17917 |
local readFourHexDigit = function(strm, state) |
| 17918 |
local exp = readHexDigit(strm, state) |
| 17919 |
local c3 = exp[1] |
| 17920 |
local strm1 = exp[2] |
| 17921 |
local exp1 |
| 17922 |
do |
| 17923 |
local strm2 = strm1[1] |
| 17924 |
exp1 = readHexDigit(strm2, strm1[2]) |
| 17925 |
end |
| 17926 |
local c2 = exp1[1] |
| 17927 |
local strm2 = exp1[2] |
| 17928 |
local exp2 |
| 17929 |
do |
| 17930 |
local strm3 = strm2[1] |
| 17931 |
exp2 = readHexDigit(strm3, strm2[2]) |
| 17932 |
end |
| 17933 |
local c1 = exp2[1] |
| 17934 |
local strm3 = exp2[2] |
| 17935 |
local exp3 |
| 17936 |
do |
| 17937 |
local strm4 = strm3[1] |
| 17938 |
exp3 = readHexDigit(strm4, strm3[2]) |
| 17939 |
end |
| 17940 |
local c0 = exp3[1] |
| 17941 |
local strm4 = exp3[2] |
| 17942 |
return {_Int_add(_Int_mul(_Int_add(_Int_mul(_Int_add(_Int_mul(c3, 16), c2), 16), c1), 16), c0), strm4} |
| 17943 |
end |
| 17944 |
go = function(accum, strm, state) |
| 17945 |
local tmp56, tmp57, tmp58 = accum, strm, state |
| 17946 |
::cont:: |
| 17947 |
do |
| 17948 |
local accum1, exp |
| 17949 |
do |
| 17950 |
local strm1, state1 |
| 17951 |
accum1, strm1, state1 = tmp56, tmp57, tmp58 |
| 17952 |
exp = tmp55(strm1, state1) |
| 17953 |
if exp.tag == "NONE" then |
| 17954 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing quote"}}}, "parse_toml.sml:16:5") |
| 17955 |
end |
| 17956 |
if exp.tag == "SOME" and exp.payload[1] == 34 then |
| 17957 |
else |
| 17958 |
goto else1 |
| 17959 |
end |
| 17960 |
do |
| 17961 |
local strm_PRIME = exp.payload[2] |
| 17962 |
local tmp59 = implodeRev(accum1) |
| 17963 |
return {tmp59, strm_PRIME} |
| 17964 |
end |
| 17965 |
end |
| 17966 |
::else1:: |
| 17967 |
if exp.tag == "SOME" and exp.payload[1] == 92 then |
| 17968 |
else |
| 17969 |
goto else2 |
| 17970 |
end |
| 17971 |
do |
| 17972 |
local exp1 |
| 17973 |
do |
| 17974 |
local strm_PRIME = exp.payload[2] |
| 17975 |
do |
| 17976 |
local strm1 = strm_PRIME[1] |
| 17977 |
exp1 = tmp55(strm1, strm_PRIME[2]) |
| 17978 |
end |
| 17979 |
if exp1.tag == "NONE" then |
| 17980 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "escape sequence"}}}, "parse_toml.sml:16:5") |
| 17981 |
end |
| 17982 |
if exp1.tag == "SOME" and exp1.payload[1] == 34 then |
| 17983 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 17984 |
local tmp59 = {34, accum1} |
| 17985 |
local strm1 = strm_PRIME_PRIME[1] |
| 17986 |
tmp56 = tmp59 |
| 17987 |
tmp57 = strm1 |
| 17988 |
tmp58 = strm_PRIME_PRIME[2] |
| 17989 |
goto cont |
| 17990 |
end |
| 17991 |
if exp1.tag == "SOME" and exp1.payload[1] == 92 then |
| 17992 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 17993 |
local tmp59 = {92, accum1} |
| 17994 |
local strm1 = strm_PRIME_PRIME[1] |
| 17995 |
tmp56 = tmp59 |
| 17996 |
tmp57 = strm1 |
| 17997 |
tmp58 = strm_PRIME_PRIME[2] |
| 17998 |
goto cont |
| 17999 |
end |
| 18000 |
if exp1.tag == "SOME" and exp1.payload[1] == 98 then |
| 18001 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18002 |
local tmp59 = {8, accum1} |
| 18003 |
local strm1 = strm_PRIME_PRIME[1] |
| 18004 |
tmp56 = tmp59 |
| 18005 |
tmp57 = strm1 |
| 18006 |
tmp58 = strm_PRIME_PRIME[2] |
| 18007 |
goto cont |
| 18008 |
end |
| 18009 |
if exp1.tag == "SOME" and exp1.payload[1] == 102 then |
| 18010 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18011 |
local tmp59 = {12, accum1} |
| 18012 |
local strm1 = strm_PRIME_PRIME[1] |
| 18013 |
tmp56 = tmp59 |
| 18014 |
tmp57 = strm1 |
| 18015 |
tmp58 = strm_PRIME_PRIME[2] |
| 18016 |
goto cont |
| 18017 |
end |
| 18018 |
if exp1.tag == "SOME" and exp1.payload[1] == 110 then |
| 18019 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18020 |
local tmp59 = {10, accum1} |
| 18021 |
local strm1 = strm_PRIME_PRIME[1] |
| 18022 |
tmp56 = tmp59 |
| 18023 |
tmp57 = strm1 |
| 18024 |
tmp58 = strm_PRIME_PRIME[2] |
| 18025 |
goto cont |
| 18026 |
end |
| 18027 |
if exp1.tag == "SOME" and exp1.payload[1] == 114 then |
| 18028 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18029 |
local tmp59 = {13, accum1} |
| 18030 |
local strm1 = strm_PRIME_PRIME[1] |
| 18031 |
tmp56 = tmp59 |
| 18032 |
tmp57 = strm1 |
| 18033 |
tmp58 = strm_PRIME_PRIME[2] |
| 18034 |
goto cont |
| 18035 |
end |
| 18036 |
if exp1.tag == "SOME" and exp1.payload[1] == 116 then |
| 18037 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18038 |
local tmp59 = {9, accum1} |
| 18039 |
local strm1 = strm_PRIME_PRIME[1] |
| 18040 |
tmp56 = tmp59 |
| 18041 |
tmp57 = strm1 |
| 18042 |
tmp58 = strm_PRIME_PRIME[2] |
| 18043 |
goto cont |
| 18044 |
end |
| 18045 |
if exp1.tag == "SOME" and exp1.payload[1] == 117 then |
| 18046 |
else |
| 18047 |
goto else3 |
| 18048 |
end |
| 18049 |
do |
| 18050 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18051 |
local exp2 |
| 18052 |
do |
| 18053 |
local strm1 = strm_PRIME_PRIME[1] |
| 18054 |
exp2 = readFourHexDigit(strm1, strm_PRIME_PRIME[2]) |
| 18055 |
end |
| 18056 |
local i = exp2[1] |
| 18057 |
local strm_PRIME_PRIME_PRIME = exp2[2] |
| 18058 |
local tmp59 = _L[187](i, accum1) |
| 18059 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 18060 |
tmp56 = tmp59 |
| 18061 |
tmp57 = strm1 |
| 18062 |
tmp58 = strm_PRIME_PRIME_PRIME[2] |
| 18063 |
goto cont |
| 18064 |
end |
| 18065 |
end |
| 18066 |
::else3:: |
| 18067 |
if exp1.tag == "SOME" and exp1.payload[1] == 85 then |
| 18068 |
else |
| 18069 |
goto else4 |
| 18070 |
end |
| 18071 |
do |
| 18072 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18073 |
local exp2 |
| 18074 |
do |
| 18075 |
local strm1 = strm_PRIME_PRIME[1] |
| 18076 |
exp2 = readFourHexDigit(strm1, strm_PRIME_PRIME[2]) |
| 18077 |
end |
| 18078 |
local hi = exp2[1] |
| 18079 |
local strm_PRIME_PRIME_PRIME = exp2[2] |
| 18080 |
local exp3 |
| 18081 |
do |
| 18082 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 18083 |
exp3 = readFourHexDigit(strm1, strm_PRIME_PRIME_PRIME[2]) |
| 18084 |
end |
| 18085 |
local lo = exp3[1] |
| 18086 |
local strm_PRIME_PRIME_PRIME_PRIME = exp3[2] |
| 18087 |
if hi > 16 then |
| 18088 |
_raise({tag = _L[186], payload = _L[182]}, "parse_toml.sml:139:24") |
| 18089 |
end |
| 18090 |
local tmp59 = _L[187](_Int_add(_Int_mul(hi, 65536), lo), accum1) |
| 18091 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 18092 |
tmp56 = tmp59 |
| 18093 |
tmp57 = strm1 |
| 18094 |
tmp58 = strm_PRIME_PRIME_PRIME_PRIME[2] |
| 18095 |
goto cont |
| 18096 |
end |
| 18097 |
::else4:: |
| 18098 |
if exp1.tag == "SOME" then |
| 18099 |
else |
| 18100 |
_raise(_Match, "parse_toml.sml:120:16") |
| 18101 |
end |
| 18102 |
do |
| 18103 |
local tmp59 = toString(exp1.payload[1]) |
| 18104 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp59, expected = "escape sequence"}}}, "parse_toml.sml:19:5") |
| 18105 |
end |
| 18106 |
end |
| 18107 |
::else2:: |
| 18108 |
if exp.tag == "SOME" then |
| 18109 |
else |
| 18110 |
_raise(_Match, "parse_toml.sml:116:11") |
| 18111 |
end |
| 18112 |
do |
| 18113 |
local c = exp.payload[1] |
| 18114 |
local strm_PRIME = exp.payload[2] |
| 18115 |
local tmp59 = c < 32 and c ~= 9 |
| 18116 |
local tmp60 |
| 18117 |
tmp60 = tmp59 or c == 127 |
| 18118 |
if tmp60 then |
| 18119 |
else |
| 18120 |
local tmp61 = {c, accum1} |
| 18121 |
local strm1 = strm_PRIME[1] |
| 18122 |
tmp56 = tmp61 |
| 18123 |
tmp57 = strm1 |
| 18124 |
tmp58 = strm_PRIME[2] |
| 18125 |
goto cont |
| 18126 |
end |
| 18127 |
do |
| 18128 |
local tmp61 = toString(c) |
| 18129 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp61, expected = "printable character"}}}, "parse_toml.sml:19:5") |
| 18130 |
end |
| 18131 |
end |
| 18132 |
end |
| 18133 |
end |
| 18134 |
checkAllowedChar = function(a) |
| 18135 |
local tmp56 = a < 32 and (a ~= 9 and a ~= 10) |
| 18136 |
local tmp57 |
| 18137 |
tmp57 = tmp56 or a == 127 |
| 18138 |
if tmp57 then |
| 18139 |
else |
| 18140 |
return a |
| 18141 |
end |
| 18142 |
do |
| 18143 |
local tmp58 = toString(a) |
| 18144 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp58, expected = "printable character"}}}, "parse_toml.sml:19:5") |
| 18145 |
end |
| 18146 |
end |
| 18147 |
local function escape(accum, strm, state) |
| 18148 |
local exp = tmp55(strm, state) |
| 18149 |
if exp.tag == "NONE" then |
| 18150 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "escape sequence"}}}, "parse_toml.sml:16:5") |
| 18151 |
end |
| 18152 |
if exp.tag == "SOME" and exp.payload[1] == 34 then |
| 18153 |
else |
| 18154 |
goto else1 |
| 18155 |
end |
| 18156 |
do |
| 18157 |
local strm_PRIME = exp.payload[2] |
| 18158 |
local tmp56 = {34, accum} |
| 18159 |
local strm1 = strm_PRIME[1] |
| 18160 |
return go1(tmp56, strm1, strm_PRIME[2]) |
| 18161 |
end |
| 18162 |
::else1:: |
| 18163 |
if exp.tag == "SOME" and exp.payload[1] == 92 then |
| 18164 |
else |
| 18165 |
goto else2 |
| 18166 |
end |
| 18167 |
do |
| 18168 |
local strm_PRIME = exp.payload[2] |
| 18169 |
local tmp56 = {92, accum} |
| 18170 |
local strm1 = strm_PRIME[1] |
| 18171 |
return go1(tmp56, strm1, strm_PRIME[2]) |
| 18172 |
end |
| 18173 |
::else2:: |
| 18174 |
if exp.tag == "SOME" and exp.payload[1] == 98 then |
| 18175 |
else |
| 18176 |
goto else3 |
| 18177 |
end |
| 18178 |
do |
| 18179 |
local strm_PRIME = exp.payload[2] |
| 18180 |
local tmp56 = {8, accum} |
| 18181 |
local strm1 = strm_PRIME[1] |
| 18182 |
return go1(tmp56, strm1, strm_PRIME[2]) |
| 18183 |
end |
| 18184 |
::else3:: |
| 18185 |
if exp.tag == "SOME" and exp.payload[1] == 102 then |
| 18186 |
else |
| 18187 |
goto else4 |
| 18188 |
end |
| 18189 |
do |
| 18190 |
local strm_PRIME = exp.payload[2] |
| 18191 |
local tmp56 = {12, accum} |
| 18192 |
local strm1 = strm_PRIME[1] |
| 18193 |
return go1(tmp56, strm1, strm_PRIME[2]) |
| 18194 |
end |
| 18195 |
::else4:: |
| 18196 |
if exp.tag == "SOME" and exp.payload[1] == 110 then |
| 18197 |
else |
| 18198 |
goto else5 |
| 18199 |
end |
| 18200 |
do |
| 18201 |
local strm_PRIME = exp.payload[2] |
| 18202 |
local tmp56 = {10, accum} |
| 18203 |
local strm1 = strm_PRIME[1] |
| 18204 |
return go1(tmp56, strm1, strm_PRIME[2]) |
| 18205 |
end |
| 18206 |
::else5:: |
| 18207 |
if exp.tag == "SOME" and exp.payload[1] == 114 then |
| 18208 |
else |
| 18209 |
goto else6 |
| 18210 |
end |
| 18211 |
do |
| 18212 |
local strm_PRIME = exp.payload[2] |
| 18213 |
local tmp56 = {13, accum} |
| 18214 |
local strm1 = strm_PRIME[1] |
| 18215 |
return go1(tmp56, strm1, strm_PRIME[2]) |
| 18216 |
end |
| 18217 |
::else6:: |
| 18218 |
if exp.tag == "SOME" and exp.payload[1] == 116 then |
| 18219 |
else |
| 18220 |
goto else7 |
| 18221 |
end |
| 18222 |
do |
| 18223 |
local strm_PRIME = exp.payload[2] |
| 18224 |
local tmp56 = {9, accum} |
| 18225 |
local strm1 = strm_PRIME[1] |
| 18226 |
return go1(tmp56, strm1, strm_PRIME[2]) |
| 18227 |
end |
| 18228 |
::else7:: |
| 18229 |
if exp.tag == "SOME" and exp.payload[1] == 117 then |
| 18230 |
else |
| 18231 |
goto else8 |
| 18232 |
end |
| 18233 |
do |
| 18234 |
local strm_PRIME = exp.payload[2] |
| 18235 |
local exp1 |
| 18236 |
do |
| 18237 |
local strm1 = strm_PRIME[1] |
| 18238 |
exp1 = readFourHexDigit(strm1, strm_PRIME[2]) |
| 18239 |
end |
| 18240 |
local i = exp1[1] |
| 18241 |
local strm_PRIME_PRIME = exp1[2] |
| 18242 |
local tmp56 = _L[187](i, accum) |
| 18243 |
local strm1 = strm_PRIME_PRIME[1] |
| 18244 |
return go1(tmp56, strm1, strm_PRIME_PRIME[2]) |
| 18245 |
end |
| 18246 |
::else8:: |
| 18247 |
if exp.tag == "SOME" and exp.payload[1] == 85 then |
| 18248 |
else |
| 18249 |
goto else9 |
| 18250 |
end |
| 18251 |
do |
| 18252 |
local strm_PRIME = exp.payload[2] |
| 18253 |
local exp1 |
| 18254 |
do |
| 18255 |
local strm1 = strm_PRIME[1] |
| 18256 |
exp1 = readFourHexDigit(strm1, strm_PRIME[2]) |
| 18257 |
end |
| 18258 |
local hi = exp1[1] |
| 18259 |
local strm_PRIME_PRIME = exp1[2] |
| 18260 |
local exp2 |
| 18261 |
do |
| 18262 |
local strm1 = strm_PRIME_PRIME[1] |
| 18263 |
exp2 = readFourHexDigit(strm1, strm_PRIME_PRIME[2]) |
| 18264 |
end |
| 18265 |
local lo = exp2[1] |
| 18266 |
local strm_PRIME_PRIME_PRIME = exp2[2] |
| 18267 |
local tmp56 = _L[187](_Int_add(_Int_mul(hi, 65536), lo), accum) |
| 18268 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 18269 |
return go1(tmp56, strm1, strm_PRIME_PRIME_PRIME[2]) |
| 18270 |
end |
| 18271 |
::else9:: |
| 18272 |
if exp.tag == "SOME" then |
| 18273 |
else |
| 18274 |
_raise(_Match, "parse_toml.sml:204:11") |
| 18275 |
end |
| 18276 |
do |
| 18277 |
local c = exp.payload[1] |
| 18278 |
local strm_PRIME = exp.payload[2] |
| 18279 |
if c == 32 or c == 9 then |
| 18280 |
else |
| 18281 |
goto else10 |
| 18282 |
end |
| 18283 |
do |
| 18284 |
local exp1 |
| 18285 |
do |
| 18286 |
local strm1 = strm_PRIME[1] |
| 18287 |
exp1 = skipWhiteSpaceAndGetc(strm1, strm_PRIME[2]) |
| 18288 |
end |
| 18289 |
if exp1.tag == "NONE" then |
| 18290 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "newline"}}}, "parse_toml.sml:16:5") |
| 18291 |
end |
| 18292 |
if exp1.tag == "SOME" and exp1.payload[1] == 10 then |
| 18293 |
else |
| 18294 |
goto else13 |
| 18295 |
end |
| 18296 |
do |
| 18297 |
local tmp56 = skipWhiteSpaceOrNewline(exp1.payload[2]) |
| 18298 |
local strm1 = tmp56[1] |
| 18299 |
return go1(accum, strm1, tmp56[2]) |
| 18300 |
end |
| 18301 |
::else13:: |
| 18302 |
if exp1.tag == "SOME" and exp1.payload[1] == 13 then |
| 18303 |
else |
| 18304 |
goto else14 |
| 18305 |
end |
| 18306 |
do |
| 18307 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18308 |
local tmp56 |
| 18309 |
do |
| 18310 |
local strm1 = strm_PRIME_PRIME[1] |
| 18311 |
tmp56 = expect(10, strm1, strm_PRIME_PRIME[2]) |
| 18312 |
end |
| 18313 |
local tmp57 = skipWhiteSpaceOrNewline(tmp56) |
| 18314 |
local strm1 = tmp57[1] |
| 18315 |
return go1(accum, strm1, tmp57[2]) |
| 18316 |
end |
| 18317 |
::else14:: |
| 18318 |
if exp1.tag == "SOME" then |
| 18319 |
else |
| 18320 |
_raise(_Match, "parse_toml.sml:229:17") |
| 18321 |
end |
| 18322 |
do |
| 18323 |
local tmp56 = toString(exp1.payload[1]) |
| 18324 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "newline"}}}, "parse_toml.sml:19:5") |
| 18325 |
end |
| 18326 |
end |
| 18327 |
::else10:: |
| 18328 |
if c == 13 then |
| 18329 |
else |
| 18330 |
goto else11 |
| 18331 |
end |
| 18332 |
do |
| 18333 |
local tmp56 |
| 18334 |
do |
| 18335 |
local strm1 = strm_PRIME[1] |
| 18336 |
tmp56 = expect(10, strm1, strm_PRIME[2]) |
| 18337 |
end |
| 18338 |
local tmp57 = skipWhiteSpaceOrNewline(tmp56) |
| 18339 |
local strm1 = tmp57[1] |
| 18340 |
return go1(accum, strm1, tmp57[2]) |
| 18341 |
end |
| 18342 |
::else11:: |
| 18343 |
if c == 10 then |
| 18344 |
else |
| 18345 |
goto else12 |
| 18346 |
end |
| 18347 |
do |
| 18348 |
local tmp56 = skipWhiteSpaceOrNewline(strm_PRIME) |
| 18349 |
local strm1 = tmp56[1] |
| 18350 |
return go1(accum, strm1, tmp56[2]) |
| 18351 |
end |
| 18352 |
::else12:: |
| 18353 |
local tmp56 = toString(c) |
| 18354 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "escape sequence"}}}, "parse_toml.sml:19:5") |
| 18355 |
end |
| 18356 |
end |
| 18357 |
go1 = function(accum, strm, state) |
| 18358 |
local tmp56, tmp57, tmp58 = accum, strm, state |
| 18359 |
::cont:: |
| 18360 |
do |
| 18361 |
local accum1, exp |
| 18362 |
do |
| 18363 |
local strm1, state1 |
| 18364 |
accum1, strm1, state1 = tmp56, tmp57, tmp58 |
| 18365 |
exp = tmp55(strm1, state1) |
| 18366 |
if exp.tag == "NONE" then |
| 18367 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing triple quote"}}}, "parse_toml.sml:16:5") |
| 18368 |
end |
| 18369 |
if exp.tag == "SOME" and exp.payload[1] == 92 then |
| 18370 |
else |
| 18371 |
goto else1 |
| 18372 |
end |
| 18373 |
do |
| 18374 |
local strm_PRIME = exp.payload[2] |
| 18375 |
local strm2 = strm_PRIME[1] |
| 18376 |
return escape(accum1, strm2, strm_PRIME[2]) |
| 18377 |
end |
| 18378 |
end |
| 18379 |
::else1:: |
| 18380 |
if exp.tag == "SOME" and exp.payload[1] == 34 then |
| 18381 |
else |
| 18382 |
goto else2 |
| 18383 |
end |
| 18384 |
do |
| 18385 |
local exp1 |
| 18386 |
do |
| 18387 |
local strm_PRIME = exp.payload[2] |
| 18388 |
do |
| 18389 |
local strm1 = strm_PRIME[1] |
| 18390 |
exp1 = tmp55(strm1, strm_PRIME[2]) |
| 18391 |
end |
| 18392 |
if exp1.tag == "SOME" and exp1.payload[1] == 34 then |
| 18393 |
else |
| 18394 |
goto else4 |
| 18395 |
end |
| 18396 |
do |
| 18397 |
local exp2 |
| 18398 |
do |
| 18399 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18400 |
do |
| 18401 |
local strm1 = strm_PRIME_PRIME[1] |
| 18402 |
exp2 = tmp55(strm1, strm_PRIME_PRIME[2]) |
| 18403 |
end |
| 18404 |
if exp2.tag == "SOME" and exp2.payload[1] == 34 then |
| 18405 |
else |
| 18406 |
goto else7 |
| 18407 |
end |
| 18408 |
do |
| 18409 |
local strm_PRIME_PRIME_PRIME |
| 18410 |
do |
| 18411 |
strm_PRIME_PRIME_PRIME = exp2.payload[2] |
| 18412 |
local exp3 |
| 18413 |
do |
| 18414 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 18415 |
exp3 = tmp55(strm1, strm_PRIME_PRIME_PRIME[2]) |
| 18416 |
end |
| 18417 |
if exp3.tag == "SOME" and exp3.payload[1] == 34 then |
| 18418 |
else |
| 18419 |
goto else10 |
| 18420 |
end |
| 18421 |
do |
| 18422 |
local strm_PRIME_PRIME_PRIME_PRIME |
| 18423 |
do |
| 18424 |
strm_PRIME_PRIME_PRIME_PRIME = exp3.payload[2] |
| 18425 |
local exp4 |
| 18426 |
do |
| 18427 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 18428 |
exp4 = tmp55(strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 18429 |
end |
| 18430 |
if exp4.tag == "SOME" and exp4.payload[1] == 34 then |
| 18431 |
else |
| 18432 |
goto else11 |
| 18433 |
end |
| 18434 |
do |
| 18435 |
local strm_PRIME_PRIME_PRIME_PRIME_PRIME = exp4.payload[2] |
| 18436 |
local tmp59 = implodeRev({34, {34, accum1}}) |
| 18437 |
return {tmp59, strm_PRIME_PRIME_PRIME_PRIME_PRIME} |
| 18438 |
end |
| 18439 |
end |
| 18440 |
::else11:: |
| 18441 |
local tmp59 = implodeRev({34, accum1}) |
| 18442 |
return {tmp59, strm_PRIME_PRIME_PRIME_PRIME} |
| 18443 |
end |
| 18444 |
end |
| 18445 |
::else10:: |
| 18446 |
local tmp59 = implodeRev(accum1) |
| 18447 |
return {tmp59, strm_PRIME_PRIME_PRIME} |
| 18448 |
end |
| 18449 |
end |
| 18450 |
::else7:: |
| 18451 |
if exp2.tag == "SOME" and exp2.payload[1] == 92 then |
| 18452 |
else |
| 18453 |
goto else8 |
| 18454 |
end |
| 18455 |
do |
| 18456 |
local strm_PRIME_PRIME_PRIME = exp2.payload[2] |
| 18457 |
local tmp59 = {34, {34, accum1}} |
| 18458 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 18459 |
return escape(tmp59, strm1, strm_PRIME_PRIME_PRIME[2]) |
| 18460 |
end |
| 18461 |
::else8:: |
| 18462 |
if exp2.tag == "SOME" and exp2.payload[1] == 13 then |
| 18463 |
else |
| 18464 |
goto else9 |
| 18465 |
end |
| 18466 |
do |
| 18467 |
local strm_PRIME_PRIME_PRIME = exp2.payload[2] |
| 18468 |
local tmp59 = {10, {13, {34, {34, accum1}}}} |
| 18469 |
local tmp60 |
| 18470 |
do |
| 18471 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 18472 |
tmp60 = expect(10, strm1, strm_PRIME_PRIME_PRIME[2]) |
| 18473 |
end |
| 18474 |
local strm1 = tmp60[1] |
| 18475 |
tmp56 = tmp59 |
| 18476 |
tmp57 = strm1 |
| 18477 |
tmp58 = tmp60[2] |
| 18478 |
goto cont |
| 18479 |
end |
| 18480 |
::else9:: |
| 18481 |
if exp2.tag == "SOME" then |
| 18482 |
elseif exp2.tag == "NONE" then |
| 18483 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing triple quote"}}}, "parse_toml.sml:16:5") |
| 18484 |
else |
| 18485 |
_raise(_Match, "parse_toml.sml:170:21") |
| 18486 |
end |
| 18487 |
do |
| 18488 |
local c = exp2.payload[1] |
| 18489 |
local strm_PRIME_PRIME_PRIME = exp2.payload[2] |
| 18490 |
local tmp59 = checkAllowedChar(c) |
| 18491 |
local tmp60 = {tmp59, {34, {34, accum1}}} |
| 18492 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 18493 |
tmp56 = tmp60 |
| 18494 |
tmp57 = strm1 |
| 18495 |
tmp58 = strm_PRIME_PRIME_PRIME[2] |
| 18496 |
goto cont |
| 18497 |
end |
| 18498 |
end |
| 18499 |
end |
| 18500 |
::else4:: |
| 18501 |
if exp1.tag == "SOME" and exp1.payload[1] == 92 then |
| 18502 |
else |
| 18503 |
goto else5 |
| 18504 |
end |
| 18505 |
do |
| 18506 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18507 |
local tmp59 = {34, accum1} |
| 18508 |
local strm1 = strm_PRIME_PRIME[1] |
| 18509 |
return escape(tmp59, strm1, strm_PRIME_PRIME[2]) |
| 18510 |
end |
| 18511 |
::else5:: |
| 18512 |
if exp1.tag == "SOME" and exp1.payload[1] == 13 then |
| 18513 |
else |
| 18514 |
goto else6 |
| 18515 |
end |
| 18516 |
do |
| 18517 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 18518 |
local tmp59 = {10, {13, {34, accum1}}} |
| 18519 |
local tmp60 |
| 18520 |
do |
| 18521 |
local strm1 = strm_PRIME_PRIME[1] |
| 18522 |
tmp60 = expect(10, strm1, strm_PRIME_PRIME[2]) |
| 18523 |
end |
| 18524 |
local strm1 = tmp60[1] |
| 18525 |
tmp56 = tmp59 |
| 18526 |
tmp57 = strm1 |
| 18527 |
tmp58 = tmp60[2] |
| 18528 |
goto cont |
| 18529 |
end |
| 18530 |
::else6:: |
| 18531 |
if exp1.tag == "SOME" then |
| 18532 |
elseif exp1.tag == "NONE" then |
| 18533 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing triple quote"}}}, "parse_toml.sml:16:5") |
| 18534 |
else |
| 18535 |
_raise(_Match, "parse_toml.sml:168:16") |
| 18536 |
end |
| 18537 |
do |
| 18538 |
local c = exp1.payload[1] |
| 18539 |
local strm_PRIME_PRIME_PRIME = exp1.payload[2] |
| 18540 |
local tmp59 = checkAllowedChar(c) |
| 18541 |
local tmp60 = {tmp59, {34, accum1}} |
| 18542 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 18543 |
tmp56 = tmp60 |
| 18544 |
tmp57 = strm1 |
| 18545 |
tmp58 = strm_PRIME_PRIME_PRIME[2] |
| 18546 |
goto cont |
| 18547 |
end |
| 18548 |
end |
| 18549 |
::else2:: |
| 18550 |
if exp.tag == "SOME" and exp.payload[1] == 13 then |
| 18551 |
else |
| 18552 |
goto else3 |
| 18553 |
end |
| 18554 |
do |
| 18555 |
local strm_PRIME = exp.payload[2] |
| 18556 |
local tmp59 = {10, {13, accum1}} |
| 18557 |
local tmp60 |
| 18558 |
do |
| 18559 |
local strm1 = strm_PRIME[1] |
| 18560 |
tmp60 = expect(10, strm1, strm_PRIME[2]) |
| 18561 |
end |
| 18562 |
local strm1 = tmp60[1] |
| 18563 |
tmp56 = tmp59 |
| 18564 |
tmp57 = strm1 |
| 18565 |
tmp58 = tmp60[2] |
| 18566 |
goto cont |
| 18567 |
end |
| 18568 |
::else3:: |
| 18569 |
if exp.tag == "SOME" then |
| 18570 |
else |
| 18571 |
_raise(_Match, "parse_toml.sml:164:11") |
| 18572 |
end |
| 18573 |
do |
| 18574 |
local c = exp.payload[1] |
| 18575 |
local strm_PRIME = exp.payload[2] |
| 18576 |
local tmp59 = checkAllowedChar(c) |
| 18577 |
local tmp60 = {tmp59, accum1} |
| 18578 |
local strm1 = strm_PRIME[1] |
| 18579 |
tmp56 = tmp60 |
| 18580 |
tmp57 = strm1 |
| 18581 |
tmp58 = strm_PRIME[2] |
| 18582 |
goto cont |
| 18583 |
end |
| 18584 |
end |
| 18585 |
end |
| 18586 |
go2 = function(accum, strm, state) |
| 18587 |
local tmp56, tmp57, tmp58 = accum, strm, state |
| 18588 |
::cont:: |
| 18589 |
do |
| 18590 |
local accum1, exp |
| 18591 |
do |
| 18592 |
local strm1, state1 |
| 18593 |
accum1, strm1, state1 = tmp56, tmp57, tmp58 |
| 18594 |
exp = tmp55(strm1, state1) |
| 18595 |
if exp.tag == "NONE" then |
| 18596 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing quote"}}}, "parse_toml.sml:16:5") |
| 18597 |
end |
| 18598 |
if exp.tag == "SOME" and exp.payload[1] == 39 then |
| 18599 |
else |
| 18600 |
goto else1 |
| 18601 |
end |
| 18602 |
do |
| 18603 |
local strm_PRIME = exp.payload[2] |
| 18604 |
local tmp59 = implodeRev(accum1) |
| 18605 |
return {tmp59, strm_PRIME} |
| 18606 |
end |
| 18607 |
end |
| 18608 |
::else1:: |
| 18609 |
if exp.tag == "SOME" then |
| 18610 |
else |
| 18611 |
_raise(_Match, "parse_toml.sml:248:11") |
| 18612 |
end |
| 18613 |
do |
| 18614 |
local c = exp.payload[1] |
| 18615 |
local strm_PRIME = exp.payload[2] |
| 18616 |
local tmp59 = c < 32 and c ~= 9 |
| 18617 |
local tmp60 |
| 18618 |
tmp60 = tmp59 or c == 127 |
| 18619 |
if tmp60 then |
| 18620 |
else |
| 18621 |
local tmp61 = {c, accum1} |
| 18622 |
local strm1 = strm_PRIME[1] |
| 18623 |
tmp56 = tmp61 |
| 18624 |
tmp57 = strm1 |
| 18625 |
tmp58 = strm_PRIME[2] |
| 18626 |
goto cont |
| 18627 |
end |
| 18628 |
do |
| 18629 |
local tmp61 = toString(c) |
| 18630 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp61, expected = "printable character"}}}, "parse_toml.sml:19:5") |
| 18631 |
end |
| 18632 |
end |
| 18633 |
end |
| 18634 |
end |
| 18635 |
local function readHexIntUnderscore(accum, strm) |
| 18636 |
local tmp56, tmp57 = accum, strm |
| 18637 |
::cont:: |
| 18638 |
do |
| 18639 |
local accum1, strm1 = tmp56, tmp57 |
| 18640 |
local exp |
| 18641 |
do |
| 18642 |
local strm2 = strm1[1] |
| 18643 |
exp = tmp55(strm2, strm1[2]) |
| 18644 |
end |
| 18645 |
if exp.tag == "NONE" then |
| 18646 |
return {accum1, strm1} |
| 18647 |
end |
| 18648 |
if exp.tag == "SOME" and exp.payload[1] == 95 then |
| 18649 |
else |
| 18650 |
goto else1 |
| 18651 |
end |
| 18652 |
do |
| 18653 |
local strm_PRIME = exp.payload[2] |
| 18654 |
local strm2 = strm_PRIME[1] |
| 18655 |
return readHexInt(accum1, strm2, strm_PRIME[2]) |
| 18656 |
end |
| 18657 |
::else1:: |
| 18658 |
if exp.tag == "SOME" then |
| 18659 |
else |
| 18660 |
_raise(_Match, "parse_toml.sml:324:9") |
| 18661 |
end |
| 18662 |
do |
| 18663 |
local c = exp.payload[1] |
| 18664 |
local strm_PRIME = exp.payload[2] |
| 18665 |
if 48 <= c and c <= 57 then |
| 18666 |
else |
| 18667 |
goto else2 |
| 18668 |
end |
| 18669 |
do |
| 18670 |
local tmp58 = _L[22](16) |
| 18671 |
local tmp59 = mul(accum1, tmp58) |
| 18672 |
local tmp60 = _L[22](_Int_sub(c, 48)) |
| 18673 |
local tmp61 = add(tmp59, tmp60) |
| 18674 |
tmp56 = tmp61 |
| 18675 |
tmp57 = strm_PRIME |
| 18676 |
goto cont |
| 18677 |
end |
| 18678 |
::else2:: |
| 18679 |
if 65 <= c and c <= 70 then |
| 18680 |
else |
| 18681 |
goto else3 |
| 18682 |
end |
| 18683 |
do |
| 18684 |
local tmp58 = _L[22](16) |
| 18685 |
local tmp59 = mul(accum1, tmp58) |
| 18686 |
local tmp60 = _L[22](_Int_sub(c, 55)) |
| 18687 |
local tmp61 = add(tmp59, tmp60) |
| 18688 |
tmp56 = tmp61 |
| 18689 |
tmp57 = strm_PRIME |
| 18690 |
goto cont |
| 18691 |
end |
| 18692 |
::else3:: |
| 18693 |
if 97 <= c and c <= 102 then |
| 18694 |
else |
| 18695 |
return {accum1, strm1} |
| 18696 |
end |
| 18697 |
do |
| 18698 |
local tmp58 = _L[22](16) |
| 18699 |
local tmp59 = mul(accum1, tmp58) |
| 18700 |
local tmp60 = _L[22](_Int_sub(c, 87)) |
| 18701 |
local tmp61 = add(tmp59, tmp60) |
| 18702 |
tmp56 = tmp61 |
| 18703 |
tmp57 = strm_PRIME |
| 18704 |
goto cont |
| 18705 |
end |
| 18706 |
end |
| 18707 |
end |
| 18708 |
end |
| 18709 |
readHexInt = function(accum, strm, state) |
| 18710 |
local exp = tmp55(strm, state) |
| 18711 |
if exp.tag == "NONE" then |
| 18712 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "hexadecimal digit"}}}, "parse_toml.sml:16:5") |
| 18713 |
end |
| 18714 |
if exp.tag == "SOME" then |
| 18715 |
else |
| 18716 |
_raise(_Match, "parse_toml.sml:292:9") |
| 18717 |
end |
| 18718 |
do |
| 18719 |
local c = exp.payload[1] |
| 18720 |
local strm_PRIME = exp.payload[2] |
| 18721 |
if 48 <= c and c <= 57 then |
| 18722 |
else |
| 18723 |
goto else1 |
| 18724 |
end |
| 18725 |
do |
| 18726 |
local tmp56 = _L[22](16) |
| 18727 |
local tmp57 = mul(accum, tmp56) |
| 18728 |
local tmp58 = _L[22](_Int_sub(c, 48)) |
| 18729 |
local tmp59 = add(tmp57, tmp58) |
| 18730 |
return readHexIntUnderscore(tmp59, strm_PRIME) |
| 18731 |
end |
| 18732 |
::else1:: |
| 18733 |
if 65 <= c and c <= 70 then |
| 18734 |
else |
| 18735 |
goto else2 |
| 18736 |
end |
| 18737 |
do |
| 18738 |
local tmp56 = _L[22](16) |
| 18739 |
local tmp57 = mul(accum, tmp56) |
| 18740 |
local tmp58 = _L[22](_Int_sub(c, 55)) |
| 18741 |
local tmp59 = add(tmp57, tmp58) |
| 18742 |
return readHexIntUnderscore(tmp59, strm_PRIME) |
| 18743 |
end |
| 18744 |
::else2:: |
| 18745 |
if 97 <= c and c <= 102 then |
| 18746 |
else |
| 18747 |
goto else3 |
| 18748 |
end |
| 18749 |
do |
| 18750 |
local tmp56 = _L[22](16) |
| 18751 |
local tmp57 = mul(accum, tmp56) |
| 18752 |
local tmp58 = _L[22](_Int_sub(c, 87)) |
| 18753 |
local tmp59 = add(tmp57, tmp58) |
| 18754 |
return readHexIntUnderscore(tmp59, strm_PRIME) |
| 18755 |
end |
| 18756 |
::else3:: |
| 18757 |
local tmp56 = toString(c) |
| 18758 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "hexadecimal digit"}}}, "parse_toml.sml:19:5") |
| 18759 |
end |
| 18760 |
end |
| 18761 |
local function readOctIntUnderscore(accum, strm) |
| 18762 |
local tmp56, tmp57 = accum, strm |
| 18763 |
::cont:: |
| 18764 |
do |
| 18765 |
local accum1, strm1 = tmp56, tmp57 |
| 18766 |
local exp |
| 18767 |
do |
| 18768 |
local strm2 = strm1[1] |
| 18769 |
exp = tmp55(strm2, strm1[2]) |
| 18770 |
end |
| 18771 |
if exp.tag == "NONE" then |
| 18772 |
return {accum1, strm1} |
| 18773 |
end |
| 18774 |
if exp.tag == "SOME" and exp.payload[1] == 95 then |
| 18775 |
else |
| 18776 |
goto else1 |
| 18777 |
end |
| 18778 |
do |
| 18779 |
local strm_PRIME = exp.payload[2] |
| 18780 |
local strm2 = strm_PRIME[1] |
| 18781 |
return readOctInt(accum1, strm2, strm_PRIME[2]) |
| 18782 |
end |
| 18783 |
::else1:: |
| 18784 |
if exp.tag == "SOME" then |
| 18785 |
else |
| 18786 |
_raise(_Match, "parse_toml.sml:376:9") |
| 18787 |
end |
| 18788 |
do |
| 18789 |
local c = exp.payload[1] |
| 18790 |
local strm_PRIME = exp.payload[2] |
| 18791 |
if 48 <= c and c <= 55 then |
| 18792 |
else |
| 18793 |
return {accum1, strm1} |
| 18794 |
end |
| 18795 |
do |
| 18796 |
local tmp58 = _L[22](8) |
| 18797 |
local tmp59 = mul(accum1, tmp58) |
| 18798 |
local tmp60 = _L[22](_Int_sub(c, 48)) |
| 18799 |
local tmp61 = add(tmp59, tmp60) |
| 18800 |
tmp56 = tmp61 |
| 18801 |
tmp57 = strm_PRIME |
| 18802 |
goto cont |
| 18803 |
end |
| 18804 |
end |
| 18805 |
end |
| 18806 |
end |
| 18807 |
readOctInt = function(accum, strm, state) |
| 18808 |
local exp = tmp55(strm, state) |
| 18809 |
if exp.tag == "NONE" then |
| 18810 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "octal digit"}}}, "parse_toml.sml:16:5") |
| 18811 |
end |
| 18812 |
if exp.tag == "SOME" then |
| 18813 |
else |
| 18814 |
_raise(_Match, "parse_toml.sml:362:9") |
| 18815 |
end |
| 18816 |
do |
| 18817 |
local c |
| 18818 |
do |
| 18819 |
c = exp.payload[1] |
| 18820 |
local strm_PRIME = exp.payload[2] |
| 18821 |
if 48 <= c and c <= 55 then |
| 18822 |
else |
| 18823 |
goto else1 |
| 18824 |
end |
| 18825 |
do |
| 18826 |
local tmp56 = _L[22](8) |
| 18827 |
local tmp57 = mul(accum, tmp56) |
| 18828 |
local tmp58 = _L[22](_Int_sub(c, 48)) |
| 18829 |
local tmp59 = add(tmp57, tmp58) |
| 18830 |
return readOctIntUnderscore(tmp59, strm_PRIME) |
| 18831 |
end |
| 18832 |
end |
| 18833 |
::else1:: |
| 18834 |
local tmp56 = toString(c) |
| 18835 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "octal digit"}}}, "parse_toml.sml:19:5") |
| 18836 |
end |
| 18837 |
end |
| 18838 |
local function readBinIntUnderscore(accum, strm) |
| 18839 |
local tmp56, tmp57 = accum, strm |
| 18840 |
::cont:: |
| 18841 |
do |
| 18842 |
local accum1, strm1 = tmp56, tmp57 |
| 18843 |
local exp |
| 18844 |
do |
| 18845 |
local strm2 = strm1[1] |
| 18846 |
exp = tmp55(strm2, strm1[2]) |
| 18847 |
end |
| 18848 |
if exp.tag == "NONE" then |
| 18849 |
return {accum1, strm1} |
| 18850 |
end |
| 18851 |
if exp.tag == "SOME" and exp.payload[1] == 95 then |
| 18852 |
else |
| 18853 |
goto else1 |
| 18854 |
end |
| 18855 |
do |
| 18856 |
local strm_PRIME = exp.payload[2] |
| 18857 |
local strm2 = strm_PRIME[1] |
| 18858 |
return readBinInt(accum1, strm2, strm_PRIME[2]) |
| 18859 |
end |
| 18860 |
::else1:: |
| 18861 |
if exp.tag == "SOME" and exp.payload[1] == 48 then |
| 18862 |
else |
| 18863 |
goto else2 |
| 18864 |
end |
| 18865 |
do |
| 18866 |
local strm_PRIME = exp.payload[2] |
| 18867 |
local tmp58 = _L[22](2) |
| 18868 |
local tmp59 = mul(accum1, tmp58) |
| 18869 |
tmp56 = tmp59 |
| 18870 |
tmp57 = strm_PRIME |
| 18871 |
goto cont |
| 18872 |
end |
| 18873 |
::else2:: |
| 18874 |
if exp.tag == "SOME" and exp.payload[1] == 49 then |
| 18875 |
elseif exp.tag == "SOME" then |
| 18876 |
return {accum1, strm1} |
| 18877 |
else |
| 18878 |
_raise(_Match, "parse_toml.sml:409:9") |
| 18879 |
end |
| 18880 |
do |
| 18881 |
local strm_PRIME = exp.payload[2] |
| 18882 |
local tmp58 = _L[22](2) |
| 18883 |
local tmp59 = mul(accum1, tmp58) |
| 18884 |
local tmp60 = _L[22](1) |
| 18885 |
local tmp61 = add(tmp59, tmp60) |
| 18886 |
tmp56 = tmp61 |
| 18887 |
tmp57 = strm_PRIME |
| 18888 |
goto cont |
| 18889 |
end |
| 18890 |
end |
| 18891 |
end |
| 18892 |
readBinInt = function(accum, strm, state) |
| 18893 |
local exp = tmp55(strm, state) |
| 18894 |
if exp.tag == "NONE" then |
| 18895 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "binary digit"}}}, "parse_toml.sml:16:5") |
| 18896 |
end |
| 18897 |
if exp.tag == "SOME" and exp.payload[1] == 48 then |
| 18898 |
else |
| 18899 |
goto else1 |
| 18900 |
end |
| 18901 |
do |
| 18902 |
local strm_PRIME = exp.payload[2] |
| 18903 |
local tmp56 = _L[22](2) |
| 18904 |
local tmp57 = mul(accum, tmp56) |
| 18905 |
return readBinIntUnderscore(tmp57, strm_PRIME) |
| 18906 |
end |
| 18907 |
::else1:: |
| 18908 |
if exp.tag == "SOME" and exp.payload[1] == 49 then |
| 18909 |
else |
| 18910 |
goto else2 |
| 18911 |
end |
| 18912 |
do |
| 18913 |
local strm_PRIME = exp.payload[2] |
| 18914 |
local tmp56 = _L[22](2) |
| 18915 |
local tmp57 = mul(accum, tmp56) |
| 18916 |
local tmp58 = _L[22](1) |
| 18917 |
local tmp59 = add(tmp57, tmp58) |
| 18918 |
return readBinIntUnderscore(tmp59, strm_PRIME) |
| 18919 |
end |
| 18920 |
::else2:: |
| 18921 |
if exp.tag == "SOME" then |
| 18922 |
else |
| 18923 |
_raise(_Match, "parse_toml.sml:394:9") |
| 18924 |
end |
| 18925 |
do |
| 18926 |
local tmp56 = toString(exp.payload[1]) |
| 18927 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "binary digit"}}}, "parse_toml.sml:19:5") |
| 18928 |
end |
| 18929 |
end |
| 18930 |
local readDecIntUnderscore, readDecInt |
| 18931 |
readDecIntUnderscore = function(accum, hadUnderscore, strm) |
| 18932 |
local tmp56, tmp57, tmp58 = accum, hadUnderscore, strm |
| 18933 |
::cont:: |
| 18934 |
do |
| 18935 |
local accum1, hadUnderscore1, strm1 = tmp56, tmp57, tmp58 |
| 18936 |
local exp |
| 18937 |
do |
| 18938 |
local strm2 = strm1[1] |
| 18939 |
exp = tmp55(strm2, strm1[2]) |
| 18940 |
end |
| 18941 |
if exp.tag == "NONE" then |
| 18942 |
return {accum1, hadUnderscore1, strm1} |
| 18943 |
end |
| 18944 |
if exp.tag == "SOME" and exp.payload[1] == 95 then |
| 18945 |
else |
| 18946 |
goto else1 |
| 18947 |
end |
| 18948 |
do |
| 18949 |
local strm_PRIME = exp.payload[2] |
| 18950 |
local strm2 = strm_PRIME[1] |
| 18951 |
return readDecInt(accum1, true, strm2, strm_PRIME[2]) |
| 18952 |
end |
| 18953 |
::else1:: |
| 18954 |
if exp.tag == "SOME" then |
| 18955 |
local c = exp.payload[1] |
| 18956 |
local strm_PRIME = exp.payload[2] |
| 18957 |
if 48 <= c and c <= 57 then |
| 18958 |
tmp56 = {c, accum1} |
| 18959 |
tmp57 = hadUnderscore1 |
| 18960 |
tmp58 = strm_PRIME |
| 18961 |
goto cont |
| 18962 |
else |
| 18963 |
return {accum1, hadUnderscore1, strm1} |
| 18964 |
end |
| 18965 |
else |
| 18966 |
_raise(_Match, "parse_toml.sml:436:9") |
| 18967 |
end |
| 18968 |
end |
| 18969 |
end |
| 18970 |
readDecInt = function(accum, hadUnderscore, strm, state) |
| 18971 |
local exp = tmp55(strm, state) |
| 18972 |
if exp.tag == "NONE" then |
| 18973 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "digit"}}}, "parse_toml.sml:16:5") |
| 18974 |
end |
| 18975 |
if exp.tag == "SOME" then |
| 18976 |
else |
| 18977 |
_raise(_Match, "parse_toml.sml:428:9") |
| 18978 |
end |
| 18979 |
do |
| 18980 |
local c |
| 18981 |
do |
| 18982 |
c = exp.payload[1] |
| 18983 |
local strm_PRIME = exp.payload[2] |
| 18984 |
if 48 <= c and c <= 57 then |
| 18985 |
else |
| 18986 |
goto else1 |
| 18987 |
end |
| 18988 |
do |
| 18989 |
return readDecIntUnderscore({c, accum}, hadUnderscore, strm_PRIME) |
| 18990 |
end |
| 18991 |
end |
| 18992 |
::else1:: |
| 18993 |
local tmp56 = toString(c) |
| 18994 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "digit"}}}, "parse_toml.sml:19:5") |
| 18995 |
end |
| 18996 |
end |
| 18997 |
local readExpPart = function(accum_PRIME, e, strm, state) |
| 18998 |
local exp |
| 18999 |
do |
| 19000 |
local exp1 = tmp55(strm, state) |
| 19001 |
do |
| 19002 |
if exp1.tag == "NONE" then |
| 19003 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "exponent part"}}}, "parse_toml.sml:16:5") |
| 19004 |
end |
| 19005 |
if exp1.tag == "SOME" and exp1.payload[1] == 43 then |
| 19006 |
else |
| 19007 |
goto else1 |
| 19008 |
end |
| 19009 |
do |
| 19010 |
local strm_PRIME_PRIME_PRIME = exp1.payload[2] |
| 19011 |
local tmp56 = {43, {e, accum_PRIME}} |
| 19012 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 19013 |
exp = readDecInt(tmp56, false, strm1, strm_PRIME_PRIME_PRIME[2]) |
| 19014 |
goto cont |
| 19015 |
end |
| 19016 |
::else1:: |
| 19017 |
if exp1.tag == "SOME" and exp1.payload[1] == 45 then |
| 19018 |
else |
| 19019 |
goto else2 |
| 19020 |
end |
| 19021 |
do |
| 19022 |
local strm_PRIME_PRIME_PRIME = exp1.payload[2] |
| 19023 |
local tmp56 = {45, {e, accum_PRIME}} |
| 19024 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 19025 |
exp = readDecInt(tmp56, false, strm1, strm_PRIME_PRIME_PRIME[2]) |
| 19026 |
goto cont |
| 19027 |
end |
| 19028 |
::else2:: |
| 19029 |
if exp1.tag == "SOME" then |
| 19030 |
else |
| 19031 |
_raise(_Match, "parse_toml.sml:448:13") |
| 19032 |
end |
| 19033 |
do |
| 19034 |
local c |
| 19035 |
do |
| 19036 |
c = exp1.payload[1] |
| 19037 |
local strm_PRIME_PRIME_PRIME = exp1.payload[2] |
| 19038 |
if 48 <= c and c <= 57 then |
| 19039 |
else |
| 19040 |
goto else3 |
| 19041 |
end |
| 19042 |
exp = readDecIntUnderscore({c, {e, accum_PRIME}}, false, strm_PRIME_PRIME_PRIME) |
| 19043 |
goto cont |
| 19044 |
end |
| 19045 |
::else3:: |
| 19046 |
local tmp56 = toString(c) |
| 19047 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "digit or sign (+/-)"}}}, "parse_toml.sml:19:5") |
| 19048 |
end |
| 19049 |
end |
| 19050 |
end |
| 19051 |
::cont:: |
| 19052 |
local accum_PRIME_PRIME = exp[1] |
| 19053 |
local strm_PRIME_PRIME_PRIME = exp[3] |
| 19054 |
local tmp56 = implodeRev(accum_PRIME_PRIME) |
| 19055 |
local tmp57 = _L[188](tmp56) |
| 19056 |
return {tmp57, strm_PRIME_PRIME_PRIME} |
| 19057 |
end |
| 19058 |
readSigned = function(sign, d0, strm) |
| 19059 |
local accum, strm_PRIME, checkPrefixZero, exp |
| 19060 |
do |
| 19061 |
local exp1 = readDecIntUnderscore({d0, {sign, nil}}, false, strm) |
| 19062 |
accum = exp1[1] |
| 19063 |
strm_PRIME = exp1[3] |
| 19064 |
checkPrefixZero = function() |
| 19065 |
if accum ~= nil and (accum[2] ~= nil and accum[2][2] == nil) then |
| 19066 |
return nil |
| 19067 |
elseif d0 == 48 then |
| 19068 |
_raise({tag = _L[186], payload = _L[181]}, "parse_toml.sml:470:38") |
| 19069 |
else |
| 19070 |
return nil |
| 19071 |
end |
| 19072 |
end |
| 19073 |
do |
| 19074 |
local strm1 = strm_PRIME[1] |
| 19075 |
exp = tmp55(strm1, strm_PRIME[2]) |
| 19076 |
end |
| 19077 |
if exp.tag == "SOME" and exp.payload[1] == 46 then |
| 19078 |
else |
| 19079 |
goto else1 |
| 19080 |
end |
| 19081 |
do |
| 19082 |
local accum_PRIME, strm_PRIME_PRIME_PRIME, exp2 |
| 19083 |
do |
| 19084 |
local strm_PRIME_PRIME = exp.payload[2] |
| 19085 |
checkPrefixZero() |
| 19086 |
local tmp56 = {46, accum} |
| 19087 |
local exp3 |
| 19088 |
do |
| 19089 |
local strm1 = strm_PRIME_PRIME[1] |
| 19090 |
exp3 = readDecInt(tmp56, false, strm1, strm_PRIME_PRIME[2]) |
| 19091 |
end |
| 19092 |
accum_PRIME = exp3[1] |
| 19093 |
strm_PRIME_PRIME_PRIME = exp3[3] |
| 19094 |
do |
| 19095 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 19096 |
exp2 = tmp55(strm1, strm_PRIME_PRIME_PRIME[2]) |
| 19097 |
end |
| 19098 |
if exp2.tag == "SOME" and exp2.payload[1] == 101 then |
| 19099 |
else |
| 19100 |
goto else4 |
| 19101 |
end |
| 19102 |
do |
| 19103 |
local strm_PRIME_PRIME_PRIME_PRIME = exp2.payload[2] |
| 19104 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19105 |
return readExpPart(accum_PRIME, 101, strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19106 |
end |
| 19107 |
end |
| 19108 |
::else4:: |
| 19109 |
if exp2.tag == "SOME" and exp2.payload[1] == 69 then |
| 19110 |
else |
| 19111 |
goto else5 |
| 19112 |
end |
| 19113 |
do |
| 19114 |
local strm_PRIME_PRIME_PRIME_PRIME = exp2.payload[2] |
| 19115 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19116 |
return readExpPart(accum_PRIME, 69, strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19117 |
end |
| 19118 |
::else5:: |
| 19119 |
local tmp56 = implodeRev(accum_PRIME) |
| 19120 |
local tmp57 = _L[188](tmp56) |
| 19121 |
return {tmp57, strm_PRIME_PRIME_PRIME} |
| 19122 |
end |
| 19123 |
end |
| 19124 |
::else1:: |
| 19125 |
if exp.tag == "SOME" and exp.payload[1] == 101 then |
| 19126 |
else |
| 19127 |
goto else2 |
| 19128 |
end |
| 19129 |
do |
| 19130 |
local strm_PRIME_PRIME = exp.payload[2] |
| 19131 |
checkPrefixZero() |
| 19132 |
local strm1 = strm_PRIME_PRIME[1] |
| 19133 |
return readExpPart(accum, 101, strm1, strm_PRIME_PRIME[2]) |
| 19134 |
end |
| 19135 |
::else2:: |
| 19136 |
if exp.tag == "SOME" and exp.payload[1] == 69 then |
| 19137 |
else |
| 19138 |
goto else3 |
| 19139 |
end |
| 19140 |
do |
| 19141 |
local strm_PRIME_PRIME = exp.payload[2] |
| 19142 |
checkPrefixZero() |
| 19143 |
local strm1 = strm_PRIME_PRIME[1] |
| 19144 |
return readExpPart(accum, 69, strm1, strm_PRIME_PRIME[2]) |
| 19145 |
end |
| 19146 |
::else3:: |
| 19147 |
checkPrefixZero() |
| 19148 |
local tmp56 = implodeRev(accum) |
| 19149 |
local tmp57 |
| 19150 |
do |
| 19151 |
local tmp58 = scanString(function(a) |
| 19152 |
return scan(DEC, a) |
| 19153 |
end) |
| 19154 |
tmp57 = tmp58(tmp56) |
| 19155 |
end |
| 19156 |
if tmp57.tag == "SOME" then |
| 19157 |
return {{tag = "INTEGER", payload = tmp57.payload}, strm_PRIME} |
| 19158 |
elseif tmp57.tag == "NONE" then |
| 19159 |
_raise(Option, "option.sml:24:18") |
| 19160 |
else |
| 19161 |
_raise(_Match, "option.sml:23:5") |
| 19162 |
end |
| 19163 |
end |
| 19164 |
local readTwoDigit = function(accum, strm, state) |
| 19165 |
local exp = tmp55(strm, state) |
| 19166 |
if exp.tag == "NONE" then |
| 19167 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "digit"}}}, "parse_toml.sml:16:5") |
| 19168 |
end |
| 19169 |
if exp.tag == "SOME" then |
| 19170 |
else |
| 19171 |
_raise(_Match, "parse_toml.sml:502:9") |
| 19172 |
end |
| 19173 |
do |
| 19174 |
local c0 |
| 19175 |
do |
| 19176 |
c0 = exp.payload[1] |
| 19177 |
local strm_PRIME = exp.payload[2] |
| 19178 |
if 48 <= c0 and c0 <= 57 then |
| 19179 |
else |
| 19180 |
goto else1 |
| 19181 |
end |
| 19182 |
do |
| 19183 |
local exp1 |
| 19184 |
do |
| 19185 |
local strm1 = strm_PRIME[1] |
| 19186 |
exp1 = tmp55(strm1, strm_PRIME[2]) |
| 19187 |
end |
| 19188 |
if exp1.tag == "NONE" then |
| 19189 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "digit"}}}, "parse_toml.sml:16:5") |
| 19190 |
end |
| 19191 |
if exp1.tag == "SOME" then |
| 19192 |
else |
| 19193 |
_raise(_Match, "parse_toml.sml:506:15") |
| 19194 |
end |
| 19195 |
do |
| 19196 |
local c1 = exp1.payload[1] |
| 19197 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 19198 |
if 48 <= c1 and c1 <= 57 then |
| 19199 |
local tmp56 = {c1, {c0, accum}} |
| 19200 |
local tmp57 = _Int_mul(_Int_sub(c0, 48), 10) |
| 19201 |
return {tmp56, _Int_add(tmp57, _Int_sub(c1, 48)), strm_PRIME_PRIME} |
| 19202 |
end |
| 19203 |
local tmp56 = toString(c1) |
| 19204 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "digit"}}}, "parse_toml.sml:19:5") |
| 19205 |
end |
| 19206 |
end |
| 19207 |
end |
| 19208 |
::else1:: |
| 19209 |
local tmp56 = toString(c0) |
| 19210 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "digit"}}}, "parse_toml.sml:19:5") |
| 19211 |
end |
| 19212 |
end |
| 19213 |
local readMinSec = function(accum, strm, state) |
| 19214 |
local exp = readTwoDigit(accum, strm, state) |
| 19215 |
local accum_PRIME = exp[1] |
| 19216 |
local min = exp[2] |
| 19217 |
local strm_PRIME = exp[3] |
| 19218 |
local strm_PRIME_PRIME |
| 19219 |
do |
| 19220 |
local strm1 = strm_PRIME[1] |
| 19221 |
strm_PRIME_PRIME = expect(58, strm1, strm_PRIME[2]) |
| 19222 |
end |
| 19223 |
local tmp56 = {58, accum_PRIME} |
| 19224 |
local exp1 |
| 19225 |
do |
| 19226 |
local strm1 = strm_PRIME_PRIME[1] |
| 19227 |
exp1 = readTwoDigit(tmp56, strm1, strm_PRIME_PRIME[2]) |
| 19228 |
end |
| 19229 |
local accum_PRIME_PRIME = exp1[1] |
| 19230 |
local sec = exp1[2] |
| 19231 |
local strm_PRIME_PRIME_PRIME = exp1[3] |
| 19232 |
local tmp57 = min < 60 and sec <= 60 |
| 19233 |
if tmp57 then |
| 19234 |
else |
| 19235 |
_raise({tag = _L[186], payload = _L[184]}, "parse_toml.sml:535:18") |
| 19236 |
end |
| 19237 |
local exp2 |
| 19238 |
do |
| 19239 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 19240 |
exp2 = tmp55(strm1, strm_PRIME_PRIME_PRIME[2]) |
| 19241 |
end |
| 19242 |
if exp2.tag == "SOME" and exp2.payload[1] == 46 then |
| 19243 |
else |
| 19244 |
return {accum_PRIME_PRIME, strm_PRIME_PRIME_PRIME} |
| 19245 |
end |
| 19246 |
do |
| 19247 |
local tmp58, tmp59 |
| 19248 |
do |
| 19249 |
local strm_PRIME_PRIME_PRIME_PRIME = exp2.payload[2] |
| 19250 |
tmp59, tmp58 = {46, accum_PRIME_PRIME}, strm_PRIME_PRIME_PRIME_PRIME |
| 19251 |
end |
| 19252 |
::cont:: |
| 19253 |
do |
| 19254 |
local accum1, strm1 = tmp59, tmp58 |
| 19255 |
local exp3 |
| 19256 |
do |
| 19257 |
local strm2 = strm1[1] |
| 19258 |
exp3 = tmp55(strm2, strm1[2]) |
| 19259 |
end |
| 19260 |
if exp3.tag == "NONE" then |
| 19261 |
return {accum1, strm1} |
| 19262 |
end |
| 19263 |
if exp3.tag == "SOME" then |
| 19264 |
local c = exp3.payload[1] |
| 19265 |
local strm_PRIME1 = exp3.payload[2] |
| 19266 |
if 48 <= c and c <= 57 then |
| 19267 |
tmp59 = {c, accum1} |
| 19268 |
tmp58 = strm_PRIME1 |
| 19269 |
goto cont |
| 19270 |
else |
| 19271 |
return {accum1, strm1} |
| 19272 |
end |
| 19273 |
else |
| 19274 |
_raise(_Match, "parse_toml.sml:520:11") |
| 19275 |
end |
| 19276 |
end |
| 19277 |
end |
| 19278 |
end |
| 19279 |
local readTimePart = function(accum, strm, state) |
| 19280 |
local accum_PRIME_PRIME, strm_PRIME_PRIME, exp |
| 19281 |
do |
| 19282 |
local exp1 = readTwoDigit(accum, strm, state) |
| 19283 |
local accum_PRIME = exp1[1] |
| 19284 |
local hour = exp1[2] |
| 19285 |
local strm_PRIME = exp1[3] |
| 19286 |
if hour < 24 then |
| 19287 |
else |
| 19288 |
_raise({tag = _L[186], payload = _L[184]}, "parse_toml.sml:545:46") |
| 19289 |
end |
| 19290 |
local tmp56 = {58, accum_PRIME} |
| 19291 |
local tmp57 |
| 19292 |
do |
| 19293 |
local strm1 = strm_PRIME[1] |
| 19294 |
tmp57 = expect(58, strm1, strm_PRIME[2]) |
| 19295 |
end |
| 19296 |
local exp2 |
| 19297 |
do |
| 19298 |
local strm1 = tmp57[1] |
| 19299 |
exp2 = readMinSec(tmp56, strm1, tmp57[2]) |
| 19300 |
end |
| 19301 |
accum_PRIME_PRIME = exp2[1] |
| 19302 |
strm_PRIME_PRIME = exp2[2] |
| 19303 |
do |
| 19304 |
local strm1 = strm_PRIME_PRIME[1] |
| 19305 |
exp = tmp55(strm1, strm_PRIME_PRIME[2]) |
| 19306 |
end |
| 19307 |
if exp.tag == "SOME" and exp.payload[1] == 90 then |
| 19308 |
else |
| 19309 |
goto else1 |
| 19310 |
end |
| 19311 |
do |
| 19312 |
local strm_PRIME_PRIME_PRIME = exp.payload[2] |
| 19313 |
local tmp58 = implodeRev({90, accum_PRIME_PRIME}) |
| 19314 |
return {{tag = "DATETIME", payload = tmp58}, strm_PRIME_PRIME_PRIME} |
| 19315 |
end |
| 19316 |
end |
| 19317 |
::else1:: |
| 19318 |
if exp.tag == "SOME" and exp.payload[1] == 122 then |
| 19319 |
else |
| 19320 |
goto else2 |
| 19321 |
end |
| 19322 |
do |
| 19323 |
local strm_PRIME_PRIME_PRIME = exp.payload[2] |
| 19324 |
local tmp56 = implodeRev({122, accum_PRIME_PRIME}) |
| 19325 |
return {{tag = "DATETIME", payload = tmp56}, strm_PRIME_PRIME_PRIME} |
| 19326 |
end |
| 19327 |
::else2:: |
| 19328 |
if exp.tag == "SOME" and exp.payload[1] == 43 then |
| 19329 |
else |
| 19330 |
goto else3 |
| 19331 |
end |
| 19332 |
do |
| 19333 |
local strm_PRIME_PRIME_PRIME = exp.payload[2] |
| 19334 |
local tmp56 = {43, accum_PRIME_PRIME} |
| 19335 |
local exp1 |
| 19336 |
do |
| 19337 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 19338 |
exp1 = readTwoDigit(tmp56, strm1, strm_PRIME_PRIME_PRIME[2]) |
| 19339 |
end |
| 19340 |
local accum_PRIME_PRIME_PRIME = exp1[1] |
| 19341 |
local offsetHour = exp1[2] |
| 19342 |
local strm_PRIME_PRIME_PRIME_PRIME = exp1[3] |
| 19343 |
local strm_PRIME_PRIME_PRIME_PRIME_PRIME |
| 19344 |
do |
| 19345 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19346 |
strm_PRIME_PRIME_PRIME_PRIME_PRIME = expect(58, strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19347 |
end |
| 19348 |
local tmp57 = {58, accum_PRIME_PRIME_PRIME} |
| 19349 |
local exp2 |
| 19350 |
do |
| 19351 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME_PRIME[1] |
| 19352 |
exp2 = readTwoDigit(tmp57, strm1, strm_PRIME_PRIME_PRIME_PRIME_PRIME[2]) |
| 19353 |
end |
| 19354 |
local accum_PRIME_PRIME_PRIME_PRIME = exp2[1] |
| 19355 |
local offsetMin = exp2[2] |
| 19356 |
local strm_PRIME_PRIME_PRIME_PRIME_PRIME_PRIME = exp2[3] |
| 19357 |
if offsetHour < 24 and offsetMin < 60 then |
| 19358 |
else |
| 19359 |
_raise({tag = _L[186], payload = _L[184]}, "parse_toml.sml:567:24") |
| 19360 |
end |
| 19361 |
do |
| 19362 |
local tmp58 = implodeRev(accum_PRIME_PRIME_PRIME_PRIME) |
| 19363 |
return {{tag = "DATETIME", payload = tmp58}, strm_PRIME_PRIME_PRIME_PRIME_PRIME_PRIME} |
| 19364 |
end |
| 19365 |
end |
| 19366 |
::else3:: |
| 19367 |
if exp.tag == "SOME" and exp.payload[1] == 45 then |
| 19368 |
else |
| 19369 |
goto else4 |
| 19370 |
end |
| 19371 |
do |
| 19372 |
local strm_PRIME_PRIME_PRIME = exp.payload[2] |
| 19373 |
local tmp56 = {45, accum_PRIME_PRIME} |
| 19374 |
local exp1 |
| 19375 |
do |
| 19376 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 19377 |
exp1 = readTwoDigit(tmp56, strm1, strm_PRIME_PRIME_PRIME[2]) |
| 19378 |
end |
| 19379 |
local accum_PRIME_PRIME_PRIME = exp1[1] |
| 19380 |
local offsetHour = exp1[2] |
| 19381 |
local strm_PRIME_PRIME_PRIME_PRIME = exp1[3] |
| 19382 |
local strm_PRIME_PRIME_PRIME_PRIME_PRIME |
| 19383 |
do |
| 19384 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19385 |
strm_PRIME_PRIME_PRIME_PRIME_PRIME = expect(58, strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19386 |
end |
| 19387 |
local tmp57 = {58, accum_PRIME_PRIME_PRIME} |
| 19388 |
local exp2 |
| 19389 |
do |
| 19390 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME_PRIME[1] |
| 19391 |
exp2 = readTwoDigit(tmp57, strm1, strm_PRIME_PRIME_PRIME_PRIME_PRIME[2]) |
| 19392 |
end |
| 19393 |
local accum_PRIME_PRIME_PRIME_PRIME = exp2[1] |
| 19394 |
local offsetMin = exp2[2] |
| 19395 |
local strm_PRIME_PRIME_PRIME_PRIME_PRIME_PRIME = exp2[3] |
| 19396 |
if offsetHour < 24 and offsetMin < 60 then |
| 19397 |
else |
| 19398 |
_raise({tag = _L[186], payload = _L[184]}, "parse_toml.sml:580:24") |
| 19399 |
end |
| 19400 |
do |
| 19401 |
local tmp58 = implodeRev(accum_PRIME_PRIME_PRIME_PRIME) |
| 19402 |
return {{tag = "DATETIME", payload = tmp58}, strm_PRIME_PRIME_PRIME_PRIME_PRIME_PRIME} |
| 19403 |
end |
| 19404 |
end |
| 19405 |
::else4:: |
| 19406 |
local tmp56 = implodeRev(accum_PRIME_PRIME) |
| 19407 |
return {{tag = "LOCAL_DATETIME", payload = tmp56}, strm_PRIME_PRIME} |
| 19408 |
end |
| 19409 |
readUnsigned = function(d0, strm) |
| 19410 |
local revDigits, hadUnderscore, strm_PRIME, checkPrefixZero, tmp56 |
| 19411 |
do |
| 19412 |
local exp = readDecIntUnderscore({d0, nil}, false, strm) |
| 19413 |
revDigits = exp[1] |
| 19414 |
hadUnderscore = exp[2] |
| 19415 |
strm_PRIME = exp[3] |
| 19416 |
checkPrefixZero = function() |
| 19417 |
if revDigits ~= nil and revDigits[2] == nil then |
| 19418 |
return nil |
| 19419 |
elseif d0 == 48 then |
| 19420 |
_raise({tag = _L[186], payload = _L[181]}, "parse_toml.sml:637:38") |
| 19421 |
else |
| 19422 |
return nil |
| 19423 |
end |
| 19424 |
end |
| 19425 |
do |
| 19426 |
local strm1 = strm_PRIME[1] |
| 19427 |
tmp56 = tmp55(strm1, strm_PRIME[2]) |
| 19428 |
end |
| 19429 |
local tmp57 = revDigits ~= nil and (revDigits[2] ~= nil and (revDigits[2][2] ~= nil and (revDigits[2][2][2] ~= nil and revDigits[2][2][2][2] == nil))) |
| 19430 |
local tmp58 |
| 19431 |
tmp58 = tmp57 and (not hadUnderscore and (tmp56.tag == "SOME" and tmp56.payload[1] == 45)) |
| 19432 |
if tmp58 then |
| 19433 |
else |
| 19434 |
goto else1 |
| 19435 |
end |
| 19436 |
do |
| 19437 |
local tmp59, accum_PRIME, month, strm_PRIME_PRIME |
| 19438 |
do |
| 19439 |
local tmp60 = revDigits[1] |
| 19440 |
local tmp61 = revDigits[2][1] |
| 19441 |
local tmp62 = revDigits[2][2][1] |
| 19442 |
local strm_PRIME_PRIME1 = tmp56.payload[2] |
| 19443 |
local tmp63 = _Int_mul(_Int_sub(d0, 48), 10) |
| 19444 |
local tmp64 = _Int_mul(_Int_add(tmp63, _Int_sub(tmp62, 48)), 10) |
| 19445 |
local tmp65 = _Int_mul(_Int_add(tmp64, _Int_sub(tmp61, 48)), 10) |
| 19446 |
tmp59 = _Int_add(tmp65, _Int_sub(tmp60, 48)) |
| 19447 |
local tmp66 = {45, revDigits} |
| 19448 |
local exp1 |
| 19449 |
do |
| 19450 |
local strm1 = strm_PRIME_PRIME1[1] |
| 19451 |
exp1 = readTwoDigit(tmp66, strm1, strm_PRIME_PRIME1[2]) |
| 19452 |
end |
| 19453 |
accum_PRIME = exp1[1] |
| 19454 |
month = exp1[2] |
| 19455 |
local strm_PRIME1 = exp1[3] |
| 19456 |
do |
| 19457 |
local strm1 = strm_PRIME1[1] |
| 19458 |
strm_PRIME_PRIME = expect(45, strm1, strm_PRIME1[2]) |
| 19459 |
end |
| 19460 |
end |
| 19461 |
local accum_PRIME_PRIME, strm_PRIME_PRIME_PRIME, tmp60 |
| 19462 |
do |
| 19463 |
local exp1 |
| 19464 |
do |
| 19465 |
local strm1 = strm_PRIME_PRIME[1] |
| 19466 |
exp1 = readTwoDigit(accum_PRIME, strm1, strm_PRIME_PRIME[2]) |
| 19467 |
end |
| 19468 |
accum_PRIME_PRIME = exp1[1] |
| 19469 |
local mday = exp1[2] |
| 19470 |
strm_PRIME_PRIME_PRIME = exp1[3] |
| 19471 |
do |
| 19472 |
if month == 1 then |
| 19473 |
tmp60 = 1 <= mday and mday <= 31 |
| 19474 |
goto cont |
| 19475 |
end |
| 19476 |
if month == 2 and mday == 29 then |
| 19477 |
elseif month == 2 then |
| 19478 |
tmp60 = 1 <= mday and mday <= 28 |
| 19479 |
goto cont |
| 19480 |
elseif month == 3 then |
| 19481 |
tmp60 = 1 <= mday and mday <= 31 |
| 19482 |
goto cont |
| 19483 |
elseif month == 4 then |
| 19484 |
tmp60 = 1 <= mday and mday <= 30 |
| 19485 |
goto cont |
| 19486 |
elseif month == 5 then |
| 19487 |
tmp60 = 1 <= mday and mday <= 31 |
| 19488 |
goto cont |
| 19489 |
elseif month == 6 then |
| 19490 |
tmp60 = 1 <= mday and mday <= 30 |
| 19491 |
goto cont |
| 19492 |
elseif month == 7 then |
| 19493 |
tmp60 = 1 <= mday and mday <= 31 |
| 19494 |
goto cont |
| 19495 |
elseif month == 8 then |
| 19496 |
tmp60 = 1 <= mday and mday <= 31 |
| 19497 |
goto cont |
| 19498 |
elseif month == 9 then |
| 19499 |
tmp60 = 1 <= mday and mday <= 30 |
| 19500 |
goto cont |
| 19501 |
elseif month == 10 then |
| 19502 |
tmp60 = 1 <= mday and mday <= 31 |
| 19503 |
goto cont |
| 19504 |
elseif month == 11 then |
| 19505 |
tmp60 = 1 <= mday and mday <= 30 |
| 19506 |
goto cont |
| 19507 |
else |
| 19508 |
tmp60 = month == 12 and (1 <= mday and mday <= 31) |
| 19509 |
goto cont |
| 19510 |
end |
| 19511 |
do |
| 19512 |
local tmp61 = rem(tmp59, 4) |
| 19513 |
if tmp61 == 0 then |
| 19514 |
else |
| 19515 |
tmp60 = false |
| 19516 |
goto cont |
| 19517 |
end |
| 19518 |
do |
| 19519 |
local tmp62 = rem(tmp59, 100) |
| 19520 |
if tmp62 ~= 0 then |
| 19521 |
tmp60 = true |
| 19522 |
goto cont |
| 19523 |
end |
| 19524 |
local tmp63 = rem(tmp59, 400) |
| 19525 |
tmp60 = tmp63 == 0 |
| 19526 |
end |
| 19527 |
end |
| 19528 |
end |
| 19529 |
end |
| 19530 |
::cont:: |
| 19531 |
if tmp60 then |
| 19532 |
else |
| 19533 |
_raise({tag = _L[186], payload = _L[183]}, "parse_toml.sml:599:18") |
| 19534 |
end |
| 19535 |
local exp1 |
| 19536 |
do |
| 19537 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 19538 |
exp1 = tmp55(strm1, strm_PRIME_PRIME_PRIME[2]) |
| 19539 |
end |
| 19540 |
if exp1.tag == "SOME" and exp1.payload[1] == 84 then |
| 19541 |
else |
| 19542 |
goto else6 |
| 19543 |
end |
| 19544 |
do |
| 19545 |
local strm_PRIME_PRIME_PRIME_PRIME = exp1.payload[2] |
| 19546 |
local tmp61 = {84, accum_PRIME_PRIME} |
| 19547 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19548 |
return readTimePart(tmp61, strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19549 |
end |
| 19550 |
::else6:: |
| 19551 |
if exp1.tag == "SOME" and exp1.payload[1] == 116 then |
| 19552 |
else |
| 19553 |
goto else7 |
| 19554 |
end |
| 19555 |
do |
| 19556 |
local strm_PRIME_PRIME_PRIME_PRIME = exp1.payload[2] |
| 19557 |
local tmp61 = {84, accum_PRIME_PRIME} |
| 19558 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19559 |
return readTimePart(tmp61, strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19560 |
end |
| 19561 |
::else7:: |
| 19562 |
if exp1.tag == "SOME" and exp1.payload[1] == 32 then |
| 19563 |
else |
| 19564 |
goto else8 |
| 19565 |
end |
| 19566 |
do |
| 19567 |
do |
| 19568 |
local strm_PRIME_PRIME_PRIME_PRIME = exp1.payload[2] |
| 19569 |
local exp2 |
| 19570 |
do |
| 19571 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19572 |
exp2 = tmp55(strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19573 |
end |
| 19574 |
if exp2.tag == "SOME" then |
| 19575 |
else |
| 19576 |
goto else9 |
| 19577 |
end |
| 19578 |
do |
| 19579 |
do |
| 19580 |
local c = exp2.payload[1] |
| 19581 |
if 48 <= c and c <= 57 then |
| 19582 |
else |
| 19583 |
goto else10 |
| 19584 |
end |
| 19585 |
do |
| 19586 |
local tmp61 = {84, accum_PRIME_PRIME} |
| 19587 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19588 |
return readTimePart(tmp61, strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19589 |
end |
| 19590 |
end |
| 19591 |
::else10:: |
| 19592 |
local tmp61 = implodeRev(accum_PRIME_PRIME) |
| 19593 |
return {{tag = "DATE", payload = tmp61}, strm_PRIME_PRIME_PRIME} |
| 19594 |
end |
| 19595 |
end |
| 19596 |
::else9:: |
| 19597 |
local tmp61 = implodeRev(accum_PRIME_PRIME) |
| 19598 |
return {{tag = "DATE", payload = tmp61}, strm_PRIME_PRIME_PRIME} |
| 19599 |
end |
| 19600 |
::else8:: |
| 19601 |
local tmp61 = implodeRev(accum_PRIME_PRIME) |
| 19602 |
return {{tag = "DATE", payload = tmp61}, strm_PRIME_PRIME_PRIME} |
| 19603 |
end |
| 19604 |
end |
| 19605 |
::else1:: |
| 19606 |
do |
| 19607 |
local tmp57 = revDigits ~= nil and (revDigits[2] ~= nil and revDigits[2][2] == nil) |
| 19608 |
local tmp58 |
| 19609 |
tmp58 = tmp57 and (not hadUnderscore and (tmp56.tag == "SOME" and tmp56.payload[1] == 58)) |
| 19610 |
if tmp58 then |
| 19611 |
else |
| 19612 |
goto else2 |
| 19613 |
end |
| 19614 |
do |
| 19615 |
local tmp59 = revDigits[1] |
| 19616 |
local tmp60 = revDigits[2][1] |
| 19617 |
local strm_PRIME_PRIME = tmp56.payload[2] |
| 19618 |
local tmp61 = _Int_mul(_Int_sub(tmp60, 48), 10) |
| 19619 |
if _Int_add(tmp61, _Int_sub(tmp59, 48)) < 24 then |
| 19620 |
else |
| 19621 |
_raise({tag = _L[186], payload = _L[184]}, "parse_toml.sml:652:45") |
| 19622 |
end |
| 19623 |
local tmp62 = {58, revDigits} |
| 19624 |
local exp |
| 19625 |
do |
| 19626 |
local strm1 = strm_PRIME_PRIME[1] |
| 19627 |
exp = readMinSec(tmp62, strm1, strm_PRIME_PRIME[2]) |
| 19628 |
end |
| 19629 |
local accum = exp[1] |
| 19630 |
local strm_PRIME_PRIME_PRIME = exp[2] |
| 19631 |
local tmp63 = implodeRev(accum) |
| 19632 |
return {{tag = "TIME", payload = tmp63}, strm_PRIME_PRIME_PRIME} |
| 19633 |
end |
| 19634 |
end |
| 19635 |
::else2:: |
| 19636 |
if tmp56.tag == "SOME" and tmp56.payload[1] == 46 then |
| 19637 |
else |
| 19638 |
goto else3 |
| 19639 |
end |
| 19640 |
do |
| 19641 |
local accum, strm_PRIME_PRIME_PRIME, exp |
| 19642 |
do |
| 19643 |
local strm_PRIME_PRIME = tmp56.payload[2] |
| 19644 |
checkPrefixZero() |
| 19645 |
local tmp57 = {46, revDigits} |
| 19646 |
local exp1 |
| 19647 |
do |
| 19648 |
local strm1 = strm_PRIME_PRIME[1] |
| 19649 |
exp1 = readDecInt(tmp57, false, strm1, strm_PRIME_PRIME[2]) |
| 19650 |
end |
| 19651 |
accum = exp1[1] |
| 19652 |
strm_PRIME_PRIME_PRIME = exp1[3] |
| 19653 |
do |
| 19654 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 19655 |
exp = tmp55(strm1, strm_PRIME_PRIME_PRIME[2]) |
| 19656 |
end |
| 19657 |
if exp.tag == "SOME" and exp.payload[1] == 101 then |
| 19658 |
else |
| 19659 |
goto else6 |
| 19660 |
end |
| 19661 |
do |
| 19662 |
local strm_PRIME_PRIME_PRIME_PRIME = exp.payload[2] |
| 19663 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19664 |
return readExpPart(accum, 101, strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19665 |
end |
| 19666 |
end |
| 19667 |
::else6:: |
| 19668 |
if exp.tag == "SOME" and exp.payload[1] == 69 then |
| 19669 |
else |
| 19670 |
goto else7 |
| 19671 |
end |
| 19672 |
do |
| 19673 |
local strm_PRIME_PRIME_PRIME_PRIME = exp.payload[2] |
| 19674 |
local strm1 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 19675 |
return readExpPart(accum, 69, strm1, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 19676 |
end |
| 19677 |
::else7:: |
| 19678 |
local tmp57 = implodeRev(accum) |
| 19679 |
local tmp58 = _L[188](tmp57) |
| 19680 |
return {tmp58, strm_PRIME_PRIME_PRIME} |
| 19681 |
end |
| 19682 |
::else3:: |
| 19683 |
if tmp56.tag == "SOME" and tmp56.payload[1] == 101 then |
| 19684 |
else |
| 19685 |
goto else4 |
| 19686 |
end |
| 19687 |
do |
| 19688 |
local strm_PRIME_PRIME = tmp56.payload[2] |
| 19689 |
checkPrefixZero() |
| 19690 |
local strm1 = strm_PRIME_PRIME[1] |
| 19691 |
return readExpPart(revDigits, 101, strm1, strm_PRIME_PRIME[2]) |
| 19692 |
end |
| 19693 |
::else4:: |
| 19694 |
if tmp56.tag == "SOME" and tmp56.payload[1] == 69 then |
| 19695 |
else |
| 19696 |
goto else5 |
| 19697 |
end |
| 19698 |
do |
| 19699 |
local strm_PRIME_PRIME = tmp56.payload[2] |
| 19700 |
checkPrefixZero() |
| 19701 |
local strm1 = strm_PRIME_PRIME[1] |
| 19702 |
return readExpPart(revDigits, 69, strm1, strm_PRIME_PRIME[2]) |
| 19703 |
end |
| 19704 |
::else5:: |
| 19705 |
checkPrefixZero() |
| 19706 |
local tmp57 = implodeRev(revDigits) |
| 19707 |
local tmp58 |
| 19708 |
do |
| 19709 |
local tmp59 = scanString(function(a) |
| 19710 |
return scan(DEC, a) |
| 19711 |
end) |
| 19712 |
tmp58 = tmp59(tmp57) |
| 19713 |
end |
| 19714 |
if tmp58.tag == "SOME" then |
| 19715 |
return {{tag = "INTEGER", payload = tmp58.payload}, strm_PRIME} |
| 19716 |
elseif tmp58.tag == "NONE" then |
| 19717 |
_raise(Option, "option.sml:24:18") |
| 19718 |
else |
| 19719 |
_raise(_Match, "option.sml:23:5") |
| 19720 |
end |
| 19721 |
end |
| 19722 |
end |
| 19723 |
local readKey, IMPLICIT_HEADER, finalizeTable, readKeyval, insertKeyval, insertTable |
| 19724 |
do |
| 19725 |
local isValidUnquotedKey = function(a) |
| 19726 |
local tmp56 |
| 19727 |
do |
| 19728 |
local tmp57 |
| 19729 |
if 65 <= a and a <= 90 then |
| 19730 |
tmp56 = true |
| 19731 |
goto cont |
| 19732 |
else |
| 19733 |
tmp57 = 97 <= a and a <= 122 |
| 19734 |
end |
| 19735 |
tmp56 = tmp57 or 48 <= a and a <= 57 |
| 19736 |
end |
| 19737 |
::cont:: |
| 19738 |
return tmp56 or (a == 45 or a == 95) |
| 19739 |
end |
| 19740 |
local readSimpleKey = function(a) |
| 19741 |
if a.tag == "NONE" then |
| 19742 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "key"}}}, "parse_toml.sml:16:5") |
| 19743 |
end |
| 19744 |
if a.tag == "SOME" and a.payload[1] == 34 then |
| 19745 |
else |
| 19746 |
goto else1 |
| 19747 |
end |
| 19748 |
do |
| 19749 |
local strm = a.payload[2] |
| 19750 |
local strm1 = strm[1] |
| 19751 |
return go(nil, strm1, strm[2]) |
| 19752 |
end |
| 19753 |
::else1:: |
| 19754 |
if a.tag == "SOME" and a.payload[1] == 39 then |
| 19755 |
else |
| 19756 |
goto else2 |
| 19757 |
end |
| 19758 |
do |
| 19759 |
local strm = a.payload[2] |
| 19760 |
local strm1 = strm[1] |
| 19761 |
return go2(nil, strm1, strm[2]) |
| 19762 |
end |
| 19763 |
::else2:: |
| 19764 |
if a.tag == "SOME" then |
| 19765 |
else |
| 19766 |
_raise(_Match, "parse_toml.sml:688:11") |
| 19767 |
end |
| 19768 |
do |
| 19769 |
local c0 |
| 19770 |
do |
| 19771 |
c0 = a.payload[1] |
| 19772 |
local strm = a.payload[2] |
| 19773 |
local tmp56 = isValidUnquotedKey(c0) |
| 19774 |
if tmp56 then |
| 19775 |
else |
| 19776 |
goto else3 |
| 19777 |
end |
| 19778 |
do |
| 19779 |
local tmp57, tmp58 = {c0, nil}, strm |
| 19780 |
::cont:: |
| 19781 |
do |
| 19782 |
local accum, strm_PRIME = tmp57, tmp58 |
| 19783 |
local exp |
| 19784 |
do |
| 19785 |
local strm1 = strm_PRIME[1] |
| 19786 |
exp = tmp55(strm1, strm_PRIME[2]) |
| 19787 |
end |
| 19788 |
if exp.tag == "NONE" then |
| 19789 |
else |
| 19790 |
goto else4 |
| 19791 |
end |
| 19792 |
do |
| 19793 |
local tmp59 = implodeRev(accum) |
| 19794 |
return {tmp59, strm_PRIME} |
| 19795 |
end |
| 19796 |
::else4:: |
| 19797 |
if exp.tag == "SOME" then |
| 19798 |
else |
| 19799 |
_raise(_Match, "parse_toml.sml:694:17") |
| 19800 |
end |
| 19801 |
do |
| 19802 |
local c = exp.payload[1] |
| 19803 |
local strm_PRIME_PRIME = exp.payload[2] |
| 19804 |
local tmp59 = isValidUnquotedKey(c) |
| 19805 |
if tmp59 then |
| 19806 |
tmp57 = {c, accum} |
| 19807 |
tmp58 = strm_PRIME_PRIME |
| 19808 |
goto cont |
| 19809 |
end |
| 19810 |
local tmp60 = implodeRev(accum) |
| 19811 |
return {tmp60, strm_PRIME} |
| 19812 |
end |
| 19813 |
end |
| 19814 |
end |
| 19815 |
end |
| 19816 |
::else3:: |
| 19817 |
local tmp56 = toString(c0) |
| 19818 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp56, expected = "quote, alphanum, '-', or '_'"}}}, "parse_toml.sml:19:5") |
| 19819 |
end |
| 19820 |
end |
| 19821 |
readKey = function(a) |
| 19822 |
local tmp56, tmp57 |
| 19823 |
do |
| 19824 |
local exp = readSimpleKey(a) |
| 19825 |
local k0 = exp[1] |
| 19826 |
local strm = exp[2] |
| 19827 |
local tmp58 = {k0, nil} |
| 19828 |
local tmp59 = skipWhiteSpace(strm) |
| 19829 |
tmp57, tmp56 = tmp58, tmp59 |
| 19830 |
end |
| 19831 |
::cont:: |
| 19832 |
do |
| 19833 |
local strm, accum |
| 19834 |
do |
| 19835 |
accum, strm = tmp57, tmp56 |
| 19836 |
local exp |
| 19837 |
do |
| 19838 |
local strm1 = strm[1] |
| 19839 |
exp = tmp55(strm1, strm[2]) |
| 19840 |
end |
| 19841 |
if exp.tag == "SOME" and exp.payload[1] == 46 then |
| 19842 |
else |
| 19843 |
goto else1 |
| 19844 |
end |
| 19845 |
do |
| 19846 |
local strm_PRIME = exp.payload[2] |
| 19847 |
local tmp58 |
| 19848 |
do |
| 19849 |
local strm1 = strm_PRIME[1] |
| 19850 |
tmp58 = skipWhiteSpaceAndGetc(strm1, strm_PRIME[2]) |
| 19851 |
end |
| 19852 |
local exp1 = readSimpleKey(tmp58) |
| 19853 |
local k = exp1[1] |
| 19854 |
local strm_PRIME_PRIME = exp1[2] |
| 19855 |
local tmp59 = {k, accum} |
| 19856 |
local tmp60 = skipWhiteSpace(strm_PRIME_PRIME) |
| 19857 |
tmp57 = tmp59 |
| 19858 |
tmp56 = tmp60 |
| 19859 |
goto cont |
| 19860 |
end |
| 19861 |
end |
| 19862 |
::else1:: |
| 19863 |
local tmp58 = revAppend(accum, nil) |
| 19864 |
return {tmp58, strm} |
| 19865 |
end |
| 19866 |
end |
| 19867 |
local EXACT_HEADER = "EXACT_HEADER" |
| 19868 |
IMPLICIT_HEADER = "IMPLICIT_HEADER" |
| 19869 |
local IMPLICIT_KEYVAL = "IMPLICIT_KEYVAL" |
| 19870 |
local finalize, finalizeValue |
| 19871 |
finalize = function(a) |
| 19872 |
local tmp56 = finalizeTable(a) |
| 19873 |
return {tag = "TABLE", payload = tmp56} |
| 19874 |
end |
| 19875 |
finalizeValue = function(a) |
| 19876 |
if a.tag == "LEAF" then |
| 19877 |
return a.payload |
| 19878 |
end |
| 19879 |
if a.tag == "PARTIAL_TABLE" then |
| 19880 |
else |
| 19881 |
goto else1 |
| 19882 |
end |
| 19883 |
do |
| 19884 |
return finalize(a.payload[2]) |
| 19885 |
end |
| 19886 |
::else1:: |
| 19887 |
if a.tag == "PARTIAL_ARRAY" then |
| 19888 |
else |
| 19889 |
_raise(_Match, "parse_toml.sml:733:11") |
| 19890 |
end |
| 19891 |
do |
| 19892 |
local last = a.payload[1] |
| 19893 |
local xs = a.payload[2] |
| 19894 |
local tmp56 = map(finalize) |
| 19895 |
local tmp57 = tmp56(xs) |
| 19896 |
local tmp58 = finalize(last) |
| 19897 |
local tmp59 = revAppend(tmp57, {tmp58, nil}) |
| 19898 |
return {tag = "ARRAY", payload = tmp59} |
| 19899 |
end |
| 19900 |
end |
| 19901 |
finalizeTable = function(a) |
| 19902 |
local tmp56 = map(function(a1) |
| 19903 |
local key = a1[1] |
| 19904 |
local tmp57 = finalizeValue(a1[2]) |
| 19905 |
return {key, tmp57} |
| 19906 |
end) |
| 19907 |
return tmp56(a) |
| 19908 |
end |
| 19909 |
local function insert(revPath, pt, tmp56, v) |
| 19910 |
if tmp56 ~= nil and tmp56[2] == nil then |
| 19911 |
else |
| 19912 |
goto else1 |
| 19913 |
end |
| 19914 |
do |
| 19915 |
local tmp57 |
| 19916 |
do |
| 19917 |
tmp57 = tmp56[1] |
| 19918 |
local tmp58 = exists(function(a) |
| 19919 |
return tmp57 == a[1] |
| 19920 |
end) |
| 19921 |
local tmp59 = tmp58(pt) |
| 19922 |
if tmp59 then |
| 19923 |
else |
| 19924 |
goto else2 |
| 19925 |
end |
| 19926 |
do |
| 19927 |
local tmp60 = revAppend(revPath, tmp56) |
| 19928 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp60}}, "parse_toml.sml:22:5") |
| 19929 |
end |
| 19930 |
end |
| 19931 |
::else2:: |
| 19932 |
local tmp58 = {{tmp57, {tag = "LEAF", payload = v}}, nil} |
| 19933 |
local tmp59 = revAppend(pt, nil) |
| 19934 |
return revAppend(tmp59, tmp58) |
| 19935 |
end |
| 19936 |
::else1:: |
| 19937 |
if tmp56 ~= nil then |
| 19938 |
elseif tmp56 == nil then |
| 19939 |
_raise(_Match, "parse_toml.sml:781:34") |
| 19940 |
else |
| 19941 |
_raise(_Match, "parse_toml.sml:741:11") |
| 19942 |
end |
| 19943 |
do |
| 19944 |
local tmp57 = tmp56[1] |
| 19945 |
local tmp58 = tmp56[2] |
| 19946 |
local tmp59, tmp60 = nil, pt |
| 19947 |
::cont:: |
| 19948 |
do |
| 19949 |
local accum, tmp61 = tmp59, tmp60 |
| 19950 |
if tmp61 == nil then |
| 19951 |
else |
| 19952 |
goto else2 |
| 19953 |
end |
| 19954 |
do |
| 19955 |
local tmp62 = insert({tmp57, revPath}, nil, tmp58, v) |
| 19956 |
return revAppend(accum, {{tmp57, {tag = "PARTIAL_TABLE", payload = {IMPLICIT_KEYVAL, tmp62}}}, nil}) |
| 19957 |
end |
| 19958 |
::else2:: |
| 19959 |
if tmp61 ~= nil then |
| 19960 |
else |
| 19961 |
_raise(_Match, "parse_toml.sml:748:19") |
| 19962 |
end |
| 19963 |
do |
| 19964 |
local tmp62 = tmp61[1] |
| 19965 |
local key_PRIME = tmp61[1][1] |
| 19966 |
local pv = tmp61[1][2] |
| 19967 |
local tmp63 = tmp61[2] |
| 19968 |
if tmp57 == key_PRIME then |
| 19969 |
else |
| 19970 |
tmp59 = {tmp62, accum} |
| 19971 |
tmp60 = tmp63 |
| 19972 |
goto cont |
| 19973 |
end |
| 19974 |
do |
| 19975 |
if pv.tag == "LEAF" then |
| 19976 |
else |
| 19977 |
goto else3 |
| 19978 |
end |
| 19979 |
do |
| 19980 |
local tmp64 = revAppend(revPath, {tmp57, nil}) |
| 19981 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp64}}, "parse_toml.sml:22:5") |
| 19982 |
end |
| 19983 |
::else3:: |
| 19984 |
if pv.tag == "PARTIAL_TABLE" and pv.payload[1] == "EXACT_HEADER" then |
| 19985 |
else |
| 19986 |
goto else4 |
| 19987 |
end |
| 19988 |
do |
| 19989 |
local tmp64 = revAppend(revPath, {tmp57, nil}) |
| 19990 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp64}}, "parse_toml.sml:22:5") |
| 19991 |
end |
| 19992 |
::else4:: |
| 19993 |
if pv.tag == "PARTIAL_TABLE" then |
| 19994 |
else |
| 19995 |
goto else5 |
| 19996 |
end |
| 19997 |
do |
| 19998 |
local definedBy = pv.payload[1] |
| 19999 |
local pt_PRIME = pv.payload[2] |
| 20000 |
local tmp64 = insert({tmp57, revPath}, pt_PRIME, tmp58, v) |
| 20001 |
return revAppend(accum, {{key_PRIME, {tag = "PARTIAL_TABLE", payload = {definedBy, tmp64}}}, tmp63}) |
| 20002 |
end |
| 20003 |
::else5:: |
| 20004 |
if pv.tag == "PARTIAL_ARRAY" then |
| 20005 |
else |
| 20006 |
_raise(_Match, "parse_toml.sml:760:23") |
| 20007 |
end |
| 20008 |
do |
| 20009 |
local tmp64 = revAppend(revPath, {tmp57, nil}) |
| 20010 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp64}}, "parse_toml.sml:22:5") |
| 20011 |
end |
| 20012 |
end |
| 20013 |
end |
| 20014 |
end |
| 20015 |
end |
| 20016 |
end |
| 20017 |
local readInlineTable, readArray, readValue |
| 20018 |
readKeyval = function(revPath, r) |
| 20019 |
local exp = readKey(r) |
| 20020 |
local key = exp[1] |
| 20021 |
local strm_PRIME = exp[2] |
| 20022 |
local tmp56 = revAppend(key, revPath) |
| 20023 |
local tmp57 |
| 20024 |
do |
| 20025 |
local strm = strm_PRIME[1] |
| 20026 |
tmp57 = expect(61, strm, strm_PRIME[2]) |
| 20027 |
end |
| 20028 |
local tmp58 |
| 20029 |
do |
| 20030 |
local strm = tmp57[1] |
| 20031 |
tmp58 = skipWhiteSpaceAndGetc(strm, tmp57[2]) |
| 20032 |
end |
| 20033 |
local exp1 = readValue(tmp56, tmp58) |
| 20034 |
local v = exp1[1] |
| 20035 |
return {key, v, exp1[2]} |
| 20036 |
end |
| 20037 |
readInlineTable = function(revPath, accum, r) |
| 20038 |
local tmp56, tmp57, tmp58 = revPath, accum, r |
| 20039 |
::cont:: |
| 20040 |
do |
| 20041 |
local accum_PRIME, exp |
| 20042 |
do |
| 20043 |
local revPath1, accum1, r1 = tmp56, tmp57, tmp58 |
| 20044 |
local exp1 = readKeyval(revPath1, r1) |
| 20045 |
local key = exp1[1] |
| 20046 |
local v = exp1[2] |
| 20047 |
local strm = exp1[3] |
| 20048 |
accum_PRIME = insert(revPath1, accum1, key, v) |
| 20049 |
do |
| 20050 |
local strm1 = strm[1] |
| 20051 |
exp = skipWhiteSpaceAndGetc(strm1, strm[2]) |
| 20052 |
end |
| 20053 |
if exp.tag == "NONE" then |
| 20054 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "',' or '}'"}}}, "parse_toml.sml:16:5") |
| 20055 |
end |
| 20056 |
if exp.tag == "SOME" and exp.payload[1] == 44 then |
| 20057 |
else |
| 20058 |
goto else1 |
| 20059 |
end |
| 20060 |
do |
| 20061 |
local strm_PRIME = exp.payload[2] |
| 20062 |
local tmp59 |
| 20063 |
do |
| 20064 |
local strm1 = strm_PRIME[1] |
| 20065 |
tmp59 = skipWhiteSpaceAndGetc(strm1, strm_PRIME[2]) |
| 20066 |
end |
| 20067 |
tmp56 = revPath1 |
| 20068 |
tmp57 = accum_PRIME |
| 20069 |
tmp58 = tmp59 |
| 20070 |
goto cont |
| 20071 |
end |
| 20072 |
end |
| 20073 |
::else1:: |
| 20074 |
if exp.tag == "SOME" and exp.payload[1] == 125 then |
| 20075 |
else |
| 20076 |
goto else2 |
| 20077 |
end |
| 20078 |
do |
| 20079 |
local strm_PRIME = exp.payload[2] |
| 20080 |
local tmp59 = finalize(accum_PRIME) |
| 20081 |
return {tmp59, strm_PRIME} |
| 20082 |
end |
| 20083 |
::else2:: |
| 20084 |
if exp.tag == "SOME" then |
| 20085 |
else |
| 20086 |
_raise(_Match, "parse_toml.sml:922:11") |
| 20087 |
end |
| 20088 |
do |
| 20089 |
local tmp59 = toString(exp.payload[1]) |
| 20090 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp59, expected = "',' or '}'"}}}, "parse_toml.sml:19:5") |
| 20091 |
end |
| 20092 |
end |
| 20093 |
end |
| 20094 |
readArray = function(revPath, accum, strm) |
| 20095 |
local tmp56, tmp57, tmp58 = revPath, accum, strm |
| 20096 |
::cont:: |
| 20097 |
do |
| 20098 |
local accum1, revPath1, exp |
| 20099 |
do |
| 20100 |
local strm1 |
| 20101 |
revPath1, accum1, strm1 = tmp56, tmp57, tmp58 |
| 20102 |
exp = skipWhiteSpaceOrCommentOrNewlineAndGetc(strm1) |
| 20103 |
if exp.tag == "SOME" and exp.payload[1] == 93 then |
| 20104 |
else |
| 20105 |
goto else1 |
| 20106 |
end |
| 20107 |
do |
| 20108 |
local strm_PRIME = exp.payload[2] |
| 20109 |
local tmp59 = revAppend(accum1, nil) |
| 20110 |
return {{tag = "ARRAY", payload = tmp59}, strm_PRIME} |
| 20111 |
end |
| 20112 |
end |
| 20113 |
::else1:: |
| 20114 |
local exp1 |
| 20115 |
do |
| 20116 |
local exp2 = readValue(revPath1, exp) |
| 20117 |
local v = exp2[1] |
| 20118 |
exp1 = skipWhiteSpaceOrCommentOrNewlineAndGetc(exp2[2]) |
| 20119 |
if exp1.tag == "NONE" then |
| 20120 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "',' or ']'"}}}, "parse_toml.sml:16:5") |
| 20121 |
end |
| 20122 |
if exp1.tag == "SOME" and exp1.payload[1] == 44 then |
| 20123 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 20124 |
tmp56 = revPath1 |
| 20125 |
tmp57 = {v, accum1} |
| 20126 |
tmp58 = strm_PRIME_PRIME |
| 20127 |
goto cont |
| 20128 |
end |
| 20129 |
if exp1.tag == "SOME" and exp1.payload[1] == 93 then |
| 20130 |
else |
| 20131 |
goto else2 |
| 20132 |
end |
| 20133 |
do |
| 20134 |
local strm_PRIME_PRIME = exp1.payload[2] |
| 20135 |
local tmp59 = revAppend({v, accum1}, nil) |
| 20136 |
return {{tag = "ARRAY", payload = tmp59}, strm_PRIME_PRIME} |
| 20137 |
end |
| 20138 |
end |
| 20139 |
::else2:: |
| 20140 |
if exp1.tag == "SOME" then |
| 20141 |
else |
| 20142 |
_raise(_Match, "parse_toml.sml:910:16") |
| 20143 |
end |
| 20144 |
do |
| 20145 |
local tmp59 = toString(exp1.payload[1]) |
| 20146 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp59, expected = "',' or ']'"}}}, "parse_toml.sml:19:5") |
| 20147 |
end |
| 20148 |
end |
| 20149 |
end |
| 20150 |
readValue = function(revPath, tmp56) |
| 20151 |
if tmp56.tag == "NONE" then |
| 20152 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "value"}}}, "parse_toml.sml:16:5") |
| 20153 |
end |
| 20154 |
if tmp56.tag == "SOME" then |
| 20155 |
else |
| 20156 |
_raise(_Match, "parse_toml.sml:788:11") |
| 20157 |
end |
| 20158 |
do |
| 20159 |
local c = tmp56.payload[1] |
| 20160 |
local strm = tmp56.payload[2] |
| 20161 |
if c == 34 then |
| 20162 |
else |
| 20163 |
goto else1 |
| 20164 |
end |
| 20165 |
do |
| 20166 |
do |
| 20167 |
local exp |
| 20168 |
do |
| 20169 |
local strm1 = strm[1] |
| 20170 |
exp = tmp55(strm1, strm[2]) |
| 20171 |
end |
| 20172 |
if exp.tag == "NONE" then |
| 20173 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing quote"}}}, "parse_toml.sml:16:5") |
| 20174 |
end |
| 20175 |
if exp.tag == "SOME" and exp.payload[1] == 34 then |
| 20176 |
else |
| 20177 |
goto else13 |
| 20178 |
end |
| 20179 |
do |
| 20180 |
local strm_PRIME = exp.payload[2] |
| 20181 |
local exp1 |
| 20182 |
do |
| 20183 |
local strm1 = strm_PRIME[1] |
| 20184 |
exp1 = tmp55(strm1, strm_PRIME[2]) |
| 20185 |
end |
| 20186 |
if exp1.tag == "SOME" and exp1.payload[1] == 34 then |
| 20187 |
else |
| 20188 |
return {{tag = "STRING", payload = ""}, strm_PRIME} |
| 20189 |
end |
| 20190 |
do |
| 20191 |
local tmp57 = skipOptionalNewline(exp1.payload[2]) |
| 20192 |
local exp2 |
| 20193 |
do |
| 20194 |
local strm1 = tmp57[1] |
| 20195 |
exp2 = go1(nil, strm1, tmp57[2]) |
| 20196 |
end |
| 20197 |
local s = exp2[1] |
| 20198 |
local strm_PRIME_PRIME_PRIME = exp2[2] |
| 20199 |
return {{tag = "STRING", payload = s}, strm_PRIME_PRIME_PRIME} |
| 20200 |
end |
| 20201 |
end |
| 20202 |
end |
| 20203 |
::else13:: |
| 20204 |
local exp |
| 20205 |
do |
| 20206 |
local strm1 = strm[1] |
| 20207 |
exp = go(nil, strm1, strm[2]) |
| 20208 |
end |
| 20209 |
local s = exp[1] |
| 20210 |
local strm_PRIME = exp[2] |
| 20211 |
return {{tag = "STRING", payload = s}, strm_PRIME} |
| 20212 |
end |
| 20213 |
::else1:: |
| 20214 |
if c == 39 then |
| 20215 |
else |
| 20216 |
goto else2 |
| 20217 |
end |
| 20218 |
do |
| 20219 |
do |
| 20220 |
local exp |
| 20221 |
do |
| 20222 |
local strm1 = strm[1] |
| 20223 |
exp = tmp55(strm1, strm[2]) |
| 20224 |
end |
| 20225 |
if exp.tag == "NONE" then |
| 20226 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing quote"}}}, "parse_toml.sml:16:5") |
| 20227 |
end |
| 20228 |
if exp.tag == "SOME" and exp.payload[1] == 39 then |
| 20229 |
else |
| 20230 |
goto else13 |
| 20231 |
end |
| 20232 |
do |
| 20233 |
local strm_PRIME = exp.payload[2] |
| 20234 |
local exp1 |
| 20235 |
do |
| 20236 |
local strm1 = strm_PRIME[1] |
| 20237 |
exp1 = tmp55(strm1, strm_PRIME[2]) |
| 20238 |
end |
| 20239 |
if exp1.tag == "SOME" and exp1.payload[1] == 39 then |
| 20240 |
else |
| 20241 |
return {{tag = "STRING", payload = ""}, strm_PRIME} |
| 20242 |
end |
| 20243 |
do |
| 20244 |
local strm_PRIME_PRIME_PRIME, s |
| 20245 |
do |
| 20246 |
local tmp57 = skipOptionalNewline(exp1.payload[2]) |
| 20247 |
do |
| 20248 |
local tmp58, tmp59, tmp60 |
| 20249 |
do |
| 20250 |
local strm1 = tmp57[1] |
| 20251 |
tmp58 = nil |
| 20252 |
tmp59 = strm1 |
| 20253 |
tmp60 = tmp57[2] |
| 20254 |
end |
| 20255 |
::cont1:: |
| 20256 |
do |
| 20257 |
local accum, exp2 |
| 20258 |
do |
| 20259 |
local strm1, state |
| 20260 |
accum, strm1, state = tmp58, tmp59, tmp60 |
| 20261 |
exp2 = tmp55(strm1, state) |
| 20262 |
if exp2.tag == "NONE" then |
| 20263 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing triple quote"}}}, "parse_toml.sml:16:5") |
| 20264 |
end |
| 20265 |
if exp2.tag == "SOME" and exp2.payload[1] == 39 then |
| 20266 |
else |
| 20267 |
goto else14 |
| 20268 |
end |
| 20269 |
do |
| 20270 |
local exp3 |
| 20271 |
do |
| 20272 |
local strm_PRIME1 = exp2.payload[2] |
| 20273 |
do |
| 20274 |
local strm2 = strm_PRIME1[1] |
| 20275 |
exp3 = tmp55(strm2, strm_PRIME1[2]) |
| 20276 |
end |
| 20277 |
if exp3.tag == "SOME" and exp3.payload[1] == 39 then |
| 20278 |
else |
| 20279 |
goto else15 |
| 20280 |
end |
| 20281 |
do |
| 20282 |
local exp4 |
| 20283 |
do |
| 20284 |
local strm_PRIME_PRIME = exp3.payload[2] |
| 20285 |
do |
| 20286 |
local strm2 = strm_PRIME_PRIME[1] |
| 20287 |
exp4 = tmp55(strm2, strm_PRIME_PRIME[2]) |
| 20288 |
end |
| 20289 |
if exp4.tag == "SOME" and exp4.payload[1] == 39 then |
| 20290 |
else |
| 20291 |
goto else16 |
| 20292 |
end |
| 20293 |
do |
| 20294 |
local strm_PRIME_PRIME_PRIME1 |
| 20295 |
do |
| 20296 |
strm_PRIME_PRIME_PRIME1 = exp4.payload[2] |
| 20297 |
local exp5 |
| 20298 |
do |
| 20299 |
local strm2 = strm_PRIME_PRIME_PRIME1[1] |
| 20300 |
exp5 = tmp55(strm2, strm_PRIME_PRIME_PRIME1[2]) |
| 20301 |
end |
| 20302 |
if exp5.tag == "SOME" and exp5.payload[1] == 39 then |
| 20303 |
else |
| 20304 |
goto else17 |
| 20305 |
end |
| 20306 |
do |
| 20307 |
local strm_PRIME_PRIME_PRIME_PRIME |
| 20308 |
do |
| 20309 |
strm_PRIME_PRIME_PRIME_PRIME = exp5.payload[2] |
| 20310 |
local exp6 |
| 20311 |
do |
| 20312 |
local strm2 = strm_PRIME_PRIME_PRIME_PRIME[1] |
| 20313 |
exp6 = tmp55(strm2, strm_PRIME_PRIME_PRIME_PRIME[2]) |
| 20314 |
end |
| 20315 |
if exp6.tag == "SOME" and exp6.payload[1] == 39 then |
| 20316 |
else |
| 20317 |
goto else18 |
| 20318 |
end |
| 20319 |
do |
| 20320 |
local strm_PRIME_PRIME_PRIME_PRIME_PRIME = exp6.payload[2] |
| 20321 |
local tmp61 = implodeRev({39, {39, accum}}) |
| 20322 |
strm_PRIME_PRIME_PRIME = strm_PRIME_PRIME_PRIME_PRIME_PRIME |
| 20323 |
s = tmp61 |
| 20324 |
goto cont |
| 20325 |
end |
| 20326 |
end |
| 20327 |
::else18:: |
| 20328 |
local tmp61 = implodeRev({39, accum}) |
| 20329 |
strm_PRIME_PRIME_PRIME = strm_PRIME_PRIME_PRIME_PRIME |
| 20330 |
s = tmp61 |
| 20331 |
goto cont |
| 20332 |
end |
| 20333 |
end |
| 20334 |
::else17:: |
| 20335 |
local tmp61 = implodeRev(accum) |
| 20336 |
strm_PRIME_PRIME_PRIME = strm_PRIME_PRIME_PRIME1 |
| 20337 |
s = tmp61 |
| 20338 |
goto cont |
| 20339 |
end |
| 20340 |
end |
| 20341 |
::else16:: |
| 20342 |
if exp4.tag == "SOME" then |
| 20343 |
elseif exp4.tag == "NONE" then |
| 20344 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing triple quote"}}}, "parse_toml.sml:16:5") |
| 20345 |
else |
| 20346 |
_raise(_Match, "parse_toml.sml:267:21") |
| 20347 |
end |
| 20348 |
do |
| 20349 |
local c1 = exp4.payload[1] |
| 20350 |
local strm_PRIME_PRIME_PRIME1 = exp4.payload[2] |
| 20351 |
local tmp61 = checkAllowedChar(c1) |
| 20352 |
local tmp62 = {tmp61, {39, {39, accum}}} |
| 20353 |
local strm2 = strm_PRIME_PRIME_PRIME1[1] |
| 20354 |
tmp58 = tmp62 |
| 20355 |
tmp59 = strm2 |
| 20356 |
tmp60 = strm_PRIME_PRIME_PRIME1[2] |
| 20357 |
goto cont1 |
| 20358 |
end |
| 20359 |
end |
| 20360 |
end |
| 20361 |
::else15:: |
| 20362 |
if exp3.tag == "SOME" then |
| 20363 |
elseif exp3.tag == "NONE" then |
| 20364 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "closing triple quote"}}}, "parse_toml.sml:16:5") |
| 20365 |
else |
| 20366 |
_raise(_Match, "parse_toml.sml:265:16") |
| 20367 |
end |
| 20368 |
do |
| 20369 |
local c1 = exp3.payload[1] |
| 20370 |
local strm_PRIME_PRIME = exp3.payload[2] |
| 20371 |
local tmp61 = checkAllowedChar(c1) |
| 20372 |
local tmp62 = {tmp61, {39, accum}} |
| 20373 |
local strm2 = strm_PRIME_PRIME[1] |
| 20374 |
tmp58 = tmp62 |
| 20375 |
tmp59 = strm2 |
| 20376 |
tmp60 = strm_PRIME_PRIME[2] |
| 20377 |
goto cont1 |
| 20378 |
end |
| 20379 |
end |
| 20380 |
end |
| 20381 |
::else14:: |
| 20382 |
if exp2.tag == "SOME" then |
| 20383 |
else |
| 20384 |
_raise(_Match, "parse_toml.sml:262:11") |
| 20385 |
end |
| 20386 |
do |
| 20387 |
local c1 = exp2.payload[1] |
| 20388 |
local strm_PRIME1 = exp2.payload[2] |
| 20389 |
local tmp61 = checkAllowedChar(c1) |
| 20390 |
local tmp62 = {tmp61, accum} |
| 20391 |
local strm1 = strm_PRIME1[1] |
| 20392 |
tmp58 = tmp62 |
| 20393 |
tmp59 = strm1 |
| 20394 |
tmp60 = strm_PRIME1[2] |
| 20395 |
goto cont1 |
| 20396 |
end |
| 20397 |
end |
| 20398 |
end |
| 20399 |
end |
| 20400 |
::cont:: |
| 20401 |
return {{tag = "STRING", payload = s}, strm_PRIME_PRIME_PRIME} |
| 20402 |
end |
| 20403 |
end |
| 20404 |
end |
| 20405 |
::else13:: |
| 20406 |
local exp |
| 20407 |
do |
| 20408 |
local strm1 = strm[1] |
| 20409 |
exp = go2(nil, strm1, strm[2]) |
| 20410 |
end |
| 20411 |
local s = exp[1] |
| 20412 |
local strm_PRIME = exp[2] |
| 20413 |
return {{tag = "STRING", payload = s}, strm_PRIME} |
| 20414 |
end |
| 20415 |
::else2:: |
| 20416 |
if c == 91 then |
| 20417 |
else |
| 20418 |
goto else3 |
| 20419 |
end |
| 20420 |
do |
| 20421 |
return readArray({"[]", revPath}, nil, strm) |
| 20422 |
end |
| 20423 |
::else3:: |
| 20424 |
if c == 123 then |
| 20425 |
else |
| 20426 |
goto else4 |
| 20427 |
end |
| 20428 |
do |
| 20429 |
local exp |
| 20430 |
do |
| 20431 |
local strm1 = strm[1] |
| 20432 |
exp = skipWhiteSpaceAndGetc(strm1, strm[2]) |
| 20433 |
end |
| 20434 |
if exp.tag == "SOME" and exp.payload[1] == 125 then |
| 20435 |
local strm_PRIME = exp.payload[2] |
| 20436 |
return {{tag = "TABLE", payload = nil}, strm_PRIME} |
| 20437 |
else |
| 20438 |
return readInlineTable(revPath, nil, exp) |
| 20439 |
end |
| 20440 |
end |
| 20441 |
::else4:: |
| 20442 |
if c == 116 then |
| 20443 |
else |
| 20444 |
goto else5 |
| 20445 |
end |
| 20446 |
do |
| 20447 |
local tmp57 = {tag = "BOOL", payload = true} |
| 20448 |
local tmp58 |
| 20449 |
do |
| 20450 |
local strm1 = strm[1] |
| 20451 |
tmp58 = expect(114, strm1, strm[2]) |
| 20452 |
end |
| 20453 |
local tmp59 |
| 20454 |
do |
| 20455 |
local strm1 = tmp58[1] |
| 20456 |
tmp59 = expect(117, strm1, tmp58[2]) |
| 20457 |
end |
| 20458 |
local tmp60 |
| 20459 |
do |
| 20460 |
local strm1 = tmp59[1] |
| 20461 |
tmp60 = expect(101, strm1, tmp59[2]) |
| 20462 |
end |
| 20463 |
return {tmp57, tmp60} |
| 20464 |
end |
| 20465 |
::else5:: |
| 20466 |
if c == 102 then |
| 20467 |
else |
| 20468 |
goto else6 |
| 20469 |
end |
| 20470 |
do |
| 20471 |
local tmp57 = {tag = "BOOL", payload = false} |
| 20472 |
local tmp58 |
| 20473 |
do |
| 20474 |
local strm1 = strm[1] |
| 20475 |
tmp58 = expect(97, strm1, strm[2]) |
| 20476 |
end |
| 20477 |
local tmp59 |
| 20478 |
do |
| 20479 |
local strm1 = tmp58[1] |
| 20480 |
tmp59 = expect(108, strm1, tmp58[2]) |
| 20481 |
end |
| 20482 |
local tmp60 |
| 20483 |
do |
| 20484 |
local strm1 = tmp59[1] |
| 20485 |
tmp60 = expect(115, strm1, tmp59[2]) |
| 20486 |
end |
| 20487 |
local tmp61 |
| 20488 |
do |
| 20489 |
local strm1 = tmp60[1] |
| 20490 |
tmp61 = expect(101, strm1, tmp60[2]) |
| 20491 |
end |
| 20492 |
return {tmp57, tmp61} |
| 20493 |
end |
| 20494 |
::else6:: |
| 20495 |
if c == 105 then |
| 20496 |
else |
| 20497 |
goto else7 |
| 20498 |
end |
| 20499 |
do |
| 20500 |
local tmp57 = _L[188]("inf") |
| 20501 |
local tmp58 |
| 20502 |
do |
| 20503 |
local strm1 = strm[1] |
| 20504 |
tmp58 = expect(110, strm1, strm[2]) |
| 20505 |
end |
| 20506 |
local tmp59 |
| 20507 |
do |
| 20508 |
local strm1 = tmp58[1] |
| 20509 |
tmp59 = expect(102, strm1, tmp58[2]) |
| 20510 |
end |
| 20511 |
return {tmp57, tmp59} |
| 20512 |
end |
| 20513 |
::else7:: |
| 20514 |
if c == 110 then |
| 20515 |
else |
| 20516 |
goto else8 |
| 20517 |
end |
| 20518 |
do |
| 20519 |
local tmp57 = _L[188]("nan") |
| 20520 |
local tmp58 |
| 20521 |
do |
| 20522 |
local strm1 = strm[1] |
| 20523 |
tmp58 = expect(97, strm1, strm[2]) |
| 20524 |
end |
| 20525 |
local tmp59 |
| 20526 |
do |
| 20527 |
local strm1 = tmp58[1] |
| 20528 |
tmp59 = expect(110, strm1, tmp58[2]) |
| 20529 |
end |
| 20530 |
return {tmp57, tmp59} |
| 20531 |
end |
| 20532 |
::else8:: |
| 20533 |
if c == 43 then |
| 20534 |
else |
| 20535 |
goto else9 |
| 20536 |
end |
| 20537 |
do |
| 20538 |
local exp |
| 20539 |
do |
| 20540 |
local strm1 = strm[1] |
| 20541 |
exp = tmp55(strm1, strm[2]) |
| 20542 |
end |
| 20543 |
if exp.tag == "NONE" then |
| 20544 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "digit or 'inf' or 'nan'"}}}, "parse_toml.sml:16:5") |
| 20545 |
end |
| 20546 |
if exp.tag == "SOME" and exp.payload[1] == 105 then |
| 20547 |
else |
| 20548 |
goto else13 |
| 20549 |
end |
| 20550 |
do |
| 20551 |
local strm_PRIME = exp.payload[2] |
| 20552 |
local tmp57 = _L[188]("+inf") |
| 20553 |
local tmp58 |
| 20554 |
do |
| 20555 |
local strm1 = strm_PRIME[1] |
| 20556 |
tmp58 = expect(110, strm1, strm_PRIME[2]) |
| 20557 |
end |
| 20558 |
local tmp59 |
| 20559 |
do |
| 20560 |
local strm1 = tmp58[1] |
| 20561 |
tmp59 = expect(102, strm1, tmp58[2]) |
| 20562 |
end |
| 20563 |
return {tmp57, tmp59} |
| 20564 |
end |
| 20565 |
::else13:: |
| 20566 |
if exp.tag == "SOME" and exp.payload[1] == 110 then |
| 20567 |
else |
| 20568 |
goto else14 |
| 20569 |
end |
| 20570 |
do |
| 20571 |
local strm_PRIME = exp.payload[2] |
| 20572 |
local tmp57 = _L[188]("+nan") |
| 20573 |
local tmp58 |
| 20574 |
do |
| 20575 |
local strm1 = strm_PRIME[1] |
| 20576 |
tmp58 = expect(97, strm1, strm_PRIME[2]) |
| 20577 |
end |
| 20578 |
local tmp59 |
| 20579 |
do |
| 20580 |
local strm1 = tmp58[1] |
| 20581 |
tmp59 = expect(110, strm1, tmp58[2]) |
| 20582 |
end |
| 20583 |
return {tmp57, tmp59} |
| 20584 |
end |
| 20585 |
::else14:: |
| 20586 |
if exp.tag == "SOME" then |
| 20587 |
else |
| 20588 |
_raise(_Match, "parse_toml.sml:845:18") |
| 20589 |
end |
| 20590 |
do |
| 20591 |
local c_PRIME |
| 20592 |
do |
| 20593 |
c_PRIME = exp.payload[1] |
| 20594 |
local strm_PRIME = exp.payload[2] |
| 20595 |
if 48 <= c_PRIME and c_PRIME <= 57 then |
| 20596 |
else |
| 20597 |
goto else15 |
| 20598 |
end |
| 20599 |
do |
| 20600 |
return readSigned(43, c_PRIME, strm_PRIME) |
| 20601 |
end |
| 20602 |
end |
| 20603 |
::else15:: |
| 20604 |
local tmp57 = toString(c_PRIME) |
| 20605 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp57, expected = "digit or 'inf' or 'nan'"}}}, "parse_toml.sml:19:5") |
| 20606 |
end |
| 20607 |
end |
| 20608 |
::else9:: |
| 20609 |
if c == 45 then |
| 20610 |
else |
| 20611 |
goto else10 |
| 20612 |
end |
| 20613 |
do |
| 20614 |
local exp |
| 20615 |
do |
| 20616 |
local strm1 = strm[1] |
| 20617 |
exp = tmp55(strm1, strm[2]) |
| 20618 |
end |
| 20619 |
if exp.tag == "NONE" then |
| 20620 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = "end of input", expected = "digit or 'inf' or 'nan'"}}}, "parse_toml.sml:16:5") |
| 20621 |
end |
| 20622 |
if exp.tag == "SOME" and exp.payload[1] == 105 then |
| 20623 |
else |
| 20624 |
goto else13 |
| 20625 |
end |
| 20626 |
do |
| 20627 |
local strm_PRIME = exp.payload[2] |
| 20628 |
local tmp57 = _L[188]("-inf") |
| 20629 |
local tmp58 |
| 20630 |
do |
| 20631 |
local strm1 = strm_PRIME[1] |
| 20632 |
tmp58 = expect(110, strm1, strm_PRIME[2]) |
| 20633 |
end |
| 20634 |
local tmp59 |
| 20635 |
do |
| 20636 |
local strm1 = tmp58[1] |
| 20637 |
tmp59 = expect(102, strm1, tmp58[2]) |
| 20638 |
end |
| 20639 |
return {tmp57, tmp59} |
| 20640 |
end |
| 20641 |
::else13:: |
| 20642 |
if exp.tag == "SOME" and exp.payload[1] == 110 then |
| 20643 |
else |
| 20644 |
goto else14 |
| 20645 |
end |
| 20646 |
do |
| 20647 |
local strm_PRIME = exp.payload[2] |
| 20648 |
local tmp57 = _L[188]("-nan") |
| 20649 |
local tmp58 |
| 20650 |
do |
| 20651 |
local strm1 = strm_PRIME[1] |
| 20652 |
tmp58 = expect(97, strm1, strm_PRIME[2]) |
| 20653 |
end |
| 20654 |
local tmp59 |
| 20655 |
do |
| 20656 |
local strm1 = tmp58[1] |
| 20657 |
tmp59 = expect(110, strm1, tmp58[2]) |
| 20658 |
end |
| 20659 |
return {tmp57, tmp59} |
| 20660 |
end |
| 20661 |
::else14:: |
| 20662 |
if exp.tag == "SOME" then |
| 20663 |
else |
| 20664 |
_raise(_Match, "parse_toml.sml:857:18") |
| 20665 |
end |
| 20666 |
do |
| 20667 |
local c_PRIME |
| 20668 |
do |
| 20669 |
c_PRIME = exp.payload[1] |
| 20670 |
local strm_PRIME = exp.payload[2] |
| 20671 |
if 48 <= c_PRIME and c_PRIME <= 57 then |
| 20672 |
else |
| 20673 |
goto else15 |
| 20674 |
end |
| 20675 |
do |
| 20676 |
return readSigned(45, c_PRIME, strm_PRIME) |
| 20677 |
end |
| 20678 |
end |
| 20679 |
::else15:: |
| 20680 |
local tmp57 = toString(c_PRIME) |
| 20681 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp57, expected = "digit or 'inf' or 'nan'"}}}, "parse_toml.sml:19:5") |
| 20682 |
end |
| 20683 |
end |
| 20684 |
::else10:: |
| 20685 |
if c == 48 then |
| 20686 |
else |
| 20687 |
goto else11 |
| 20688 |
end |
| 20689 |
do |
| 20690 |
local exp |
| 20691 |
do |
| 20692 |
local strm1 = strm[1] |
| 20693 |
exp = tmp55(strm1, strm[2]) |
| 20694 |
end |
| 20695 |
if exp.tag == "NONE" then |
| 20696 |
else |
| 20697 |
goto else13 |
| 20698 |
end |
| 20699 |
do |
| 20700 |
local tmp57 = _L[22](0) |
| 20701 |
return {{tag = "INTEGER", payload = tmp57}, strm} |
| 20702 |
end |
| 20703 |
::else13:: |
| 20704 |
if exp.tag == "SOME" and exp.payload[1] == 120 then |
| 20705 |
else |
| 20706 |
goto else14 |
| 20707 |
end |
| 20708 |
do |
| 20709 |
local strm_PRIME = exp.payload[2] |
| 20710 |
local tmp57 = _L[22](0) |
| 20711 |
local exp1 |
| 20712 |
do |
| 20713 |
local strm1 = strm_PRIME[1] |
| 20714 |
exp1 = readHexInt(tmp57, strm1, strm_PRIME[2]) |
| 20715 |
end |
| 20716 |
local x = exp1[1] |
| 20717 |
local strm_PRIME_PRIME = exp1[2] |
| 20718 |
return {{tag = "INTEGER", payload = x}, strm_PRIME_PRIME} |
| 20719 |
end |
| 20720 |
::else14:: |
| 20721 |
if exp.tag == "SOME" and exp.payload[1] == 111 then |
| 20722 |
else |
| 20723 |
goto else15 |
| 20724 |
end |
| 20725 |
do |
| 20726 |
local strm_PRIME = exp.payload[2] |
| 20727 |
local tmp57 = _L[22](0) |
| 20728 |
local exp1 |
| 20729 |
do |
| 20730 |
local strm1 = strm_PRIME[1] |
| 20731 |
exp1 = readOctInt(tmp57, strm1, strm_PRIME[2]) |
| 20732 |
end |
| 20733 |
local x = exp1[1] |
| 20734 |
local strm_PRIME_PRIME = exp1[2] |
| 20735 |
return {{tag = "INTEGER", payload = x}, strm_PRIME_PRIME} |
| 20736 |
end |
| 20737 |
::else15:: |
| 20738 |
if exp.tag == "SOME" and exp.payload[1] == 98 then |
| 20739 |
else |
| 20740 |
if exp.tag == "SOME" then |
| 20741 |
else |
| 20742 |
_raise(_Match, "parse_toml.sml:869:18") |
| 20743 |
end |
| 20744 |
do |
| 20745 |
return readUnsigned(48, strm) |
| 20746 |
end |
| 20747 |
end |
| 20748 |
do |
| 20749 |
local strm_PRIME = exp.payload[2] |
| 20750 |
local tmp57 = _L[22](0) |
| 20751 |
local exp1 |
| 20752 |
do |
| 20753 |
local strm1 = strm_PRIME[1] |
| 20754 |
exp1 = readBinInt(tmp57, strm1, strm_PRIME[2]) |
| 20755 |
end |
| 20756 |
local x = exp1[1] |
| 20757 |
local strm_PRIME_PRIME = exp1[2] |
| 20758 |
return {{tag = "INTEGER", payload = x}, strm_PRIME_PRIME} |
| 20759 |
end |
| 20760 |
end |
| 20761 |
::else11:: |
| 20762 |
if 48 <= c and c <= 57 then |
| 20763 |
else |
| 20764 |
goto else12 |
| 20765 |
end |
| 20766 |
do |
| 20767 |
return readUnsigned(c, strm) |
| 20768 |
end |
| 20769 |
::else12:: |
| 20770 |
local tmp57 = toString(c) |
| 20771 |
_raise({tag = _L[186], payload = {tag = "UNEXPECTED", payload = {encountered = tmp57, expected = "value"}}}, "parse_toml.sml:19:5") |
| 20772 |
end |
| 20773 |
end |
| 20774 |
insertKeyval = function(revPath, pt, tmp56, keys, v) |
| 20775 |
if tmp56 == nil then |
| 20776 |
else |
| 20777 |
goto else1 |
| 20778 |
end |
| 20779 |
do |
| 20780 |
return insert(revPath, pt, keys, v) |
| 20781 |
end |
| 20782 |
::else1:: |
| 20783 |
if tmp56 ~= nil then |
| 20784 |
else |
| 20785 |
_raise(_Match, "parse_toml.sml:972:11") |
| 20786 |
end |
| 20787 |
do |
| 20788 |
local tmp57 = tmp56[1] |
| 20789 |
local tmp58 = tmp56[2] |
| 20790 |
local tmp59, tmp60 = nil, pt |
| 20791 |
::cont:: |
| 20792 |
do |
| 20793 |
local accum, tmp61 = tmp59, tmp60 |
| 20794 |
if tmp61 == nil then |
| 20795 |
else |
| 20796 |
goto else2 |
| 20797 |
end |
| 20798 |
do |
| 20799 |
local tmp62 = insertKeyval({tmp57, revPath}, nil, tmp58, keys, v) |
| 20800 |
return revAppend(accum, {{tmp57, {tag = "PARTIAL_TABLE", payload = {IMPLICIT_HEADER, tmp62}}}, nil}) |
| 20801 |
end |
| 20802 |
::else2:: |
| 20803 |
if tmp61 ~= nil then |
| 20804 |
else |
| 20805 |
_raise(_Match, "parse_toml.sml:976:19") |
| 20806 |
end |
| 20807 |
do |
| 20808 |
local tmp62 = tmp61[1] |
| 20809 |
local key = tmp61[1][1] |
| 20810 |
local pv = tmp61[1][2] |
| 20811 |
local tmp63 = tmp61[2] |
| 20812 |
if tmp57 == key then |
| 20813 |
else |
| 20814 |
tmp59 = {tmp62, accum} |
| 20815 |
tmp60 = tmp63 |
| 20816 |
goto cont |
| 20817 |
end |
| 20818 |
do |
| 20819 |
local updated |
| 20820 |
do |
| 20821 |
if pv.tag == "LEAF" then |
| 20822 |
else |
| 20823 |
goto else3 |
| 20824 |
end |
| 20825 |
do |
| 20826 |
local tmp64 = revAppend(revPath, {key, nil}) |
| 20827 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp64}}, "parse_toml.sml:22:5") |
| 20828 |
end |
| 20829 |
::else3:: |
| 20830 |
if pv.tag == "PARTIAL_TABLE" then |
| 20831 |
else |
| 20832 |
goto else4 |
| 20833 |
end |
| 20834 |
do |
| 20835 |
local definedBy = pv.payload[1] |
| 20836 |
local pt_PRIME = pv.payload[2] |
| 20837 |
local tmp64 = insertKeyval({tmp57, revPath}, pt_PRIME, tmp58, keys, v) |
| 20838 |
updated = {tag = "PARTIAL_TABLE", payload = {definedBy, tmp64}} |
| 20839 |
goto cont1 |
| 20840 |
end |
| 20841 |
::else4:: |
| 20842 |
if pv.tag == "PARTIAL_ARRAY" then |
| 20843 |
else |
| 20844 |
_raise(_Match, "parse_toml.sml:988:27") |
| 20845 |
end |
| 20846 |
do |
| 20847 |
local last = pv.payload[1] |
| 20848 |
local rest = pv.payload[2] |
| 20849 |
local tmp64 = insertKeyval({tmp57, revPath}, last, tmp58, keys, v) |
| 20850 |
updated = {tag = "PARTIAL_ARRAY", payload = {tmp64, rest}} |
| 20851 |
end |
| 20852 |
end |
| 20853 |
::cont1:: |
| 20854 |
return revAppend(accum, {{key, updated}, tmp63}) |
| 20855 |
end |
| 20856 |
end |
| 20857 |
end |
| 20858 |
end |
| 20859 |
end |
| 20860 |
insertTable = function(revPath, pt, tmp56) |
| 20861 |
if tmp56 ~= nil and tmp56[2] == nil then |
| 20862 |
else |
| 20863 |
goto else1 |
| 20864 |
end |
| 20865 |
do |
| 20866 |
local tmp57 = tmp56[1] |
| 20867 |
local tmp58, tmp59 = nil, pt |
| 20868 |
::cont:: |
| 20869 |
do |
| 20870 |
local accum, tmp60 = tmp58, tmp59 |
| 20871 |
if tmp60 == nil then |
| 20872 |
else |
| 20873 |
goto else2 |
| 20874 |
end |
| 20875 |
do |
| 20876 |
return revAppend(accum, {{tmp57, {tag = "PARTIAL_TABLE", payload = {EXACT_HEADER, nil}}}, nil}) |
| 20877 |
end |
| 20878 |
::else2:: |
| 20879 |
if tmp60 ~= nil then |
| 20880 |
else |
| 20881 |
_raise(_Match, "parse_toml.sml:1010:19") |
| 20882 |
end |
| 20883 |
do |
| 20884 |
local tmp61 = tmp60[1] |
| 20885 |
local key_PRIME = tmp60[1][1] |
| 20886 |
local pv = tmp60[1][2] |
| 20887 |
local tmp62 = tmp60[2] |
| 20888 |
if tmp57 == key_PRIME then |
| 20889 |
else |
| 20890 |
tmp58 = {tmp61, accum} |
| 20891 |
tmp59 = tmp62 |
| 20892 |
goto cont |
| 20893 |
end |
| 20894 |
do |
| 20895 |
if pv.tag == "LEAF" then |
| 20896 |
else |
| 20897 |
goto else3 |
| 20898 |
end |
| 20899 |
do |
| 20900 |
local tmp63 = revAppend(revPath, {tmp57, nil}) |
| 20901 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp63}}, "parse_toml.sml:22:5") |
| 20902 |
end |
| 20903 |
::else3:: |
| 20904 |
if pv.tag == "PARTIAL_TABLE" and pv.payload[1] == "IMPLICIT_HEADER" then |
| 20905 |
else |
| 20906 |
goto else4 |
| 20907 |
end |
| 20908 |
do |
| 20909 |
return revAppend(accum, {{key_PRIME, {tag = "PARTIAL_TABLE", payload = {EXACT_HEADER, pv.payload[2]}}}, tmp62}) |
| 20910 |
end |
| 20911 |
::else4:: |
| 20912 |
if pv.tag == "PARTIAL_TABLE" then |
| 20913 |
else |
| 20914 |
goto else5 |
| 20915 |
end |
| 20916 |
do |
| 20917 |
local tmp63 = revAppend(revPath, {tmp57, nil}) |
| 20918 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp63}}, "parse_toml.sml:22:5") |
| 20919 |
end |
| 20920 |
::else5:: |
| 20921 |
if pv.tag == "PARTIAL_ARRAY" then |
| 20922 |
else |
| 20923 |
_raise(_Match, "parse_toml.sml:1017:23") |
| 20924 |
end |
| 20925 |
do |
| 20926 |
local tmp63 = revAppend(revPath, {tmp57, nil}) |
| 20927 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp63}}, "parse_toml.sml:22:5") |
| 20928 |
end |
| 20929 |
end |
| 20930 |
end |
| 20931 |
end |
| 20932 |
end |
| 20933 |
::else1:: |
| 20934 |
if tmp56 ~= nil then |
| 20935 |
elseif tmp56 == nil then |
| 20936 |
_raise(_Match, "parse_toml.sml:1069:36") |
| 20937 |
else |
| 20938 |
_raise(_Match, "parse_toml.sml:1008:11") |
| 20939 |
end |
| 20940 |
do |
| 20941 |
local tmp57 = tmp56[1] |
| 20942 |
local tmp58 = tmp56[2] |
| 20943 |
local tmp59, tmp60 = nil, pt |
| 20944 |
::cont:: |
| 20945 |
do |
| 20946 |
local accum, tmp61 = tmp59, tmp60 |
| 20947 |
if tmp61 == nil then |
| 20948 |
else |
| 20949 |
goto else2 |
| 20950 |
end |
| 20951 |
do |
| 20952 |
local tmp62 = insertTable({tmp57, revPath}, nil, tmp58) |
| 20953 |
return revAppend(accum, {{tmp57, {tag = "PARTIAL_TABLE", payload = {IMPLICIT_HEADER, tmp62}}}, nil}) |
| 20954 |
end |
| 20955 |
::else2:: |
| 20956 |
if tmp61 ~= nil then |
| 20957 |
else |
| 20958 |
_raise(_Match, "parse_toml.sml:1036:19") |
| 20959 |
end |
| 20960 |
do |
| 20961 |
local tmp62 = tmp61[1] |
| 20962 |
local key_PRIME = tmp61[1][1] |
| 20963 |
local pv = tmp61[1][2] |
| 20964 |
local tmp63 = tmp61[2] |
| 20965 |
if tmp57 == key_PRIME then |
| 20966 |
else |
| 20967 |
tmp59 = {tmp62, accum} |
| 20968 |
tmp60 = tmp63 |
| 20969 |
goto cont |
| 20970 |
end |
| 20971 |
do |
| 20972 |
local updated |
| 20973 |
do |
| 20974 |
if pv.tag == "LEAF" then |
| 20975 |
else |
| 20976 |
goto else3 |
| 20977 |
end |
| 20978 |
do |
| 20979 |
local tmp64 = revAppend(revPath, {tmp57, nil}) |
| 20980 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp64}}, "parse_toml.sml:22:5") |
| 20981 |
end |
| 20982 |
::else3:: |
| 20983 |
if pv.tag == "PARTIAL_TABLE" then |
| 20984 |
else |
| 20985 |
goto else4 |
| 20986 |
end |
| 20987 |
do |
| 20988 |
local definedBy = pv.payload[1] |
| 20989 |
local pt_PRIME = pv.payload[2] |
| 20990 |
local tmp64 = insertTable({tmp57, revPath}, pt_PRIME, tmp58) |
| 20991 |
updated = {tag = "PARTIAL_TABLE", payload = {definedBy, tmp64}} |
| 20992 |
goto cont1 |
| 20993 |
end |
| 20994 |
::else4:: |
| 20995 |
if pv.tag == "PARTIAL_ARRAY" then |
| 20996 |
else |
| 20997 |
_raise(_Match, "parse_toml.sml:1050:27") |
| 20998 |
end |
| 20999 |
do |
| 21000 |
local last = pv.payload[1] |
| 21001 |
local rest = pv.payload[2] |
| 21002 |
local tmp64 = insertTable({tmp57, revPath}, last, tmp58) |
| 21003 |
updated = {tag = "PARTIAL_ARRAY", payload = {tmp64, rest}} |
| 21004 |
end |
| 21005 |
end |
| 21006 |
::cont1:: |
| 21007 |
return revAppend(accum, {{key_PRIME, updated}, tmp63}) |
| 21008 |
end |
| 21009 |
end |
| 21010 |
end |
| 21011 |
end |
| 21012 |
end |
| 21013 |
end |
| 21014 |
local table |
| 21015 |
do |
| 21016 |
local function insertArrayTable(revPath, pt, tmp56) |
| 21017 |
if tmp56 ~= nil and tmp56[2] == nil then |
| 21018 |
else |
| 21019 |
goto else1 |
| 21020 |
end |
| 21021 |
do |
| 21022 |
local tmp57 = tmp56[1] |
| 21023 |
local tmp58, tmp59 = nil, pt |
| 21024 |
::cont:: |
| 21025 |
do |
| 21026 |
local accum, tmp60 = tmp58, tmp59 |
| 21027 |
if tmp60 == nil then |
| 21028 |
else |
| 21029 |
goto else2 |
| 21030 |
end |
| 21031 |
do |
| 21032 |
return revAppend(accum, {{tmp57, {tag = "PARTIAL_ARRAY", payload = {nil, nil}}}, nil}) |
| 21033 |
end |
| 21034 |
::else2:: |
| 21035 |
if tmp60 ~= nil then |
| 21036 |
else |
| 21037 |
_raise(_Match, "parse_toml.sml:1072:19") |
| 21038 |
end |
| 21039 |
do |
| 21040 |
local tmp61 = tmp60[1] |
| 21041 |
local key_PRIME = tmp60[1][1] |
| 21042 |
local pv = tmp60[1][2] |
| 21043 |
local tmp62 = tmp60[2] |
| 21044 |
if tmp57 == key_PRIME then |
| 21045 |
else |
| 21046 |
tmp58 = {tmp61, accum} |
| 21047 |
tmp59 = tmp62 |
| 21048 |
goto cont |
| 21049 |
end |
| 21050 |
do |
| 21051 |
if pv.tag == "LEAF" then |
| 21052 |
else |
| 21053 |
goto else3 |
| 21054 |
end |
| 21055 |
do |
| 21056 |
local tmp63 = revAppend(revPath, {tmp57, nil}) |
| 21057 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp63}}, "parse_toml.sml:22:5") |
| 21058 |
end |
| 21059 |
::else3:: |
| 21060 |
if pv.tag == "PARTIAL_TABLE" then |
| 21061 |
else |
| 21062 |
if pv.tag == "PARTIAL_ARRAY" then |
| 21063 |
else |
| 21064 |
_raise(_Match, "parse_toml.sml:1079:23") |
| 21065 |
end |
| 21066 |
do |
| 21067 |
local last = pv.payload[1] |
| 21068 |
return revAppend(accum, {{tmp57, {tag = "PARTIAL_ARRAY", payload = {nil, {last, pv.payload[2]}}}}, tmp62}) |
| 21069 |
end |
| 21070 |
end |
| 21071 |
do |
| 21072 |
local tmp63 = revAppend(revPath, {tmp57, nil}) |
| 21073 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp63}}, "parse_toml.sml:22:5") |
| 21074 |
end |
| 21075 |
end |
| 21076 |
end |
| 21077 |
end |
| 21078 |
end |
| 21079 |
::else1:: |
| 21080 |
if tmp56 ~= nil then |
| 21081 |
elseif tmp56 == nil then |
| 21082 |
_raise(_Match, "parse_toml.sml:1130:41") |
| 21083 |
else |
| 21084 |
_raise(_Match, "parse_toml.sml:1070:11") |
| 21085 |
end |
| 21086 |
do |
| 21087 |
local tmp57 = tmp56[1] |
| 21088 |
local tmp58 = tmp56[2] |
| 21089 |
local tmp59, tmp60 = nil, pt |
| 21090 |
::cont:: |
| 21091 |
do |
| 21092 |
local accum, tmp61 = tmp59, tmp60 |
| 21093 |
if tmp61 == nil then |
| 21094 |
else |
| 21095 |
goto else2 |
| 21096 |
end |
| 21097 |
do |
| 21098 |
local tmp62 = insertArrayTable({tmp57, revPath}, nil, tmp58) |
| 21099 |
return revAppend(accum, {{tmp57, {tag = "PARTIAL_TABLE", payload = {IMPLICIT_HEADER, tmp62}}}, nil}) |
| 21100 |
end |
| 21101 |
::else2:: |
| 21102 |
if tmp61 ~= nil then |
| 21103 |
else |
| 21104 |
_raise(_Match, "parse_toml.sml:1095:19") |
| 21105 |
end |
| 21106 |
do |
| 21107 |
local tmp62 = tmp61[1] |
| 21108 |
local key_PRIME = tmp61[1][1] |
| 21109 |
local pv = tmp61[1][2] |
| 21110 |
local tmp63 = tmp61[2] |
| 21111 |
if tmp57 == key_PRIME then |
| 21112 |
else |
| 21113 |
tmp59 = {tmp62, accum} |
| 21114 |
tmp60 = tmp63 |
| 21115 |
goto cont |
| 21116 |
end |
| 21117 |
do |
| 21118 |
local updated |
| 21119 |
do |
| 21120 |
if pv.tag == "LEAF" then |
| 21121 |
else |
| 21122 |
goto else3 |
| 21123 |
end |
| 21124 |
do |
| 21125 |
local tmp64 = revAppend(revPath, {tmp57, nil}) |
| 21126 |
_raise({tag = _L[186], payload = {tag = "DUPLICATE_KEY", payload = tmp64}}, "parse_toml.sml:22:5") |
| 21127 |
end |
| 21128 |
::else3:: |
| 21129 |
if pv.tag == "PARTIAL_TABLE" then |
| 21130 |
else |
| 21131 |
goto else4 |
| 21132 |
end |
| 21133 |
do |
| 21134 |
local definedBy = pv.payload[1] |
| 21135 |
local pt_PRIME = pv.payload[2] |
| 21136 |
local tmp64 = insertArrayTable({tmp57, revPath}, pt_PRIME, tmp58) |
| 21137 |
updated = {tag = "PARTIAL_TABLE", payload = {definedBy, tmp64}} |
| 21138 |
goto cont1 |
| 21139 |
end |
| 21140 |
::else4:: |
| 21141 |
if pv.tag == "PARTIAL_ARRAY" then |
| 21142 |
else |
| 21143 |
_raise(_Match, "parse_toml.sml:1109:27") |
| 21144 |
end |
| 21145 |
do |
| 21146 |
local last = pv.payload[1] |
| 21147 |
local rest = pv.payload[2] |
| 21148 |
local tmp64 = insertArrayTable({tmp57, revPath}, last, tmp58) |
| 21149 |
updated = {tag = "PARTIAL_ARRAY", payload = {tmp64, rest}} |
| 21150 |
end |
| 21151 |
end |
| 21152 |
::cont1:: |
| 21153 |
return revAppend(accum, {{tmp57, updated}, tmp63}) |
| 21154 |
end |
| 21155 |
end |
| 21156 |
end |
| 21157 |
end |
| 21158 |
end |
| 21159 |
do |
| 21160 |
local tmp56, tmp57, tmp58, tmp59, tmp60 = nil, nil, nil, tmp54, _L[173] |
| 21161 |
::cont1:: |
| 21162 |
do |
| 21163 |
local prefix, revPath, accum, exp |
| 21164 |
do |
| 21165 |
local strm, state |
| 21166 |
accum, revPath, prefix, strm, state = tmp56, tmp57, tmp58, tmp59, tmp60 |
| 21167 |
do |
| 21168 |
local tmp61, tmp62, tmp63 = revPath, strm, state |
| 21169 |
::cont3:: |
| 21170 |
do |
| 21171 |
local revPath1, exp1 |
| 21172 |
do |
| 21173 |
local strm1, state1 |
| 21174 |
revPath1, strm1, state1 = tmp61, tmp62, tmp63 |
| 21175 |
exp1 = skipWhiteSpaceAndGetc(strm1, state1) |
| 21176 |
if exp1.tag == "NONE" then |
| 21177 |
exp = NONE |
| 21178 |
goto cont2 |
| 21179 |
end |
| 21180 |
if exp1.tag == "SOME" and exp1.payload[1] == 10 then |
| 21181 |
local strm_PRIME = exp1.payload[2] |
| 21182 |
local strm2 = strm_PRIME[1] |
| 21183 |
tmp61 = revPath1 |
| 21184 |
tmp62 = strm2 |
| 21185 |
tmp63 = strm_PRIME[2] |
| 21186 |
goto cont3 |
| 21187 |
end |
| 21188 |
if exp1.tag == "SOME" and exp1.payload[1] == 13 then |
| 21189 |
else |
| 21190 |
goto else4 |
| 21191 |
end |
| 21192 |
do |
| 21193 |
local strm_PRIME = exp1.payload[2] |
| 21194 |
local tmp64 |
| 21195 |
do |
| 21196 |
local strm2 = strm_PRIME[1] |
| 21197 |
tmp64 = expect(10, strm2, strm_PRIME[2]) |
| 21198 |
end |
| 21199 |
local strm2 = tmp64[1] |
| 21200 |
tmp61 = revPath1 |
| 21201 |
tmp62 = strm2 |
| 21202 |
tmp63 = tmp64[2] |
| 21203 |
goto cont3 |
| 21204 |
end |
| 21205 |
end |
| 21206 |
::else4:: |
| 21207 |
if exp1.tag == "SOME" and exp1.payload[1] == 35 then |
| 21208 |
else |
| 21209 |
goto else5 |
| 21210 |
end |
| 21211 |
do |
| 21212 |
local tmp64 = skipUntilNewline(exp1.payload[2]) |
| 21213 |
local strm1 = tmp64[1] |
| 21214 |
tmp61 = revPath1 |
| 21215 |
tmp62 = strm1 |
| 21216 |
tmp63 = tmp64[2] |
| 21217 |
goto cont3 |
| 21218 |
end |
| 21219 |
::else5:: |
| 21220 |
if exp1.tag == "SOME" and exp1.payload[1] == 91 then |
| 21221 |
else |
| 21222 |
goto else6 |
| 21223 |
end |
| 21224 |
do |
| 21225 |
local strm_PRIME |
| 21226 |
do |
| 21227 |
strm_PRIME = exp1.payload[2] |
| 21228 |
local exp2 |
| 21229 |
do |
| 21230 |
local strm1 = strm_PRIME[1] |
| 21231 |
exp2 = tmp55(strm1, strm_PRIME[2]) |
| 21232 |
end |
| 21233 |
if exp2.tag == "SOME" and exp2.payload[1] == 91 then |
| 21234 |
else |
| 21235 |
goto else7 |
| 21236 |
end |
| 21237 |
do |
| 21238 |
local strm_PRIME_PRIME = exp2.payload[2] |
| 21239 |
local tmp64 |
| 21240 |
do |
| 21241 |
local strm1 = strm_PRIME_PRIME[1] |
| 21242 |
tmp64 = skipWhiteSpaceAndGetc(strm1, strm_PRIME_PRIME[2]) |
| 21243 |
end |
| 21244 |
local exp3 = readKey(tmp64) |
| 21245 |
local key = exp3[1] |
| 21246 |
local strm_PRIME_PRIME_PRIME = exp3[2] |
| 21247 |
local tmp65 |
| 21248 |
do |
| 21249 |
local strm1 = strm_PRIME_PRIME_PRIME[1] |
| 21250 |
tmp65 = expect(93, strm1, strm_PRIME_PRIME_PRIME[2]) |
| 21251 |
end |
| 21252 |
local strm_PRIME_PRIME_PRIME_PRIME |
| 21253 |
do |
| 21254 |
local strm1 = tmp65[1] |
| 21255 |
strm_PRIME_PRIME_PRIME_PRIME = expect(93, strm1, tmp65[2]) |
| 21256 |
end |
| 21257 |
local tmp66 = {tag = "ARRAY_TABLE", payload = key} |
| 21258 |
local tmp67 = skipWhiteSpaceOrComment(strm_PRIME_PRIME_PRIME_PRIME) |
| 21259 |
exp = {tag = "SOME", payload = {tmp66, tmp67}} |
| 21260 |
goto cont2 |
| 21261 |
end |
| 21262 |
end |
| 21263 |
::else7:: |
| 21264 |
local tmp64 |
| 21265 |
do |
| 21266 |
local strm1 = strm_PRIME[1] |
| 21267 |
tmp64 = skipWhiteSpaceAndGetc(strm1, strm_PRIME[2]) |
| 21268 |
end |
| 21269 |
local exp2 = readKey(tmp64) |
| 21270 |
local key = exp2[1] |
| 21271 |
local strm_PRIME_PRIME = exp2[2] |
| 21272 |
local strm_PRIME_PRIME_PRIME |
| 21273 |
do |
| 21274 |
local strm1 = strm_PRIME_PRIME[1] |
| 21275 |
strm_PRIME_PRIME_PRIME = expect(93, strm1, strm_PRIME_PRIME[2]) |
| 21276 |
end |
| 21277 |
local tmp65 = {tag = "STD_TABLE", payload = key} |
| 21278 |
local tmp66 = skipWhiteSpaceOrComment(strm_PRIME_PRIME_PRIME) |
| 21279 |
exp = {tag = "SOME", payload = {tmp65, tmp66}} |
| 21280 |
goto cont2 |
| 21281 |
end |
| 21282 |
::else6:: |
| 21283 |
local exp2 = readKeyval(revPath1, exp1) |
| 21284 |
local key = exp2[1] |
| 21285 |
local v = exp2[2] |
| 21286 |
local strm_PRIME = exp2[3] |
| 21287 |
local tmp64 = {tag = "KEYVAL", payload = {key, v}} |
| 21288 |
local tmp65 = skipWhiteSpaceOrComment(strm_PRIME) |
| 21289 |
exp = {tag = "SOME", payload = {tmp64, tmp65}} |
| 21290 |
end |
| 21291 |
end |
| 21292 |
end |
| 21293 |
::cont2:: |
| 21294 |
if exp.tag == "NONE" then |
| 21295 |
else |
| 21296 |
goto else1 |
| 21297 |
end |
| 21298 |
table = finalizeTable(accum) |
| 21299 |
goto cont |
| 21300 |
::else1:: |
| 21301 |
if exp.tag == "SOME" and exp.payload[1].tag == "ARRAY_TABLE" then |
| 21302 |
else |
| 21303 |
goto else2 |
| 21304 |
end |
| 21305 |
do |
| 21306 |
local key = exp.payload[1].payload |
| 21307 |
local strm_PRIME = exp.payload[2] |
| 21308 |
local tmp61 = insertArrayTable(nil, accum, key) |
| 21309 |
local tmp62 = revAppend(key, nil) |
| 21310 |
local tmp63 = {"[]", tmp62} |
| 21311 |
local strm = strm_PRIME[1] |
| 21312 |
tmp56 = tmp61 |
| 21313 |
tmp57 = tmp63 |
| 21314 |
tmp58 = key |
| 21315 |
tmp59 = strm |
| 21316 |
tmp60 = strm_PRIME[2] |
| 21317 |
goto cont1 |
| 21318 |
end |
| 21319 |
::else2:: |
| 21320 |
if exp.tag == "SOME" and exp.payload[1].tag == "STD_TABLE" then |
| 21321 |
else |
| 21322 |
goto else3 |
| 21323 |
end |
| 21324 |
do |
| 21325 |
local key = exp.payload[1].payload |
| 21326 |
local strm_PRIME = exp.payload[2] |
| 21327 |
local tmp61 = insertTable(nil, accum, key) |
| 21328 |
local tmp62 = revAppend(key, nil) |
| 21329 |
local strm = strm_PRIME[1] |
| 21330 |
tmp56 = tmp61 |
| 21331 |
tmp57 = tmp62 |
| 21332 |
tmp58 = key |
| 21333 |
tmp59 = strm |
| 21334 |
tmp60 = strm_PRIME[2] |
| 21335 |
goto cont1 |
| 21336 |
end |
| 21337 |
::else3:: |
| 21338 |
if exp.tag == "SOME" and exp.payload[1].tag == "KEYVAL" then |
| 21339 |
else |
| 21340 |
_raise(_Match, "parse_toml.sml:1132:9") |
| 21341 |
end |
| 21342 |
do |
| 21343 |
local key = exp.payload[1].payload[1] |
| 21344 |
local v = exp.payload[1].payload[2] |
| 21345 |
local strm_PRIME = exp.payload[2] |
| 21346 |
local tmp61 = insertKeyval(nil, accum, prefix, key, v) |
| 21347 |
local strm = strm_PRIME[1] |
| 21348 |
tmp56 = tmp61 |
| 21349 |
tmp57 = revPath |
| 21350 |
tmp58 = prefix |
| 21351 |
tmp59 = strm |
| 21352 |
tmp60 = strm_PRIME[2] |
| 21353 |
goto cont1 |
| 21354 |
end |
| 21355 |
end |
| 21356 |
end |
| 21357 |
end |
| 21358 |
::cont:: |
| 21359 |
local tmp56, color, tmp57, tmp58, tmp59, tmp60 |
| 21360 |
do |
| 21361 |
local tmp61 = _L[364](table, "temporary-directory") |
| 21362 |
tmp56 = _L[366](tmp61, function(a) |
| 21363 |
if a.tag == "STRING" then |
| 21364 |
return {tag = "SOME", payload = a.payload} |
| 21365 |
end |
| 21366 |
_L[302]("Config entry temporary-directory should be a string.") |
| 21367 |
return NONE |
| 21368 |
end) |
| 21369 |
local tmp62 = _L[364](table, "color") |
| 21370 |
color = _L[366](tmp62, function(a) |
| 21371 |
if a.tag == "TABLE" then |
| 21372 |
return {tag = "SOME", payload = a.payload} |
| 21373 |
end |
| 21374 |
_L[302]("Config entry color should be a table.") |
| 21375 |
return NONE |
| 21376 |
end) |
| 21377 |
local tmp63 = _L[365](color, "type") |
| 21378 |
local tmp64 = _L[369]("color.type") |
| 21379 |
tmp57 = _L[366](tmp63, tmp64) |
| 21380 |
local tmp65 = _L[365](color, "execute") |
| 21381 |
local tmp66 = _L[369]("color.execute") |
| 21382 |
tmp58 = _L[366](tmp65, tmp66) |
| 21383 |
local tmp67 = _L[365](color, "error") |
| 21384 |
local tmp68 = _L[369]("color.error") |
| 21385 |
tmp59 = _L[366](tmp67, tmp68) |
| 21386 |
local tmp69 = _L[365](color, "warning") |
| 21387 |
local tmp70 = _L[369]("color.warning") |
| 21388 |
tmp60 = _L[366](tmp69, tmp70) |
| 21389 |
end |
| 21390 |
local tmp61 = _L[365](color, "diagnostic") |
| 21391 |
local tmp62 = _L[369]("color.diagnostic") |
| 21392 |
local tmp63 = _L[366](tmp61, tmp62) |
| 21393 |
local tmp64 = _L[365](color, "information") |
| 21394 |
local tmp65 = _L[369]("color.information") |
| 21395 |
local tmp66 = _L[366](tmp64, tmp65) |
| 21396 |
return {color = {diagnostic = tmp63, error = tmp59, execute = tmp58, information = tmp66, type_ = tmp57, warning = tmp60}, temporary_directory = tmp56} |
| 21397 |
end) |
| 21398 |
if not _L[552] then |
| 21399 |
if __exn_instanceof(_L[553], _L[9]) then |
| 21400 |
_L[541] = _L[363] |
| 21401 |
goto cont6 |
| 21402 |
end |
| 21403 |
if __exn_instanceof(_L[553], _L[171]) then |
| 21404 |
else |
| 21405 |
goto else2 |
| 21406 |
end |
| 21407 |
_L[301]("Config file " .. _L[551] .. " is not UTF-8 encoded.") |
| 21408 |
_L[541] = _L[363] |
| 21409 |
goto cont6 |
| 21410 |
::else2:: |
| 21411 |
if __exn_instanceof(_L[553], _L[186]) then |
| 21412 |
else |
| 21413 |
_raise(_L[553], nil) |
| 21414 |
end |
| 21415 |
do |
| 21416 |
_L[554] = _L[553].payload |
| 21417 |
_L[555] = "Config file " .. _L[551] .. " is not a valid TOML file: " |
| 21418 |
do |
| 21419 |
if _L[554].tag == "UNEXPECTED" then |
| 21420 |
_L[557] = _L[554].payload.encountered |
| 21421 |
_L[558] = _L[554].payload.expected |
| 21422 |
_L[556] = "unexpected " .. _L[557] .. ", expected " .. _L[558] |
| 21423 |
goto cont19 |
| 21424 |
end |
| 21425 |
if _L[554].tag == "PREFIX_ZERO" then |
| 21426 |
_L[556] = "prefix 0 is disallowed" |
| 21427 |
goto cont19 |
| 21428 |
end |
| 21429 |
if _L[554].tag == "INVALID_UNICODE_SCALAR" then |
| 21430 |
_L[556] = "invalid Unicode scalar" |
| 21431 |
goto cont19 |
| 21432 |
end |
| 21433 |
if _L[554].tag == "INVALID_DATE" then |
| 21434 |
_L[556] = "invalid date" |
| 21435 |
goto cont19 |
| 21436 |
end |
| 21437 |
if _L[554].tag == "INVALID_TIME" then |
| 21438 |
_L[556] = "invalid time" |
| 21439 |
goto cont19 |
| 21440 |
end |
| 21441 |
if _L[554].tag == "DUPLICATE_KEY" then |
| 21442 |
else |
| 21443 |
_raise(_Match, "error.sml:24:9") |
| 21444 |
end |
| 21445 |
do |
| 21446 |
_L[559] = _L[554].payload |
| 21447 |
_L[560] = map(_L[185]) |
| 21448 |
_L[561] = _L[560](_L[559]) |
| 21449 |
_L[556] = "duplicate key at " .. table_concat(_VectorOrArray_fromList(_L[561]), ".") |
| 21450 |
end |
| 21451 |
end |
| 21452 |
::cont19:: |
| 21453 |
_L[301](_L[555] .. _L[556]) |
| 21454 |
_L[541] = _L[363] |
| 21455 |
end |
| 21456 |
else |
| 21457 |
_L[541] = _L[553] |
| 21458 |
end |
| 21459 |
end |
| 21460 |
end |
| 21461 |
::cont6:: |
| 21462 |
_L[562] = app(_L[294]) |
| 21463 |
_L[562](_L[541].color.type_) |
| 21464 |
_L[563] = app(_L[295]) |
| 21465 |
_L[563](_L[541].color.execute) |
| 21466 |
_L[564] = app(_L[296]) |
| 21467 |
_L[564](_L[541].color.error) |
| 21468 |
_L[565] = app(_L[297]) |
| 21469 |
_L[565](_L[541].color.warning) |
| 21470 |
_L[566] = app(_L[298]) |
| 21471 |
_L[566](_L[541].color.diagnostic) |
| 21472 |
_L[567] = app(_L[299]) |
| 21473 |
_L[567](_L[541].color.information) |
| 21474 |
_L[568] = _L[538].watch |
| 21475 |
do |
| 21476 |
if _L[538].color.tag == "NONE" then |
| 21477 |
else |
| 21478 |
goto cont7 |
| 21479 |
end |
| 21480 |
_L[280](_L[277]) |
| 21481 |
end |
| 21482 |
::cont7:: |
| 21483 |
do |
| 21484 |
if _L[539] == nil then |
| 21485 |
else |
| 21486 |
goto else2 |
| 21487 |
end |
| 21488 |
_L[569] = _L[373]() |
| 21489 |
goto cont8 |
| 21490 |
::else2:: |
| 21491 |
if _L[539] ~= nil and _L[539][2] == nil then |
| 21492 |
_L[569] = _L[539][1] |
| 21493 |
goto cont8 |
| 21494 |
end |
| 21495 |
_L[301]("Multiple input files are not supported.") |
| 21496 |
tmp15(1, true) |
| 21497 |
end |
| 21498 |
::cont8:: |
| 21499 |
_L[570] = _L[538].engine |
| 21500 |
do |
| 21501 |
if _L[570].tag == "SOME" then |
| 21502 |
else |
| 21503 |
goto else2 |
| 21504 |
end |
| 21505 |
do |
| 21506 |
_L[577] = _L[570].payload |
| 21507 |
_L[578] = _L[254](_L[577]) |
| 21508 |
if _L[578].tag == "SOME" then |
| 21509 |
_L[579] = _L[578].payload |
| 21510 |
_L[580] = _L[579].dvi_extension |
| 21511 |
_L[581] = _L[579].engine_type |
| 21512 |
_L[582] = _L[579].executable |
| 21513 |
_L[583] = _L[579].name |
| 21514 |
_L[584] = _L[579].supports_draftmode |
| 21515 |
_L[576] = _L[579].supports_pdf_generation |
| 21516 |
_L[575] = _L[584] |
| 21517 |
_L[574] = _L[583] |
| 21518 |
_L[573] = _L[582] |
| 21519 |
_L[572] = _L[581] |
| 21520 |
_L[571] = _L[580] |
| 21521 |
goto cont9 |
| 21522 |
end |
| 21523 |
if _L[578].tag == "NONE" then |
| 21524 |
else |
| 21525 |
_raise(_Match, "main.sml:793:50") |
| 21526 |
end |
| 21527 |
_L[301]("Unknown engine name '" .. _L[577] .. "'.") |
| 21528 |
tmp15(1, true) |
| 21529 |
end |
| 21530 |
::else2:: |
| 21531 |
if _L[570].tag == "NONE" then |
| 21532 |
else |
| 21533 |
_raise(_Match, "main.sml:792:32") |
| 21534 |
end |
| 21535 |
do |
| 21536 |
do |
| 21537 |
_L[586] = _L[154][0] |
| 21538 |
if _L[586] == nil then |
| 21539 |
else |
| 21540 |
_L[585] = _L[586] |
| 21541 |
goto cont18 |
| 21542 |
end |
| 21543 |
do |
| 21544 |
_L[587] = _Fail("CommandLine.name: arg is not available") |
| 21545 |
_raise(_L[587], "command-line.sml:10:45") |
| 21546 |
end |
| 21547 |
end |
| 21548 |
::cont18:: |
| 21549 |
_L[588] = _L[211](_L[585]) |
| 21550 |
_L[589] = _L[213](_L[588]) |
| 21551 |
_L[590] = isPrefix("cl") |
| 21552 |
_L[591] = _L[590](_L[589]) |
| 21553 |
do |
| 21554 |
if _L[591] then |
| 21555 |
else |
| 21556 |
_L[592] = false |
| 21557 |
goto cont19 |
| 21558 |
end |
| 21559 |
do |
| 21560 |
_L[593] = tmp32(isAlphaNum) |
| 21561 |
_L[592] = _L[593](_L[589]) |
| 21562 |
end |
| 21563 |
end |
| 21564 |
::cont19:: |
| 21565 |
if _L[592] then |
| 21566 |
else |
| 21567 |
goto else3 |
| 21568 |
end |
| 21569 |
do |
| 21570 |
_L[594] = extract(_L[589], 2, NONE) |
| 21571 |
_L[595] = _L[254](_L[594]) |
| 21572 |
if _L[595].tag == "NONE" then |
| 21573 |
elseif _L[595].tag == "SOME" then |
| 21574 |
_L[596] = _L[595].payload |
| 21575 |
_L[597] = _L[596].dvi_extension |
| 21576 |
_L[598] = _L[596].engine_type |
| 21577 |
_L[599] = _L[596].executable |
| 21578 |
_L[600] = _L[596].name |
| 21579 |
_L[601] = _L[596].supports_draftmode |
| 21580 |
_L[576] = _L[596].supports_pdf_generation |
| 21581 |
_L[575] = _L[601] |
| 21582 |
_L[574] = _L[600] |
| 21583 |
_L[573] = _L[599] |
| 21584 |
_L[572] = _L[598] |
| 21585 |
_L[571] = _L[597] |
| 21586 |
goto cont9 |
| 21587 |
else |
| 21588 |
_raise(_Match, "main.sml:806:51") |
| 21589 |
end |
| 21590 |
_L[301]("Engine not specified.") |
| 21591 |
tmp15(1, true) |
| 21592 |
end |
| 21593 |
::else3:: |
| 21594 |
_L[301]("Engine not specified.") |
| 21595 |
tmp15(1, true) |
| 21596 |
end |
| 21597 |
end |
| 21598 |
::cont9:: |
| 21599 |
_L[602] = getOpt(_L[538].output_format, _L[230]) |
| 21600 |
do |
| 21601 |
if _L[602] == "PDF" then |
| 21602 |
else |
| 21603 |
goto else2 |
| 21604 |
end |
| 21605 |
do |
| 21606 |
_L[604] = _L[538].check_driver |
| 21607 |
do |
| 21608 |
if _L[604].tag == "NONE" then |
| 21609 |
goto cont18 |
| 21610 |
end |
| 21611 |
if _L[604].tag == "SOME" then |
| 21612 |
else |
| 21613 |
_raise(_Match, "main.sml:815:44") |
| 21614 |
end |
| 21615 |
_L[301]("--check-driver can only be used when the output format is DVI.") |
| 21616 |
tmp15(1, true) |
| 21617 |
end |
| 21618 |
::cont18:: |
| 21619 |
if _L[576] then |
| 21620 |
else |
| 21621 |
_L[603] = {tag = "SOME", payload = _L[305]} |
| 21622 |
goto cont10 |
| 21623 |
end |
| 21624 |
do |
| 21625 |
_L[605] = _L[237](_L[572], _L[235]) |
| 21626 |
if _L[605] then |
| 21627 |
_L[603] = {tag = "SOME", payload = _L[310]} |
| 21628 |
goto cont10 |
| 21629 |
end |
| 21630 |
_L[606] = _L[237](_L[572], _L[234]) |
| 21631 |
if _L[606] then |
| 21632 |
_L[603] = {tag = "SOME", payload = _L[309]} |
| 21633 |
goto cont10 |
| 21634 |
end |
| 21635 |
_L[607] = _L[237](_L[572], _L[233]) |
| 21636 |
if _L[607] then |
| 21637 |
_L[603] = {tag = "SOME", payload = _L[308]} |
| 21638 |
goto cont10 |
| 21639 |
end |
| 21640 |
_L[302]("Unknown engine: " .. _L[574]) |
| 21641 |
_L[302]("Driver check will not work.") |
| 21642 |
_L[603] = NONE |
| 21643 |
goto cont10 |
| 21644 |
end |
| 21645 |
end |
| 21646 |
::else2:: |
| 21647 |
if _L[602] == "DVI" then |
| 21648 |
_L[608] = _L[538].check_driver |
| 21649 |
if _L[608].tag == "SOME" and _L[608].payload == "DVIPDFMX" then |
| 21650 |
_L[603] = {tag = "SOME", payload = _L[305]} |
| 21651 |
elseif _L[608].tag == "SOME" and _L[608].payload == "DVIPS" then |
| 21652 |
_L[603] = {tag = "SOME", payload = _L[306]} |
| 21653 |
elseif _L[608].tag == "SOME" and _L[608].payload == "DVISVGM" then |
| 21654 |
_L[603] = {tag = "SOME", payload = _L[307]} |
| 21655 |
elseif _L[608].tag == "NONE" then |
| 21656 |
_L[603] = NONE |
| 21657 |
else |
| 21658 |
_raise(_Match, "main.sml:837:42") |
| 21659 |
end |
| 21660 |
else |
| 21661 |
_raise(_Match, "main.sml:813:38") |
| 21662 |
end |
| 21663 |
end |
| 21664 |
::cont10:: |
| 21665 |
_L[609] = _L[538].jobname |
| 21666 |
do |
| 21667 |
if _L[609].tag == "SOME" then |
| 21668 |
_L[612] = _L[609].payload |
| 21669 |
_L[611] = _L[612] |
| 21670 |
_L[610] = _L[612] |
| 21671 |
goto cont11 |
| 21672 |
end |
| 21673 |
if _L[609].tag == "NONE" then |
| 21674 |
else |
| 21675 |
_raise(_Match, "main.sml:842:55") |
| 21676 |
end |
| 21677 |
do |
| 21678 |
_L[613] = _L[213](_L[569]) |
| 21679 |
_L[614] = _L[211](_L[613]) |
| 21680 |
_L[611] = _L[614] |
| 21681 |
_L[610] = tmp21(_L[614], ".", function(a) |
| 21682 |
local tmp54 = tmp19(a) |
| 21683 |
if tmp54 == 32 then |
| 21684 |
return "_" |
| 21685 |
end |
| 21686 |
local tmp55 = isSpace(tmp54) |
| 21687 |
local tmp56 |
| 21688 |
tmp56 = tmp55 or (tmp54 == 34 or (tmp54 == 36 or (tmp54 == 37 or (tmp54 == 38 or (tmp54 == 39 or (tmp54 == 40 or (tmp54 == 41 or (tmp54 == 59 or (tmp54 == 60 or (tmp54 == 62 or (tmp54 == 92 or (tmp54 == 94 or (tmp54 == 96 or tmp54 == 124))))))))))))) |
| 21689 |
if tmp56 then |
| 21690 |
local tmp57 = tmp54 |
| 21691 |
local s |
| 21692 |
if tmp57 >= 0 then |
| 21693 |
s = string_format("%X", tmp57) |
| 21694 |
else |
| 21695 |
s = string_format("~%X", - tmp57) |
| 21696 |
end |
| 21697 |
if tmp57 <= 15 then |
| 21698 |
return "_0" .. s |
| 21699 |
else |
| 21700 |
return "_" .. s |
| 21701 |
end |
| 21702 |
else |
| 21703 |
return string_char(tmp54) |
| 21704 |
end |
| 21705 |
end) |
| 21706 |
end |
| 21707 |
end |
| 21708 |
::cont11:: |
| 21709 |
if _L[602] == "DVI" then |
| 21710 |
_L[615] = _L[571] |
| 21711 |
elseif _L[602] == "PDF" then |
| 21712 |
_L[615] = "pdf" |
| 21713 |
else |
| 21714 |
_raise(_Match, "main.sml:847:42") |
| 21715 |
end |
| 21716 |
_L[616] = _L[538].output |
| 21717 |
if _L[616].tag == "NONE" then |
| 21718 |
_L[617] = _L[611] .. "." .. _L[615] |
| 21719 |
elseif _L[616].tag == "SOME" then |
| 21720 |
_L[617] = _L[616].payload |
| 21721 |
else |
| 21722 |
_raise(_Match, "main.sml:850:49") |
| 21723 |
end |
| 21724 |
_L[618] = _L[538].output_directory |
| 21725 |
do |
| 21726 |
if _L[618].tag == "SOME" then |
| 21727 |
else |
| 21728 |
goto else2 |
| 21729 |
end |
| 21730 |
do |
| 21731 |
_L[620] = _L[618].payload |
| 21732 |
if _L[538].fresh then |
| 21733 |
else |
| 21734 |
_L[619] = _L[620] |
| 21735 |
goto cont12 |
| 21736 |
end |
| 21737 |
_L[301]("--fresh and --output-directory cannot be used together.") |
| 21738 |
tmp15(1, true) |
| 21739 |
end |
| 21740 |
::else2:: |
| 21741 |
if _L[618].tag == "NONE" then |
| 21742 |
else |
| 21743 |
_raise(_Match, "main.sml:854:25") |
| 21744 |
end |
| 21745 |
do |
| 21746 |
_L[621] = _L[215](NONE, _L[569]) |
| 21747 |
_L[622] = _L[541].temporary_directory |
| 21748 |
_L[623] = getOpt(_L[538].engine_executable, _L[573]) |
| 21749 |
do |
| 21750 |
do |
| 21751 |
_L[626] = _L[191](table_concat({n = 3, _L[621], _L[610], _L[623]}, "\x00")) |
| 21752 |
_L[627] = _L[626][1] |
| 21753 |
_L[628] = _L[626][2] |
| 21754 |
_L[629] = _L[626][3] |
| 21755 |
_L[625] = _L[193](_L[627], _L[628], _L[629], _L[626][4]) |
| 21756 |
end |
| 21757 |
do |
| 21758 |
if _L[622].tag == "SOME" then |
| 21759 |
_L[630] = _L[622].payload |
| 21760 |
goto cont18 |
| 21761 |
end |
| 21762 |
if _L[622].tag == "NONE" then |
| 21763 |
else |
| 21764 |
_raise(_Match, "main.sml:34:24") |
| 21765 |
end |
| 21766 |
do |
| 21767 |
_L[631] = _L[372]({"TMPDIR", {"TMP", {"TEMP", nil}}}) |
| 21768 |
if _L[631].tag == "SOME" then |
| 21769 |
_L[630] = _L[631].payload |
| 21770 |
goto cont18 |
| 21771 |
end |
| 21772 |
if _L[631].tag == "NONE" then |
| 21773 |
else |
| 21774 |
_raise(_Match, "main.sml:36:36") |
| 21775 |
end |
| 21776 |
do |
| 21777 |
_L[632] = _L[372]({"HOME", {"USERPROFILE", nil}}) |
| 21778 |
if _L[632].tag == "SOME" then |
| 21779 |
else |
| 21780 |
goto else4 |
| 21781 |
end |
| 21782 |
_L[630] = _L[77]({dir = _L[632].payload, file = ".latex-build-temp"}) |
| 21783 |
goto cont18 |
| 21784 |
::else4:: |
| 21785 |
if _L[632].tag == "NONE" then |
| 21786 |
else |
| 21787 |
_raise(_Match, "main.sml:38:48") |
| 21788 |
end |
| 21789 |
do |
| 21790 |
_L[633] = _Fail("environment variable 'TMPDIR' not set!") |
| 21791 |
_raise(_L[633], "main.sml:40:60") |
| 21792 |
end |
| 21793 |
end |
| 21794 |
end |
| 21795 |
end |
| 21796 |
::cont18:: |
| 21797 |
_L[624] = _L[77]({dir = _L[630], file = "cluttex-" .. _L[625]}) |
| 21798 |
end |
| 21799 |
_L[634] = _L[219](_L[624]) |
| 21800 |
if not _L[634] then |
| 21801 |
else |
| 21802 |
goto else3 |
| 21803 |
end |
| 21804 |
do |
| 21805 |
_L[635], _L[636] = _L[217].mkdir_rec(_L[624]) |
| 21806 |
if not _L[635] then |
| 21807 |
else |
| 21808 |
_L[619] = _L[624] |
| 21809 |
goto cont12 |
| 21810 |
end |
| 21811 |
do |
| 21812 |
_L[637] = _Error(_L[636]) |
| 21813 |
_raise(_L[637], "fs-util.sml:16:28") |
| 21814 |
end |
| 21815 |
end |
| 21816 |
::else3:: |
| 21817 |
if _L[538].fresh then |
| 21818 |
else |
| 21819 |
_L[619] = _L[624] |
| 21820 |
goto cont12 |
| 21821 |
end |
| 21822 |
do |
| 21823 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 21824 |
else |
| 21825 |
goto else4 |
| 21826 |
end |
| 21827 |
do |
| 21828 |
_L[304]("Cleaning '" .. _L[624] .. "'...") |
| 21829 |
_L[638], _L[639] = _L[217].remove_rec(_L[624]) |
| 21830 |
if not _L[638] then |
| 21831 |
else |
| 21832 |
goto else6 |
| 21833 |
end |
| 21834 |
do |
| 21835 |
_L[640] = _Error(_L[639]) |
| 21836 |
_raise(_L[640], "fs-util.sml:22:29") |
| 21837 |
end |
| 21838 |
::else6:: |
| 21839 |
_L[65](_L[624]) |
| 21840 |
_L[619] = _L[624] |
| 21841 |
goto cont12 |
| 21842 |
end |
| 21843 |
::else4:: |
| 21844 |
_L[641], _L[642] = _L[217].remove_rec(_L[624]) |
| 21845 |
if not _L[641] then |
| 21846 |
else |
| 21847 |
goto else5 |
| 21848 |
end |
| 21849 |
do |
| 21850 |
_L[643] = _Error(_L[642]) |
| 21851 |
_raise(_L[643], "fs-util.sml:22:29") |
| 21852 |
end |
| 21853 |
::else5:: |
| 21854 |
_L[65](_L[624]) |
| 21855 |
_L[619] = _L[624] |
| 21856 |
end |
| 21857 |
end |
| 21858 |
end |
| 21859 |
::cont12:: |
| 21860 |
do |
| 21861 |
if _L[538].print_output_directory then |
| 21862 |
else |
| 21863 |
goto cont13 |
| 21864 |
end |
| 21865 |
do |
| 21866 |
_L[644] = _L[619] .. "\n" |
| 21867 |
_L[645] = _L[113].getOutstream(_L[116]) |
| 21868 |
if _L[645].tag == "LUA_WRITABLE" then |
| 21869 |
else |
| 21870 |
goto else2 |
| 21871 |
end |
| 21872 |
do |
| 21873 |
_L[646] = _L[645].payload.writable |
| 21874 |
_L[101](_L[646], _L[645].payload.name, _L[644]) |
| 21875 |
_L[646]:flush() |
| 21876 |
tmp15(0, true) |
| 21877 |
end |
| 21878 |
::else2:: |
| 21879 |
if _L[645].tag == "PRIM_WRITER" then |
| 21880 |
else |
| 21881 |
_raise(_Match, "text-io.sml:392:9") |
| 21882 |
end |
| 21883 |
do |
| 21884 |
_L[647] = _L[645].payload.writer.name |
| 21885 |
_L[648] = _L[645].payload.writer.writeVec |
| 21886 |
_L[649] = _L[645].payload.buffer |
| 21887 |
_L[650] = revAppend({_L[644], _L[649][1]}, nil) |
| 21888 |
_L[651] = table_concat(_VectorOrArray_fromList(_L[650])) |
| 21889 |
if _L[648].tag == "SOME" then |
| 21890 |
elseif _L[648].tag == "NONE" then |
| 21891 |
_raise({tag = _L[9], payload = {cause = _L[10], ["function"] = "output", name = _L[647]}}, "text-io.sml:397:26") |
| 21892 |
else |
| 21893 |
_raise(_Match, "text-io.sml:395:14") |
| 21894 |
end |
| 21895 |
do |
| 21896 |
_L[652] = _L[648].payload |
| 21897 |
_L[653] = tmp28(_L[651]) |
| 21898 |
_L[652](_L[653]) |
| 21899 |
_L[649][1] = nil |
| 21900 |
tmp15(0, true) |
| 21901 |
end |
| 21902 |
end |
| 21903 |
end |
| 21904 |
end |
| 21905 |
::cont13:: |
| 21906 |
if _L[220] then |
| 21907 |
_L[654] = ";" |
| 21908 |
else |
| 21909 |
_L[654] = ":" |
| 21910 |
end |
| 21911 |
_L[655] = _L[64](nil) |
| 21912 |
_L[656] = getOpt(_L[538].change_directory, false) |
| 21913 |
do |
| 21914 |
if _L[656] then |
| 21915 |
else |
| 21916 |
_L[659] = {tag = "SOME", payload = _L[619]} |
| 21917 |
_L[658] = _L[619] |
| 21918 |
_L[657] = _L[617] |
| 21919 |
goto cont14 |
| 21920 |
end |
| 21921 |
do |
| 21922 |
do |
| 21923 |
_L[661] = tmp16("TEXINPUTS") |
| 21924 |
if _L[661] == nil then |
| 21925 |
_L[660] = NONE |
| 21926 |
else |
| 21927 |
_L[660] = {tag = "SOME", payload = _L[661]} |
| 21928 |
end |
| 21929 |
end |
| 21930 |
_L[662] = getOpt(_L[660], "") |
| 21931 |
do |
| 21932 |
_L[664] = tmp16("LUAINPUTS") |
| 21933 |
if _L[664] == nil then |
| 21934 |
_L[663] = NONE |
| 21935 |
else |
| 21936 |
_L[663] = {tag = "SOME", payload = _L[664]} |
| 21937 |
end |
| 21938 |
end |
| 21939 |
_L[665] = getOpt(_L[663], "") |
| 21940 |
_L[63](_L[619]) |
| 21941 |
_L[221]("TEXINPUTS", _L[655] .. _L[654] .. _L[662]) |
| 21942 |
_L[221]("LUAINPUTS", _L[655] .. _L[654] .. _L[665]) |
| 21943 |
_L[666] = _L[215]({tag = "SOME", payload = _L[655]}, _L[617]) |
| 21944 |
_L[659] = NONE |
| 21945 |
_L[658] = "." |
| 21946 |
_L[657] = _L[666] |
| 21947 |
end |
| 21948 |
end |
| 21949 |
::cont14:: |
| 21950 |
_L[667] = _L[538].bibtex_or_biber |
| 21951 |
do |
| 21952 |
if _L[667].tag == "SOME" then |
| 21953 |
elseif _L[667].tag == "NONE" then |
| 21954 |
_L[668] = _L[657] |
| 21955 |
goto cont15 |
| 21956 |
else |
| 21957 |
_raise(_Match, "main.sml:902:32") |
| 21958 |
end |
| 21959 |
do |
| 21960 |
do |
| 21961 |
_L[670] = tmp16("BIBINPUTS") |
| 21962 |
if _L[670] == nil then |
| 21963 |
_L[669] = NONE |
| 21964 |
else |
| 21965 |
_L[669] = {tag = "SOME", payload = _L[670]} |
| 21966 |
end |
| 21967 |
end |
| 21968 |
_L[671] = getOpt(_L[669], "") |
| 21969 |
_L[221]("BIBINPUTS", _L[655] .. _L[654] .. _L[671]) |
| 21970 |
_L[668] = _L[215]({tag = "SOME", payload = _L[655]}, _L[617]) |
| 21971 |
end |
| 21972 |
end |
| 21973 |
::cont15:: |
| 21974 |
do |
| 21975 |
_L[673] = tmp16("max_print_line") |
| 21976 |
if _L[673] == nil then |
| 21977 |
_L[672] = NONE |
| 21978 |
else |
| 21979 |
_L[672] = {tag = "SOME", payload = _L[673]} |
| 21980 |
end |
| 21981 |
end |
| 21982 |
if _L[672].tag == "NONE" then |
| 21983 |
_L[221]("max_print_line", "16384") |
| 21984 |
elseif _L[672].tag == "SOME" then |
| 21985 |
else |
| 21986 |
_raise(_Match, "main.sml:919:28") |
| 21987 |
end |
| 21988 |
_L[674] = _L[610] .. "." .. "fls" |
| 21989 |
_L[675] = _L[210].join(_L[658], _L[674]) |
| 21990 |
_L[676] = _L[610] .. "." .. "cluttex-fls" |
| 21991 |
_L[677] = _L[210].join(_L[658], _L[676]) |
| 21992 |
if _L[602] == "DVI" then |
| 21993 |
_L[678] = _L[231] |
| 21994 |
goto cont16 |
| 21995 |
end |
| 21996 |
if _L[602] == "PDF" then |
| 21997 |
if _L[576] then |
| 21998 |
_L[678] = _L[230] |
| 21999 |
else |
| 22000 |
_L[678] = _L[231] |
| 22001 |
end |
| 22002 |
else |
| 22003 |
_raise(_Match, "main.sml:928:43") |
| 22004 |
end |
| 22005 |
::cont16:: |
| 22006 |
_L[679] = _L[237](_L[572], _L[235]) |
| 22007 |
if _L[679] then |
| 22008 |
_L[681] = _L[610] .. "." .. "cluttexinit.lua" |
| 22009 |
_L[682] = _L[210].join(_L[658], _L[681]) |
| 22010 |
_L[683] = _L[538].file_line_error |
| 22011 |
_L[684] = {file_line_error = _L[683], halt_on_error = _L[538].halt_on_error, jobname = _L[610], output_directory = _L[658]} |
| 22012 |
_L[354].create_initialization_script(_L[682], _L[684]) |
| 22013 |
_L[680] = {tag = "SOME", payload = _L[682]} |
| 22014 |
else |
| 22015 |
_L[680] = NONE |
| 22016 |
end |
| 22017 |
_L[685] = _L[538].source_date_epoch |
| 22018 |
_L[686] = _L[685].tag == "SOME" and _L[685].payload.tag == "RAW" |
| 22019 |
do |
| 22020 |
if _L[686] then |
| 22021 |
_L[221]("SOURCE_DATE_EPOCH", _L[685].payload.payload) |
| 22022 |
_L[687] = NONE |
| 22023 |
goto cont17 |
| 22024 |
end |
| 22025 |
_L[688] = tmp(_L[348]) |
| 22026 |
_L[689] = _L[538].source_date_epoch |
| 22027 |
_L[690] = _L[688]({_L[689], {tag = "SOME", payload = _L[347]}}) |
| 22028 |
do |
| 22029 |
if _L[690] then |
| 22030 |
_L[691] = true |
| 22031 |
goto cont18 |
| 22032 |
end |
| 22033 |
_L[692] = tmp(eq) |
| 22034 |
_L[693] = tmp16("SOURCE_DATE_EPOCH") |
| 22035 |
if _L[693] == nil then |
| 22036 |
else |
| 22037 |
_L[691] = _L[692]({{tag = "SOME", payload = _L[693]}, NONE}) |
| 22038 |
goto cont18 |
| 22039 |
end |
| 22040 |
_L[691] = _L[692]({NONE, NONE}) |
| 22041 |
end |
| 22042 |
::cont18:: |
| 22043 |
if _L[691] then |
| 22044 |
else |
| 22045 |
_L[687] = NONE |
| 22046 |
goto cont17 |
| 22047 |
end |
| 22048 |
do |
| 22049 |
_L[694] = tmp5(tmp18()) |
| 22050 |
_L[695] = _L[53](tmp18()) |
| 22051 |
_L[687] = {tag = "SOME", payload = {{time = _L[695], time_since_epoch = _L[694]}}} |
| 22052 |
end |
| 22053 |
end |
| 22054 |
::cont17:: |
| 22055 |
_L[696] = _L[538].engine_executable |
| 22056 |
_L[697] = getOpt(_L[538].interaction, _L[223]) |
| 22057 |
_L[698] = {tag = "SOME", payload = _L[697]} |
| 22058 |
_L[699] = _L[538].file_line_error |
| 22059 |
_L[700] = _L[538].halt_on_error |
| 22060 |
_L[701] = _L[538].synctex |
| 22061 |
_L[702] = _L[538].shell_escape |
| 22062 |
_L[703] = {tag = "SOME", payload = _L[610]} |
| 22063 |
_L[704] = _L[538].fmt |
| 22064 |
_L[705] = _L[538].tex_extraoptions |
| 22065 |
_L[706] = getOpt(_L[538].max_iterations, 4) |
| 22066 |
_L[707] = _L[538].start_with_draft |
| 22067 |
getOpt(_L[538].change_directory, false) |
| 22068 |
_L[708] = _L[538].includeonly |
| 22069 |
_L[709] = _L[538].make_depends |
| 22070 |
_L[710] = _L[538].package_support |
| 22071 |
_L[711] = _L[538].source_date_epoch |
| 22072 |
_L[712] = _L[538].synctex |
| 22073 |
getOpt(_L[538].interaction, _L[223]) |
| 22074 |
_L[713] = _L[538].shell_escape |
| 22075 |
_L[714] = _L[538].dvipdfmx_extraoptions |
| 22076 |
_L[715] = _L[538].makeindex |
| 22077 |
_L[716] = _L[538].bibtex_or_biber |
| 22078 |
_L[717] = _L[538].makeglossaries |
| 22079 |
if _L[568].tag == "NONE" then |
| 22080 |
else |
| 22081 |
goto else1 |
| 22082 |
end |
| 22083 |
do |
| 22084 |
_L[718], _L[719] = _handle(function() |
| 22085 |
local tmp54 = _L[710].epstopdf |
| 22086 |
local tmp55 = _L[710].minted |
| 22087 |
return _L[529](_L[572], _L[573], _L[575], _L[576], _L[569], _L[716], _L[603], _L[714], _L[708], _L[610], _L[709], _L[717], _L[715], _L[706], _L[668], _L[658], _L[602], tmp54, tmp55, _L[710].pdfx, _L[713], _L[711], _L[707], _L[712], _L[655], _L[615], _L[675], _L[677], _L[687], false, _L[696], _L[705], _L[699], _L[704], _L[700], _L[698], _L[703], _L[680], _L[659], _L[678], _L[702], _L[701]) |
| 22088 |
end) |
| 22089 |
if not _L[718] then |
| 22090 |
if __exn_instanceof(_L[719], _L[370]) then |
| 22091 |
tmp15(1, true) |
| 22092 |
else |
| 22093 |
_raise(_L[719], nil) |
| 22094 |
end |
| 22095 |
else |
| 22096 |
goto cont4 |
| 22097 |
end |
| 22098 |
end |
| 22099 |
::else1:: |
| 22100 |
if _L[568].tag == "SOME" then |
| 22101 |
else |
| 22102 |
_raise(_Match, "main.sml:1009:18") |
| 22103 |
end |
| 22104 |
do |
| 22105 |
_L[720] = _L[568].payload |
| 22106 |
do |
| 22107 |
if _L[220] then |
| 22108 |
else |
| 22109 |
_L[721] = NONE |
| 22110 |
goto cont18 |
| 22111 |
end |
| 22112 |
do |
| 22113 |
_L[722], _L[723] = pcall(tmp3, "texrunner.fswatcher_windows") |
| 22114 |
if not _L[722] then |
| 22115 |
else |
| 22116 |
_L[721] = {tag = "SOME", payload = _L[723]} |
| 22117 |
goto cont18 |
| 22118 |
end |
| 22119 |
do |
| 22120 |
if _ENV.CLUTTEX_VERBOSITY >= 1 then |
| 22121 |
else |
| 22122 |
_L[721] = NONE |
| 22123 |
goto cont18 |
| 22124 |
end |
| 22125 |
_L[302]("Failed to load texrunner.fswatcher_windows: " .. _L[723]) |
| 22126 |
_L[721] = NONE |
| 22127 |
end |
| 22128 |
end |
| 22129 |
end |
| 22130 |
::cont18:: |
| 22131 |
do |
| 22132 |
if _L[721].tag == "SOME" then |
| 22133 |
else |
| 22134 |
goto else2 |
| 22135 |
end |
| 22136 |
do |
| 22137 |
_L[725] = _L[721].payload |
| 22138 |
if _ENV.CLUTTEX_VERBOSITY >= 2 then |
| 22139 |
else |
| 22140 |
_L[724] = function(a) |
| 22141 |
return _L[530](_L[725], a) |
| 22142 |
end |
| 22143 |
goto cont19 |
| 22144 |
end |
| 22145 |
_L[304]("Using built-in filesystem watcher for Windows") |
| 22146 |
_L[724] = function(a) |
| 22147 |
return _L[530](_L[725], a) |
| 22148 |
end |
| 22149 |
goto cont19 |
| 22150 |
end |
| 22151 |
::else2:: |
| 22152 |
if _L[721].tag == "NONE" then |
| 22153 |
else |
| 22154 |
_raise(_Match, "main.sml:689:25") |
| 22155 |
end |
| 22156 |
do |
| 22157 |
_L[726] = _L[209]("fswatch") |
| 22158 |
do |
| 22159 |
if _L[726] then |
| 22160 |
else |
| 22161 |
_L[727] = false |
| 22162 |
goto cont23 |
| 22163 |
end |
| 22164 |
do |
| 22165 |
_L[728] = _L[346](_L[720], _L[345]) |
| 22166 |
if _L[728] then |
| 22167 |
_L[727] = true |
| 22168 |
else |
| 22169 |
_L[727] = _L[346](_L[720], _L[345]) |
| 22170 |
end |
| 22171 |
end |
| 22172 |
end |
| 22173 |
::cont23:: |
| 22174 |
if _L[727] then |
| 22175 |
else |
| 22176 |
goto else3 |
| 22177 |
end |
| 22178 |
do |
| 22179 |
if _ENV.CLUTTEX_VERBOSITY >= 2 then |
| 22180 |
else |
| 22181 |
_L[724] = _L[531] |
| 22182 |
goto cont19 |
| 22183 |
end |
| 22184 |
_L[304]("Using `fswatch' command") |
| 22185 |
_L[724] = _L[531] |
| 22186 |
goto cont19 |
| 22187 |
end |
| 22188 |
::else3:: |
| 22189 |
_L[729] = _L[209]("inotifywait") |
| 22190 |
do |
| 22191 |
if _L[729] then |
| 22192 |
else |
| 22193 |
_L[730] = false |
| 22194 |
goto cont24 |
| 22195 |
end |
| 22196 |
do |
| 22197 |
_L[731] = _L[346](_L[720], _L[345]) |
| 22198 |
if _L[731] then |
| 22199 |
_L[730] = true |
| 22200 |
else |
| 22201 |
_L[730] = _L[346](_L[720], _L[344]) |
| 22202 |
end |
| 22203 |
end |
| 22204 |
end |
| 22205 |
::cont24:: |
| 22206 |
if _L[730] then |
| 22207 |
else |
| 22208 |
goto else4 |
| 22209 |
end |
| 22210 |
do |
| 22211 |
if _ENV.CLUTTEX_VERBOSITY >= 2 then |
| 22212 |
else |
| 22213 |
_L[724] = _L[532] |
| 22214 |
goto cont19 |
| 22215 |
end |
| 22216 |
_L[304]("Using `inotifywait' command") |
| 22217 |
_L[724] = _L[532] |
| 22218 |
goto cont19 |
| 22219 |
end |
| 22220 |
::else4:: |
| 22221 |
if _L[720] == "AUTO" then |
| 22222 |
else |
| 22223 |
goto else5 |
| 22224 |
end |
| 22225 |
_L[301]("Could not watch files because neither `fswatch' nor `inotifywait' was installed.") |
| 22226 |
_L[304]("See ClutTeX's manual for details.") |
| 22227 |
tmp15(1, true) |
| 22228 |
::else5:: |
| 22229 |
if _L[720] == "FSWATCH" then |
| 22230 |
else |
| 22231 |
goto else6 |
| 22232 |
end |
| 22233 |
_L[301]("Could not watch files because your selected engine `fswatch' was not installed.") |
| 22234 |
_L[304]("See ClutTeX's manual for details.") |
| 22235 |
tmp15(1, true) |
| 22236 |
::else6:: |
| 22237 |
if _L[720] == "INOTIFYWAIT" then |
| 22238 |
else |
| 22239 |
_raise(_Match, "main.sml:712:43") |
| 22240 |
end |
| 22241 |
_L[301]("Could not watch files because your selected engine `inotifywait' was not installed.") |
| 22242 |
_L[304]("See ClutTeX's manual for details.") |
| 22243 |
tmp15(1, true) |
| 22244 |
end |
| 22245 |
end |
| 22246 |
::cont19:: |
| 22247 |
do |
| 22248 |
_L[732], _L[733] = _handle(function() |
| 22249 |
do |
| 22250 |
local tmp54 = _L[710].epstopdf |
| 22251 |
local tmp55 = _L[710].minted |
| 22252 |
_L[529](_L[572], _L[573], _L[575], _L[576], _L[569], _L[716], _L[603], _L[714], _L[708], _L[610], _L[709], _L[717], _L[715], _L[706], _L[668], _L[658], _L[602], tmp54, tmp55, _L[710].pdfx, _L[713], _L[711], _L[707], _L[712], _L[655], _L[615], _L[675], _L[677], _L[687], false, _L[696], _L[705], _L[699], _L[704], _L[700], _L[698], _L[703], _L[680], _L[659], _L[678], _L[702], _L[701]) |
| 22253 |
end |
| 22254 |
return nil |
| 22255 |
end) |
| 22256 |
if not _L[732] then |
| 22257 |
if __exn_instanceof(_L[733], _L[370]) then |
| 22258 |
else |
| 22259 |
_raise(_L[733], nil) |
| 22260 |
end |
| 22261 |
end |
| 22262 |
end |
| 22263 |
_L[734] = _L[360](_L[675], _L[715], nil, _L[203]) |
| 22264 |
_L[735] = _L[237](_L[572], _L[235]) |
| 22265 |
do |
| 22266 |
if _L[735] then |
| 22267 |
else |
| 22268 |
_L[736] = false |
| 22269 |
goto cont20 |
| 22270 |
end |
| 22271 |
_L[736] = _L[218](_L[677]) |
| 22272 |
end |
| 22273 |
::cont20:: |
| 22274 |
do |
| 22275 |
if _L[736] then |
| 22276 |
else |
| 22277 |
_L[737] = _L[734] |
| 22278 |
goto cont21 |
| 22279 |
end |
| 22280 |
do |
| 22281 |
_L[738] = _L[734][1] |
| 22282 |
_L[737] = _L[360](_L[677], _L[715], _L[738], _L[734][2]) |
| 22283 |
end |
| 22284 |
end |
| 22285 |
::cont21:: |
| 22286 |
do |
| 22287 |
_L[740] = _L[737][1] |
| 22288 |
_L[739] = _L[359](_L[740], _L[737][2]) |
| 22289 |
end |
| 22290 |
_L[741] = _L[739][1] |
| 22291 |
_L[742] = mapPartial1(function(a) |
| 22292 |
if a.kind == "INPUT" then |
| 22293 |
return {tag = "SOME", payload = a.abspath} |
| 22294 |
else |
| 22295 |
return NONE |
| 22296 |
end |
| 22297 |
end) |
| 22298 |
_L[743] = _L[742](_L[741]) |
| 22299 |
_L[744] = _L[743] |
| 22300 |
::cont22:: |
| 22301 |
do |
| 22302 |
local _L1 = {} |
| 22303 |
_L1[1] = _L[744] |
| 22304 |
_L1[2] = _L[724](_L1[1]) |
| 22305 |
if _L1[2] then |
| 22306 |
else |
| 22307 |
return |
| 22308 |
end |
| 22309 |
do |
| 22310 |
do |
| 22311 |
_L1[4], _L1[5] = _handle(function() |
| 22312 |
do |
| 22313 |
local tmp54 = _L[710].epstopdf |
| 22314 |
local tmp55 = _L[710].minted |
| 22315 |
_L[529](_L[572], _L[573], _L[575], _L[576], _L[569], _L[716], _L[603], _L[714], _L[708], _L[610], _L[709], _L[717], _L[715], _L[706], _L[668], _L[658], _L[602], tmp54, tmp55, _L[710].pdfx, _L[713], _L[711], _L[707], _L[712], _L[655], _L[615], _L[675], _L[677], _L[687], false, _L[696], _L[705], _L[699], _L[704], _L[700], _L[698], _L[703], _L[680], _L[659], _L[678], _L[702], _L[701]) |
| 22316 |
end |
| 22317 |
return true |
| 22318 |
end) |
| 22319 |
if not _L1[4] then |
| 22320 |
if __exn_instanceof(_L1[5], _L[370]) then |
| 22321 |
_L1[3] = false |
| 22322 |
else |
| 22323 |
_raise(_L1[5], nil) |
| 22324 |
end |
| 22325 |
else |
| 22326 |
_L1[3] = _L1[5] |
| 22327 |
end |
| 22328 |
end |
| 22329 |
if _L1[3] then |
| 22330 |
else |
| 22331 |
_L[744] = _L1[1] |
| 22332 |
goto cont22 |
| 22333 |
end |
| 22334 |
do |
| 22335 |
_L1[6] = _L[360](_L[675], _L[715], nil, _L[203]) |
| 22336 |
_L1[7] = _L[237](_L[572], _L[235]) |
| 22337 |
do |
| 22338 |
if _L1[7] then |
| 22339 |
else |
| 22340 |
_L1[8] = false |
| 22341 |
goto cont23 |
| 22342 |
end |
| 22343 |
_L1[8] = _L[218](_L[677]) |
| 22344 |
end |
| 22345 |
::cont23:: |
| 22346 |
do |
| 22347 |
if _L1[8] then |
| 22348 |
else |
| 22349 |
_L1[9] = _L1[6] |
| 22350 |
goto cont24 |
| 22351 |
end |
| 22352 |
do |
| 22353 |
_L1[10] = _L1[6][1] |
| 22354 |
_L1[9] = _L[360](_L[677], _L[715], _L1[10], _L1[6][2]) |
| 22355 |
end |
| 22356 |
end |
| 22357 |
::cont24:: |
| 22358 |
do |
| 22359 |
_L1[12] = _L1[9][1] |
| 22360 |
_L1[11] = _L[359](_L1[12], _L1[9][2]) |
| 22361 |
end |
| 22362 |
_L1[13] = _L1[11][1] |
| 22363 |
_L1[14] = mapPartial1(function(a) |
| 22364 |
if a.kind == "INPUT" then |
| 22365 |
return {tag = "SOME", payload = a.abspath} |
| 22366 |
else |
| 22367 |
return NONE |
| 22368 |
end |
| 22369 |
end) |
| 22370 |
_L[744] = _L1[14](_L1[13]) |
| 22371 |
goto cont22 |
| 22372 |
end |
| 22373 |
end |
| 22374 |
end |
| 22375 |
end |
| 22376 |
end |
| 22377 |
::cont4:: |