retranslator

Types

TransformerRef = ref TransformerObj

Procs

proc `$`(t: TransformerRef): string {...}{.raises: [ValueError], tags: [].}
Converts Transformer object in string
proc Transformer(code = ""; rules: seq[RuleObj] = @[]; debug = false): TransformerRef {...}{.
    raises: [], tags: [].}

Creates new Transformer object.

Keyword Arguments:

  • code -- code for transform.
  • rules -- rules for transform.
proc add(t: TransformerRef; rules: varargs[RuleObj]) {...}{.raises: [], tags: [].}
Adds a new rules in the transformer obj.
proc add(t: TransformerRef; rules: seq[RuleObj]) {...}{.raises: [], tags: [].}
Adds a new rules in the transformer obj.
proc transform(t: TransformerRef; code = ""): string {...}{.raises: [FieldError, ValueError,
    IndexError, UnpackError, AccessViolationError, RegexInternalError,
    InvalidUnicodeError, KeyError, Exception], tags: [].}

transforms text, using specific rules.

Keyword Arguments:

  • code -- code for transform.

Macros

macro rules(t: TransformerRef; body: untyped): untyped