aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/codes_from_doc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/outputs/codes_from_doc.lua')
-rw-r--r--spec/outputs/codes_from_doc.lua314
1 files changed, 314 insertions, 0 deletions
diff --git a/spec/outputs/codes_from_doc.lua b/spec/outputs/codes_from_doc.lua
index f6d5d61..a5412ab 100644
--- a/spec/outputs/codes_from_doc.lua
+++ b/spec/outputs/codes_from_doc.lua
@@ -1280,6 +1280,163 @@ if _tab_0 then
1280 end 1280 end
1281 print("Vec2 " .. tostring(x) .. ", " .. tostring(y)) 1281 print("Vec2 " .. tostring(x) .. ", " .. tostring(y))
1282end 1282end
1283local _exp_0 = tb
1284local _type_0 = type(_exp_0)
1285local _tab_0 = "table" == _type_0 or "userdata" == _type_0
1286local _match_0 = false
1287if _tab_0 then
1288 if 1 == _exp_0[1] and 2 == _exp_0[2] and 3 == _exp_0[3] then
1289 _match_0 = true
1290 print("1, 2, 3")
1291 end
1292end
1293if not _match_0 then
1294 local _match_1 = false
1295 if _tab_0 then
1296 local b = _exp_0[2]
1297 if 1 == _exp_0[1] and b ~= nil and 3 == _exp_0[3] then
1298 _match_1 = true
1299 print("1, " .. tostring(b) .. ", 3")
1300 end
1301 end
1302 if not _match_1 then
1303 if _tab_0 then
1304 local b = _exp_0[3]
1305 if b == nil then
1306 b = 3
1307 end
1308 if 1 == _exp_0[1] and 2 == _exp_0[2] then
1309 print("1, 2, " .. tostring(b))
1310 end
1311 end
1312 end
1313end
1314local _exp_0 = tb
1315local _type_0 = type(_exp_0)
1316local _tab_0 = "table" == _type_0 or "userdata" == _type_0
1317local _match_0 = false
1318if _tab_0 then
1319 local result = _exp_0.result
1320 if true == _exp_0.success and result ~= nil then
1321 _match_0 = true
1322 print("success", result)
1323 end
1324end
1325if not _match_0 then
1326 local _match_1 = false
1327 if _tab_0 then
1328 if false == _exp_0.success then
1329 _match_1 = true
1330 print("failed", result)
1331 end
1332 end
1333 if not _match_1 then
1334 print("invalid")
1335 end
1336end
1337local _exp_0 = tb
1338local _type_0 = type(_exp_0)
1339local _tab_0 = "table" == _type_0 or "userdata" == _type_0
1340local _match_0 = false
1341if _tab_0 then
1342 local content
1343 do
1344 local _obj_0 = _exp_0.data
1345 local _type_1 = type(_obj_0)
1346 if "table" == _type_1 or "userdata" == _type_1 then
1347 content = _obj_0.content
1348 end
1349 end
1350 local _val_0
1351 do
1352 local _obj_0 = _exp_0.data
1353 if _obj_0 ~= nil then
1354 _val_0 = _obj_0.type
1355 end
1356 end
1357 if "success" == _val_0 and content ~= nil then
1358 _match_0 = true
1359 print("success", content)
1360 end
1361end
1362if not _match_0 then
1363 local _match_1 = false
1364 if _tab_0 then
1365 local content
1366 do
1367 local _obj_0 = _exp_0.data
1368 local _type_1 = type(_obj_0)
1369 if "table" == _type_1 or "userdata" == _type_1 then
1370 content = _obj_0.content
1371 end
1372 end
1373 local _val_0
1374 do
1375 local _obj_0 = _exp_0.data
1376 if _obj_0 ~= nil then
1377 _val_0 = _obj_0.type
1378 end
1379 end
1380 if "error" == _val_0 and content ~= nil then
1381 _match_1 = true
1382 print("failed", content)
1383 end
1384 end
1385 if not _match_1 then
1386 print("invalid")
1387 end
1388end
1389local _exp_0 = tb
1390local _type_0 = type(_exp_0)
1391local _tab_0 = "table" == _type_0 or "userdata" == _type_0
1392if _tab_0 then
1393 local fourth = _exp_0[4]
1394 local _val_0
1395 do
1396 local _obj_0 = _exp_0[1]
1397 if _obj_0 ~= nil then
1398 _val_0 = _obj_0.a
1399 end
1400 end
1401 local _val_1
1402 do
1403 local _obj_0 = _exp_0[1]
1404 if _obj_0 ~= nil then
1405 _val_1 = _obj_0.b
1406 end
1407 end
1408 local _val_2
1409 do
1410 local _obj_0 = _exp_0[2]
1411 if _obj_0 ~= nil then
1412 _val_2 = _obj_0.a
1413 end
1414 end
1415 local _val_3
1416 do
1417 local _obj_0 = _exp_0[2]
1418 if _obj_0 ~= nil then
1419 _val_3 = _obj_0.b
1420 end
1421 end
1422 local _val_4
1423 do
1424 local _obj_0 = _exp_0[3]
1425 if _obj_0 ~= nil then
1426 _val_4 = _obj_0.a
1427 end
1428 end
1429 local _val_5
1430 do
1431 local _obj_0 = _exp_0[3]
1432 if _obj_0 ~= nil then
1433 _val_5 = _obj_0.b
1434 end
1435 end
1436 if 1 == _val_0 and 2 == _val_1 and 3 == _val_2 and 4 == _val_3 and 5 == _val_4 and 6 == _val_5 and fourth ~= nil then
1437 print("matched", fourth)
1438 end
1439end
1283local Inventory 1440local Inventory
1284local _class_0 1441local _class_0
1285local _base_0 = { 1442local _base_0 = {
@@ -3286,6 +3443,163 @@ if _tab_0 then
3286 end 3443 end
3287 print("Vec2 " .. tostring(x) .. ", " .. tostring(y)) 3444 print("Vec2 " .. tostring(x) .. ", " .. tostring(y))
3288end 3445end
3446local _exp_0 = tb
3447local _type_0 = type(_exp_0)
3448local _tab_0 = "table" == _type_0 or "userdata" == _type_0
3449local _match_0 = false
3450if _tab_0 then
3451 if 1 == _exp_0[1] and 2 == _exp_0[2] and 3 == _exp_0[3] then
3452 _match_0 = true
3453 print("1, 2, 3")
3454 end
3455end
3456if not _match_0 then
3457 local _match_1 = false
3458 if _tab_0 then
3459 local b = _exp_0[2]
3460 if 1 == _exp_0[1] and b ~= nil and 3 == _exp_0[3] then
3461 _match_1 = true
3462 print("1, " .. tostring(b) .. ", 3")
3463 end
3464 end
3465 if not _match_1 then
3466 if _tab_0 then
3467 local b = _exp_0[3]
3468 if b == nil then
3469 b = 3
3470 end
3471 if 1 == _exp_0[1] and 2 == _exp_0[2] then
3472 print("1, 2, " .. tostring(b))
3473 end
3474 end
3475 end
3476end
3477local _exp_0 = tb
3478local _type_0 = type(_exp_0)
3479local _tab_0 = "table" == _type_0 or "userdata" == _type_0
3480local _match_0 = false
3481if _tab_0 then
3482 local result = _exp_0.result
3483 if true == _exp_0.success and result ~= nil then
3484 _match_0 = true
3485 print("success", result)
3486 end
3487end
3488if not _match_0 then
3489 local _match_1 = false
3490 if _tab_0 then
3491 if false == _exp_0.success then
3492 _match_1 = true
3493 print("failed", result)
3494 end
3495 end
3496 if not _match_1 then
3497 print("invalid")
3498 end
3499end
3500local _exp_0 = tb
3501local _type_0 = type(_exp_0)
3502local _tab_0 = "table" == _type_0 or "userdata" == _type_0
3503local _match_0 = false
3504if _tab_0 then
3505 local content
3506 do
3507 local _obj_0 = _exp_0.data
3508 local _type_1 = type(_obj_0)
3509 if "table" == _type_1 or "userdata" == _type_1 then
3510 content = _obj_0.content
3511 end
3512 end
3513 local _val_0
3514 do
3515 local _obj_0 = _exp_0.data
3516 if _obj_0 ~= nil then
3517 _val_0 = _obj_0.type
3518 end
3519 end
3520 if "success" == _val_0 and content ~= nil then
3521 _match_0 = true
3522 print("success", content)
3523 end
3524end
3525if not _match_0 then
3526 local _match_1 = false
3527 if _tab_0 then
3528 local content
3529 do
3530 local _obj_0 = _exp_0.data
3531 local _type_1 = type(_obj_0)
3532 if "table" == _type_1 or "userdata" == _type_1 then
3533 content = _obj_0.content
3534 end
3535 end
3536 local _val_0
3537 do
3538 local _obj_0 = _exp_0.data
3539 if _obj_0 ~= nil then
3540 _val_0 = _obj_0.type
3541 end
3542 end
3543 if "error" == _val_0 and content ~= nil then
3544 _match_1 = true
3545 print("failed", content)
3546 end
3547 end
3548 if not _match_1 then
3549 print("invalid")
3550 end
3551end
3552local _exp_0 = tb
3553local _type_0 = type(_exp_0)
3554local _tab_0 = "table" == _type_0 or "userdata" == _type_0
3555if _tab_0 then
3556 local fourth = _exp_0[4]
3557 local _val_0
3558 do
3559 local _obj_0 = _exp_0[1]
3560 if _obj_0 ~= nil then
3561 _val_0 = _obj_0.a
3562 end
3563 end
3564 local _val_1
3565 do
3566 local _obj_0 = _exp_0[1]
3567 if _obj_0 ~= nil then
3568 _val_1 = _obj_0.b
3569 end
3570 end
3571 local _val_2
3572 do
3573 local _obj_0 = _exp_0[2]
3574 if _obj_0 ~= nil then
3575 _val_2 = _obj_0.a
3576 end
3577 end
3578 local _val_3
3579 do
3580 local _obj_0 = _exp_0[2]
3581 if _obj_0 ~= nil then
3582 _val_3 = _obj_0.b
3583 end
3584 end
3585 local _val_4
3586 do
3587 local _obj_0 = _exp_0[3]
3588 if _obj_0 ~= nil then
3589 _val_4 = _obj_0.a
3590 end
3591 end
3592 local _val_5
3593 do
3594 local _obj_0 = _exp_0[3]
3595 if _obj_0 ~= nil then
3596 _val_5 = _obj_0.b
3597 end
3598 end
3599 if 1 == _val_0 and 2 == _val_1 and 3 == _val_2 and 4 == _val_3 and 5 == _val_4 and 6 == _val_5 and fourth ~= nil then
3600 print("matched", fourth)
3601 end
3602end
3289local Inventory 3603local Inventory
3290local _class_0 3604local _class_0
3291local _base_0 = { 3605local _base_0 = {