Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

1use crate::{ 2 Error, Result, 3 format::{Formatter, Intermediate}, 4 warning::WarningEmitter, 5}; 6use camino::Utf8Path; 7use ecow::EcoString; 8 9pub fn parse_fix_and_format(src: &EcoString, path: &Utf8Path) -> Result<String> { 10 // Parse 11 let parsed = crate::parse::parse_module(path.to_owned(), src, &WarningEmitter::null()) 12 .map_err(|error| Error::Parse { 13 path: path.to_path_buf(), 14 src: src.clone(), 15 error, 16 })?; 17 let intermediate = Intermediate::from_extra(&parsed.extra, src); 18 let module = parsed.module; 19 20 // Fix 21 // let module = some_fixer_module::Fixer::fix(module); 22 23 // Format 24 let mut buffer = String::new(); 25 Formatter::with_comments(&intermediate) 26 .module(&module) 27 .pretty_print(80, &mut buffer)?; 28 29 Ok(buffer) 30}