Lines Matching refs:local
33 local setmetatable = setmetatable
34 local loadstring = loadstring
35 local tostring = tostring
36 local setfenv = setfenv
37 local require = require
38 local concat = table.concat
39 local assert = assert
40 local write = io.write
41 local pcall = pcall
42 local phase
43 local open = io.open
44 local load = load
45 local type = type
46 local dump = string.dump
47 local find = string.find
48 local gsub = string.gsub
49 local byte = string.byte
50 local null
51 local sub = string.sub
52 local var
54 local _VERSION = _VERSION
55 local _ENV = _ENV -- luacheck: globals _ENV
56 local _G = _G
58 local HTML_ENTITIES = {
67 local CODE_ENTITIES = {
78 local VAR_PHASES
80 local ESC = byte("\27")
81 local NUL = byte("\0")
82 local HT = byte("\t")
83 local VT = byte("\v")
84 local LF = byte("\n")
85 local SOL = byte("/")
86 local BSOL = byte("\\")
87 local SP = byte(" ")
88 local AST = byte("*")
89 local NUM = byte("#")
90 local LPAR = byte("(")
91 local LSQB = byte("[")
92 local LCUB = byte("{")
93 local MINUS = byte("-")
94 local PERCNT = byte("%")
96 local EMPTY = ""
98 local VIEW_ENV
109 local newtab
111 local ok
116 local function enabled(val)
121 local function trim(s)
125 local function rpos(view, s)
127 local c = byte(view, s, s)
137 local function escaped(view, s)
148 local function read_file(path)
149 local file, err = open(path, "rb")
151 local content
157 local function load_view(template)
160 local path, root = view, template.root
170 local function load_file(func)
174 local function load_string(func)
178 local function loader(template)
184 local function visit(visitors, content, tag, name)
196 local function new(template, safe)
206 local load_chunk = loader(template)
208 local caching
215 local visitors
245 local vt = type(view)
251 local render
252 local process
297 local ok, err = pcall(render, ...)
303 local ok, output = pcall(process, ...)
311 local ok, output = pcall(process, ...)
328 local chunk = dump(template.compile(view, nil, plain), strip ~= false)
330 local file = open(path, "wb")
351 local cache = template.cache
353 local func = load_chunk(template.parse(view, plain))
372 local j = 2
373 local c = {[[
375 local ___,blocks,layout={},blocks or {}
376 local function include(v, c) return template.process(v, c or context) end
377 local function echo(...) for i=1,select("#", ...) do ___[#___+1] = tostring(select(i, ...)) end end
379 local i, s = 1, find(view, "{", 1, true)
381 local t, p = byte(view, s + 1, s + 1), s + 2
383 local e = find(view, "}}", p, true)
385 local z, w = escaped(view, s)
403 local e = find(view, "*}", p, true)
405 local z, w = escaped(view, s)
423 local e = find(view, "%}", p, true)
425 local z, w = escaped(view, s)
435 local n = e + 2
439 local r = rpos(view, s - 1)
453 local e = find(view, ")}", p, true)
455 local z, w = escaped(view, s)
465 local f = visit(visitors, sub(view, p, e - 1), "(")
466 local x = find(f, ",", 2, true)
484 local e = find(view, "]}", p, true)
486 local z, w = escaped(view, s)
504 local e = find(view, "-}", p, true)
506 local x, y = find(view, sub(view, s, e + 1), e + 2, true)
508 local z, w = escaped(view, s)
523 local b = trim(sub(view, p, e - 1))
539 local r = rpos(view, s - 1)
558 local e = find(view, "#}", p, true)
560 local z, w = escaped(view, s)
634 local ok, a, b = pcall(template[k], ...)