Noir::ElixirCalleeExtractor
Inherits Noir::CalleeExtractorBase
Constants
BARE_CALL_REGEX = /(?<![.\w:])([a-z_]\w*[!?]?)(?:\s*\(|(?=\s+(?:[A-Za-z_:@%"{\[]|\d)))/
QUALIFIED_CALL_REGEX = /((?:(?:[A-Z]\w*|:[a-z_]\w*)(?:\.[A-Z]\w*)*\.)[a-z_]\w*[!?]?)(?:\s*\(|(?=\s+(?:[A-Za-z_:@%"{\[]|\d)))/
RESERVED = Set {"after", "alias", "and", "case", "catch", "cond", "def", "defdelegate", "defexception", "defguard", "defguardp", "defimpl", "defmacro", "defmacrop", "defmodule", "defoverridable", "defp", "defprotocol", "defstruct", "do", "else", "end", "false", "fn", "for", "if", "import", "in", "nil", "not", "or", "quote", "raise", "receive", "require", "rescue", "throw", "true", "try", "unless", "unquote", "use", "when", "with"}
Instance methods
callees_for_lines(lines : Enumerable(String), file_path : String, start_line : Int32) : Array(Entry)
SourceBlank string literals and drop a trailing # … comment. Used by the
callee scanner and by Elixir analyzers' block-depth counters (where
do/fn/end inside a literal must not shift nesting). Hot path:
- No
#and no quotes → identity return (no allocation). The walk below would rebuild an identical string. - Otherwise → quote-aware rebuild that discards string contents and
truncates at the first out-of-string
#.