module Noir::ElixirCalleeExtractor

Included Modules

Extended Modules

Defined in:

miniparsers/elixir_callee_extractor.cr

Constant Summary

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 Method Summary

Instance methods inherited from module Noir::CalleeExtractorBase

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

Instance Method Detail

def callees_for_body(body : String, file_path : String, start_line : Int32) : Array(Entry) #

[View source]
def callees_for_lines(lines : Enumerable(String), file_path : String, start_line : Int32) : Array(Entry) #

[View source]
def strip_comment(line : String) : String #

Blank 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 #.

[View source]