torture.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #!/usr/bin/env lua
  2. -- File-header comment run line 1
  3. -- line 2 of the run
  4. local core = require("app.core")
  5. local Signal = require(script.Parent.Signal)
  6. local quoted = require 'app.quoted'
  7. local bracketed = require [[app.bracketed]]
  8. local viaChild = require(script:WaitForChild("Child"))
  9. local accessed = require("app.acc").field
  10. local dyn = require(dynName)
  11. local twoA, twoB = require("two.a"), require("two.b")
  12. local okG, guarded = pcall(require, "app.guarded")
  13. --- LuaDoc summary for topFn.
  14. -- @param a number
  15. -- @return number
  16. function topFn(a)
  17. return a + 1
  18. end
  19. --[[ Block comment doc
  20. spanning two lines ]]
  21. local function localFn(...)
  22. return select("#", ...)
  23. end
  24. -- doc for anonAssigned (variable, initializer invisible)
  25. local anonAssigned = function(v)
  26. return hidden(v)
  27. end
  28. local M = {}
  29. local UPPER_CONST = 42
  30. function M.create(n)
  31. local inst = { n = n }
  32. return setmetatable(inst, { __index = M })
  33. end
  34. function M:render(opts)
  35. local lazy = require("app.lazy")
  36. self.count = (self.count or 0) + 1
  37. self:helperMethod(opts)
  38. self.field.deep(1)
  39. M.create(2)
  40. M.registry[key](3)
  41. core.util.log("msg")
  42. core.run(M.create)
  43. local function inner()
  44. return topFn(9)
  45. end
  46. function M.attached(q)
  47. return q
  48. end
  49. function leakedGlobal()
  50. end
  51. return inner()
  52. end
  53. function M.sub.deep:chained(x)
  54. return x
  55. end
  56. function _G.installed()
  57. end
  58. M.assigned = function(z)
  59. return topFn(z)
  60. end
  61. M.handlers = { on_start = topFn, on_stop = localFn, skipped = missing }
  62. local tbl = { cb = topFn, [1] = localFn, nested = { deep_cb = topFn } }
  63. globalAssign = topFn(10)
  64. M.cb = cb
  65. topFn(11)
  66. M.create(12)
  67. M:render({})
  68. M.sub.deep:chained(13)
  69. core.util.log("direct")
  70. t2[k2](14)
  71. f2()(15)
  72. function paren_conv()
  73. (handler)(16)
  74. end
  75. local one = 1 local two = 2 print(one, two)
  76. local s1 = [[long
  77. string]]
  78. local s2 = [==[nested ]] ok]==]
  79. local x <const> = 99
  80. local préfixe = "café"
  81. function after_unicode() end
  82. do goto done end
  83. ::done::
  84. return M