Lines Matching full:token

147   local token
166 token = table_clone(tokens[i])
167 token[2] = captures
169 token.raw = str:sub(1, #str - #str2)
172 if token[1] == "{" or token[1] == "[" then
174 elseif token.const then
176 str = token[2][2] .. str
177 token.raw = token.raw:sub(1, #token.raw - #token[2][2])
178 elseif token[1] == "id" then
180 str = token[2][2] .. str
181 token.raw = token.raw:sub(1, #token.raw - #token[2][2])
183 token[2][1] = string_trim(token[2][1])
184 elseif token[1] == "string" then
186 local snip = token[2][1]
187 if not token.force_text then
189 token[1] = "number"
193 elseif token[1] == "comment" then
195 elseif token[1] == "indent" then
200 indentAmount = #token[2][1]
204 indents = (#token[2][1] / indentAmount);
213 .. " instead of " .. tostring(lastIndents) .. context(token[2].input))
215 push(stack, token)
217 local input = token[2].input
218 token = {"dedent", {"", input = ""}}
219 token.input = input
222 push(stack, token)
225 end -- if token[1] == XXX
226 token.row = row
232 if token then
233 push(stack, token)
234 token = nil
319 token = self:peek()
323 if c.token[1] == "doc" then
325 elseif c.token[1] == "-" then
327 elseif c.token[1] == "{" then
329 elseif c.token[1] == "[" then
331 elseif c.token[1] == "id" then
333 elseif c.token[1] == "string" then
335 elseif c.token[1] == "timestamp" then
337 elseif c.token[1] == "number" then
339 elseif c.token[1] == "pipe" then
341 elseif c.token.const == true then
343 result = c.token.value
345 error("ParseError: unexpected token '" .. c.token[1] .. "'" .. context(c.token.input))
351 local term = "term "..c.token[1]..": '"..c.token[2][1].."'"
393 return self:parent(level) and self:parent(level).token[1] == type
453 local token = self:advance()
454 local result = string_trim(token.raw, "\n")
458 while token.row < newtoken.row do
460 token.row = token.row + 1