Skip to main content

format_string

Function format_string 

Source
pub fn format_string(
    source: &str,
    config: Option<FormatConfig>,
) -> Result<String>
Expand description

Format Pascal source code to a string

§Arguments

  • source - The Pascal source code to format
  • config - Optional formatting configuration, will use defaults if None

§Examples

use pascal::formatter::format_string;

let source = "program test;begin writeln('Hello');end.";
let formatted = format_string(source, None)?;