Module template_compiler_utils

Misc support routines.

Copyright © 2016 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Misc support routines.

Function Index

file_mtime/1Return the (universal) modification time of file, 0 on enoent.
next_context_var/2Set the next "Context" variable name in cs for an enclosed block.
next_vars_var/2Set the next "Vars" variable name in cs for an enclosed block.
pos/1
set_pos/2
to_atom/1Convert a list or binary to an atom.
unescape_string_literal/1Expand escape sequences like \n and \t in a string.
var/1Generate an unique variable name.

Function Details

file_mtime/1

file_mtime(File::file:filename_all()) -> calendar:datetime() | 0

Return the (universal) modification time of file, 0 on enoent

next_context_var/2

next_context_var(Cs::#cs{}, Ws::#ws{}) -> {#cs{}, #ws{}}

Set the next "Context" variable name in cs for an enclosed block.

next_vars_var/2

next_vars_var(Cs::#cs{}, Ws::#ws{}) -> {#cs{}, #ws{}}

Set the next "Vars" variable name in cs for an enclosed block.

pos/1

pos(X1::{file:filename_all(), pos_integer(), pos_integer()}) -> {pos_integer(), pos_integer()}

set_pos/2

set_pos(SrcPos::{file:filename_all(), pos_integer(), pos_integer()}, Tree::term()) -> term()

to_atom/1

to_atom(L::string() | binary() | atom()) -> atom()

Convert a list or binary to an atom.

unescape_string_literal/1

unescape_string_literal(String::binary()) -> binary()

Expand escape sequences like \n and \t in a string.

var/1

var(Ws::#ws{}) -> {#ws{}, string()}

Generate an unique variable name


Generated by EDoc