module
Noir::LuaCalleeExtractor
Extended Modules
Defined in:
miniparsers/lua_callee_extractor.crConstant 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
- #attach_to(endpoint : Endpoint, callees : Array(Entry))
- #callees_for_body(body : String, file_path : String, start_line : Int32) : Array(Entry)
- #extract_function_after(source : String, start_index : Int32, search_limit : Int32 = source.size, body_limit : Int32 = source.size) : Tuple(String, Int32) | Nil
- #extract_function_at(source : String, function_index : Int32, limit : Int32 = source.size) : Tuple(String, Int32) | Nil
- #extract_moonscript_block_after(source : String, arrow_end_index : Int32) : Tuple(String, Int32) | Nil
- #find_matching_delimiter(source : String, open_index : Int32, open_char : Char, close_char : Char, limit : Int32 = source.size) : Int32 | Nil
- #function_bodies(source : String, file_path : String) : Hash(String, FunctionBody)
- #line_number_for(source : String, index : Int32) : Int32
- #strip_non_code(source : String) : String
Instance Method Detail
def extract_function_after(source : String, start_index : Int32, search_limit : Int32 = source.size, body_limit : Int32 = source.size) : Tuple(String, Int32) | Nil
#
def extract_function_at(source : String, function_index : Int32, limit : Int32 = source.size) : Tuple(String, Int32) | Nil
#
def extract_moonscript_block_after(source : String, arrow_end_index : Int32) : Tuple(String, Int32) | Nil
#
def find_matching_delimiter(source : String, open_index : Int32, open_char : Char, close_char : Char, limit : Int32 = source.size) : Int32 | Nil
#