Reach.Source.DSLGuard (Reach v2.8.1)

Copy Markdown View Source

Locates AST ranges whose syntax has plugin-defined or configured DSL semantics.

Summary

Types

macro_shape()

@type macro_shape() :: {module() | nil, atom(), non_neg_integer() | :any}

source_range()

@type source_range() :: %{
  start_line: pos_integer(),
  start_column: pos_integer() | nil,
  end_line: pos_integer(),
  end_column: pos_integer() | nil
}

Functions

enabled?(plugins, shapes)

@spec enabled?([module()], [macro_shape()]) :: boolean()

guarded_line?(ranges, line)

@spec guarded_line?([source_range()], pos_integer()) :: boolean()

guarded_position?(ranges, line, column)

@spec guarded_position?([source_range()], pos_integer(), pos_integer() | nil) ::
  boolean()

ranges(ast, plugins, shapes)

@spec ranges(Macro.t(), [module()], [macro_shape()]) :: [source_range()]