14.6. Source code formatter
The DAS_SOURCE_FORMATTER module implements source code formatting for daslang. It can parse and re-emit daslang source code with consistent indentation, spacing, and line breaking rules. Used by editor integrations and code quality tools.
All functions and symbols are in “das_source_formatter” module, use require to get access to it.
require daslib/das_source_formatter
14.6.1. Formatting
- format_source(file_data: array<uint8>): string
Formats daslang source code given as a byte array and returns the formatted result.
- Arguments:
file_data : array<uint8> implicit
- format_source_string(file_data: string const&): string
Formats a daslang source code string and returns the formatted result.
- Arguments:
file_data : string& implicit