Kuddle.V2.Utils (Kuddle v1.0.0) View Source

Link to this section Summary

Link to this section Types

Specs

char_or_code() :: binary() | integer()

Specs

esc_multiline() :: {:esc | :uesc, [char_or_code()]}

Link to this section Functions

Link to this function

dedent_multline_by_spaces(left, right, state \\ :start)

View Source
Link to this macro

is_utf8_bad_id_char(c)

View Source (macro)
Link to this macro

is_utf8_disallowed_char(c)

View Source (macro)
Link to this macro

is_utf8_equals_like_char(c)

View Source (macro)
Link to this macro

is_utf8_newline_like_char(c)

View Source (macro)
Link to this macro

is_utf8_non_identifier_char(c)

View Source (macro)
Link to this macro

is_utf8_space_like_char(c)

View Source (macro)
Link to this macro

is_utf8_special_char(c)

View Source (macro)
Link to this macro

is_utf8_twochar_newline(c1, c2)

View Source (macro)
Link to this function

multiline_determine_spaces(list)

View Source
Link to this function

multiline_list_to_utf8_binary(list)

View Source

Specs

multiline_list_to_utf8_binary(list()) :: {:ok, binary()} | {:error, term()}

Variant of list_to_utf8_binary, but specifically for handling multiline strings

Link to this function

need_quote?(str, state \\ :start)

View Source
Link to this function

parse_float_string(bin, state \\ :start, acc \\ [])

View Source
Link to this function

split_multiline_list(list, line \\ {:uesc, []}, acc \\ [])

View Source

Specs

split_multiline_list([char_or_code()], esc_multiline(), [esc_multiline()]) :: [
  esc_multiline()
]

Splits a multiline list, this will mark each line with its escape status, a line with a :esc status should not be used for whitespace trimming/dedent, as it was explictly set.

One thing to note is all lines in the returned list start with a newline if its not the first line.

The returned array is always reversed, so the last line will be first

Link to this function

split_spaces(rest, acc \\ [])

View Source

Specs

split_spaces(binary(), list()) :: {spaces :: binary(), rest :: binary()}

Splits off as many space characters as possible

Link to this function

split_spaces_and_newlines(rest, meta, acc \\ [])

View Source
Link to this function

split_up_to_newline(rest, meta, acc \\ [])

View Source

Specs

split_up_to_newline(binary(), any(), [any()]) ::
  {:ok, binary(), binary(), meta :: any()} | {:error, term()}
Link to this function

valid_identifier?(str, state \\ :start)

View Source

Check if a string is a valid identifier (that is a plain unbroken character sequence)