A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
discover.cc File Reference
#include "a11/flow/discover.h"
#include <algorithm>
#include <cstddef>
#include <filesystem>
#include <fstream>
#include <optional>
#include <sstream>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <absl/container/flat_hash_map.h>
#include <absl/strings/ascii.h>
#include <absl/strings/match.h>
#include <absl/strings/str_cat.h>
#include <absl/types/span.h>
#include "a11/flow/diagnostic.h"

Namespaces

namespace  a11
 
namespace  a11::flow
 
namespace  a11::flow::discover
 Finding the actions a project declares, by reading its source.
 

Functions

std::optional< Language > a11::flow::discover::LanguageOf (std::string_view path)
 The language a path's extension says it is, or nullopt for a file this does not read.
 
catalogue::Catalogue a11::flow::discover::DiscoverInSource (std::string_view source, std::string_view path, Language language)
 The same, for one file whose text is already in hand.
 
Result a11::flow::discover::Discover (absl::Span< const std::string > roots, const Options &options=Options::Default())
 Every ActionSchema declared under roots, as a catalogue with origins.
 

Variable Documentation

◆ args_from

size_t args_from = 0

Where that call's arguments run, [from, to).

◆ args_to

size_t args_to = 0

◆ call

std::string call

The call the value is, where it is one: ActionPortSchema(..).

◆ computed_key

bool computed_key = false

Whether the key was written as [NAME], TypeScript syntax for a computed variable key.

◆ end

size_t end = 0

◆ flag

std::optional<bool> flag

The flag, where the value is true or false.

◆ is_object

bool is_object = false

◆ key

std::string key

◆ key_was_literal

bool key_was_literal = false

Whether the key was written as a string literal ("actions": ..) rather than as a bare word (name=.., text: ..).

The difference matters for a map key and only there: {PORT: ..} in Python is a dict whose key is a variable and has to be resolved, while {text: ..} in TypeScript is a property literally called text. A keyword argument's key is never a variable in either language, which is why resolving happens in [ReadPorts] and not here.

◆ keyed

bool keyed = false

◆ object_from

size_t object_from = 0

Where a {..} object runs, for a value that is one.

◆ object_to

size_t object_to = 0

◆ text

std::optional<std::string> text

The text, where the value is a string literal or a name bound to one.

◆ value

std::string value

◆ value_from

size_t value_from = 0

◆ value_to

size_t value_to = 0