slime v1.0.0 Slime.Parser.Preprocessor

This module helps to process input and insert indents and dedents to simplify parser design.

Summary

Functions

Takes an input binary and inserts virtual indent and dedent

Counts indent size by indent string using :tab_size config option

Removes trailing whitespace, leaving newlines intact

Functions

dedent_meta_symbol()
indent(input)

Takes an input binary and inserts virtual indent and dedent.

Examples:

iex> Slime.Parser.Preprocessor.indent("t\n p")
"t\n p"

iex> Slime.Parser.Preprocessor.indent("t\n p\n  a\nh")
"t\n p\n  a\nh"
indent_meta_symbol()
indent_size(spaces)

Counts indent size by indent string using :tab_size config option

Examples:

iex> Slime.Parser.Preprocessor.indent_size("    ")
4

iex> Slime.Parser.Preprocessor.indent_size("    ")
4

iex> Slime.Parser.Preprocessor.indent_size("")
0
process(input)
remove_trailing_spaces(input)

Removes trailing whitespace, leaving newlines intact.

skip_broken_code_lines(lines, result)
skip_embedded_engine(indent, lines, result)