module Noir::LuaCalleeExtractor

Extended Modules

Defined in:

miniparsers/lua_callee_extractor.cr

Constant Summary

BARE_CALL_REGEX = /(?<![A-Za-z0-9_.:\\@])([A-Za-z_][A-Za-z0-9_]*)\s*(?:\(|(?=\s*(?:["'{]|\[\[)))/
COMMAND_CALL_REGEX = /(?:^\s*|[=,;]\s*|\breturn\s+)([A-Za-z_][A-Za-z0-9_]*)\s+(?=["'{A-Za-z_@\[])/
RECEIVER_CALL_REGEX = /(?<![A-Za-z0-9_@])(@?[A-Za-z_][A-Za-z0-9_]*(?:(?:\s*[.:\\]\s*)[A-Za-z_][A-Za-z0-9_]*)+)\s*(?:\(|(?=\s+(?:["'{]|\[\[|@)))/
RESERVED = Set {"and", "break", "do", "else", "elseif", "end", "false", "for", "function", "goto", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while", "assert", "collectgarbage", "dofile", "error", "getmetatable", "ipairs", "load", "loadfile", "next", "pairs", "pcall", "print", "rawequal", "rawget", "rawlen", "rawset", "require", "select", "setmetatable", "tonumber", "tostring", "type", "xpcall"}
SELF_CALL_REGEX = /(?<![A-Za-z0-9_])(@[A-Za-z_][A-Za-z0-9_]*)\s*(?:\(|(?=\s+(?:["'{]|\[\[|[A-Za-z_@])))/
STANDARD_LIB_ROOTS = Set {"coroutine", "debug", "io", "math", "os", "package", "string", "table", "utf8"}

Instance Method Summary

Instance Method Detail

def attach_to(endpoint : Endpoint, callees : Array(Entry)) #

[View source]
def callees_for_body(body : String, file_path : String, start_line : Int32) : Array(Entry) #

[View source]
def extract_function_after(source : String, start_index : Int32, search_limit : Int32 = source.size, body_limit : Int32 = source.size) : Tuple(String, Int32) | Nil #

[View source]
def extract_function_at(source : String, function_index : Int32, limit : Int32 = source.size) : Tuple(String, Int32) | Nil #

[View source]
def extract_moonscript_block_after(source : String, arrow_end_index : Int32) : Tuple(String, Int32) | Nil #

[View source]
def find_matching_delimiter(source : String, open_index : Int32, open_char : Char, close_char : Char, limit : Int32 = source.size) : Int32 | Nil #

[View source]
def function_bodies(source : String, file_path : String) : Hash(String, FunctionBody) #

[View source]
def line_number_for(source : String, index : Int32) : Int32 #

[View source]
def strip_non_code(source : String) : String #

[View source]