View Source template_compiler_element (template_compiler v3.5.0)

Compile main block elements to erl_syntax trees.

Summary

Types

block_element/0

-type block_element() ::
          {block, identifier_token(), elements()} | {fragment, identifier_token(), elements()}.

block_owner/0

-type block_owner() :: atom() | {useblock, atom() | binary(), {binary(), integer(), integer()}}.

element/0

-type element() :: block_element() | true | false | undefined | term().

elements/0

-type elements() :: [element()].

identifier_token/0

-type identifier_token() :: {identifier, linecol(), binary()}.

linecol/0

-type linecol() :: {Line :: integer(), Column :: integer(), file:filename_all()}.

Functions

compile(L, Cs, Ws)

-spec compile(element() | elements(),
              #cs{filename :: binary(),
                  module :: atom(),
                  block_owner :: undefined | block_owner(),
                  block :: atom(),
                  blocks ::
                      [{atom(),
                        erl_syntax:syntaxTree(),
                        #ws{nr :: integer(),
                            custom_tags :: term(),
                            is_forloop_var :: boolean(),
                            is_autoid_var :: boolean(),
                            includes :: [binary()],
                            debug_points :: [{binary(), integer(), integer()}]}}],
                  runtime :: atom(),
                  context :: term(),
                  vars_var :: string(),
                  context_var :: string(),
                  context_vars :: [binary()],
                  is_autoescape :: boolean(),
                  enabled_debug_points :: all | map()},
              #ws{nr :: integer(),
                  custom_tags :: term(),
                  is_forloop_var :: boolean(),
                  is_autoid_var :: boolean(),
                  includes :: [binary()],
                  debug_points :: [{binary(), integer(), integer()}]}) ->
                 {#ws{nr :: integer(),
                      custom_tags :: term(),
                      is_forloop_var :: boolean(),
                      is_autoid_var :: boolean(),
                      includes :: [binary()],
                      debug_points :: [{binary(), integer(), integer()}]},
                  erl_syntax:syntaxTree()}.