A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
format.cc File Reference
#include "a11/flow/format.h"
#include <algorithm>
#include <cstddef>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <absl/container/flat_hash_set.h>
#include <absl/strings/ascii.h>
#include <absl/strings/str_cat.h>
#include "a11/flow/diagnostic.h"
#include "a11/flow/lexer.h"
#include "a11/flow/parser.h"
#include "a11/flow/token.h"
#include "a11/flow/vocabulary.h"

Namespaces

namespace  a11
 
namespace  a11::flow
 

Functions

FormatResult a11::flow::Format (std::string_view source, FormatOptions options={})
 Format Flow source.
 

Variable Documentation

◆ blank_before

bool blank_before = false

Whether one blank line goes above this one.

◆ comment

std::string comment

A comment that followed code on the same line.

◆ description

bool description = false

The description, quoted exactly as it was written.

Whether this is a declaration's description, written on its own line.

Such a line sits inside a run of declarations without being one of them, so the columns of the run are worked out across it.

◆ direction

std::string direction

in, out or header, as written – a shouted IN stays shouted.

Empty for a field, which is the one of the three that opens with its name.

◆ field

bool field = false

Whether this is a struct field.

Told apart from a port by more than its empty direction, because a run has to be all one kind and "is the direction empty" is a fact about this line rather than about what it is.

◆ indent

int indent = 0

◆ kind

TokenKind kind

◆ name

std::string name

The name and its colon, which travel together because they always do.

◆ port

std::optional<PortColumns> port

◆ text

std::string text

◆ type

std::string type

The type and what follows it: string required, list[a11.Chunk] stream.