Languages

Sections language.<lang> of a project's Yarner.toml contain language-specific settings mainly used for the Reverse mode.

Overview

Language settings are optional. However, they are required for all languages/file extensions to be used in reverse mode.

Language settings are a section per language, identified from file extensions. Each section looks like this example for Rust (.rs files):

[language.rs]
clear_blank_lines = true
eof_newline = true

    [language.rs.block_labels]
    comment_start = "//"
    # comment_end = "*/"
    block_start = "<@"
    block_next = "<@>"
    block_end = "@>"

When language settings are requires for setting clear_blank_lines or eof_newline, but block labels in the target language are not wanted or not supported, leave out section [block_labels].

Options

OptionDetails
clear_blank_linesReplaces lines containing only whitespaces by blank lines, in code output. Defaults to true when no language settings are present
eof_newlineEnforces code files to always end with a blank line. Defaults to true when no language settings are present
[language.<lang>.block_labels]Settings for block labels for reverse mode (see table below). Optional. When absent, reverse mode for the language is disabled

Reverse mode

Section [language.<lang>.block_labels] is disabled by default. To enable reverse mode for a language, that section with the following settings is required.

OptionDetails
comment_startStart of comments in the language. Used for code block labels for reverse mode. Can be start of line or block comments
comment_endEnd of comments. Optional, only for languages that support only block comments
block_startStart sequence of block labels
block_nextStart of next block with the same name
block_endEnd of block labels