Fibo Code Format (FCF) - Pascal formatter with Unleashed supportA code formatter for Free Pascal that handles both stock FPC and the
FPC Unleashed dialect
(a fork adding inline vars, tuples, match, expression-if/case/try, defer / autofree, compound assignments, composable records, ...). Runs in your browser via WASM - your code never leaves your machine.
Try it here: https://fibo.gg/codeformat/It is plain FPC under the hoodWhat runs in the browser is the same program compiled to WebAssembly - the source is 100%
{$mode objfpc}, no Unleashed features in its own code, no dependencies beyond the FPC RTL. The exact same source compiles to a native
EXE /
ELF binary, or can be wrapped as a Lazarus
.lpk package and dropped into the IDE as a built-in formatting tool.
It carries its own parser and CST (concrete syntax tree) builder, with no FPC compiler internals reused. The output is reconstructed by walking that tree, which is what keeps the result consistent regardless of how the input was laid out, and what makes adding a new dialect (like Unleashed) a matter of extending the grammar rather than patching tokens.
Web-only for nowI am not publishing the source yet. What is available is the compiled WASM and a hosted web version that runs it. The plan is to stay web-only until the bug list is cleaned out and the output is in good shape on real-world code; after that, sources go up.
The web channel also lets me iterate fast without anyone having to rebuild anything locally. If you find an input that the formatter mangles, please drop the smallest reproducer in this thread (with the option values you used if you changed any defaults) - those reports are the most useful thing right now.
Coming next- Wider fixture coverage - real projects pushed through and curated into the regression suite.
- Theme toggle (light / dark). The site is dark-only today; a proper switch is on the way.
- Customizable syntax colors. Tweak the highlight palette live in the browser.
- Export to Lazarus XML. Save the customised palette as an XML file you can drop straight into Lazarus's settings folder. Editing syntax colours directly inside the IDE today is painful - this should make it bearable.
- Import existing Lazarus XML. Pull your existing colour scheme in, tweak it in the web UI, export it back. Full round-trip.
Feedback, bug reports, and edge cases that break formatting are all welcome.