zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

source_location.ex (653B)


      1 defmodule Absinthe.Blueprint.SourceLocation do
      2   @moduledoc false
      3 
      4   @enforce_keys [:line, :column]
      5   defstruct [
      6     :line,
      7     :column
      8   ]
      9 
     10   @type t :: %__MODULE__{
     11           line: pos_integer,
     12           column: pos_integer
     13         }
     14 
     15   @doc """
     16   Generate a `SourceLocation.t()` given a location
     17   """
     18   @spec at(loc :: Absinthe.Language.loc_t()) :: t
     19   def at(loc) do
     20     %__MODULE__{line: loc.line, column: loc.column}
     21   end
     22 
     23   @doc """
     24   Generate a `SourceLocation.t()` given line and column numbers
     25   """
     26   @spec at(line :: pos_integer, column :: pos_integer) :: t
     27   def at(line, column) do
     28     %__MODULE__{line: line, column: column}
     29   end
     30 end