[][src]Module polar_core::formatting

Formatting

There are three main forms of formatting within Polar:

  1. Debug strings: super verbose, mostly Rust-auto derived from fmt::Debug trait
  2. Display string: nice user-facing versions, which could be used for things like a debugger
  3. Polar strings: not always implemented, but is same syntax the parser accepts

In addition, there are special cases like traces and sources that have their own formatting requirements.

Re-exports

pub use display::*;
pub use to_polar::*;

Modules

display
to_polar

Functions

format_args

Formats a vector of terms as a string-separated list When providing an operator, parentheses are applied suitably (see: to_polar_parens)

format_params

Formats a vector of parameters

format_rules

Formats a vector of rules as a string-separated list.

source_lines

Traverse a Source line by line until offset is reached, and return the source line containing the offset character as well as num_lines lines above and below it.

to_polar_parens