Timedot.IR (Timedot v0.1.0) View Source

Intermediate representation of a timedot file. Result of parsing a file and can be serialized again in a consistent manner.

Link to this section Summary

Functions

Converts the given IR to a timedot string.

Link to this section Types

Specs

comment() :: {:comment, String.t()}

Specs

day() ::
  {:comment,
   %{
     optional(:year) => integer(),
     optional(:comment) => String.t(),
     :day => integer(),
     :month => integer(),
     :entries => entries()
   }}

Specs

entries() :: [
  %{
    optional(:comment) => String.t(),
    :account => String.t(),
    :quantity => quantity()
  }
  | {:comment, String.t()}
]

Specs

line_like() :: comment() | day()

Specs

quantity() :: {time_unit(), integer()} | {time_unit(), float()}

Specs

t() :: [line_like()]

Specs

time_unit() ::
  :seconds | :minutes | :dots | :hours | :days | :week | :months | :years

Link to this section Functions

Specs

to_string(t()) :: String.t()

Converts the given IR to a timedot string.