|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
#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. | |
| size_t args_from = 0 |
Where that call's arguments run, [from, to).
| size_t args_to = 0 |
| std::string call |
The call the value is, where it is one: ActionPortSchema(..).
| bool computed_key = false |
Whether the key was written as [NAME], TypeScript syntax for a computed variable key.
| size_t end = 0 |
| std::optional<bool> flag |
The flag, where the value is true or false.
| bool is_object = false |
| std::string key |
| 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.
| bool keyed = false |
| size_t object_from = 0 |
Where a {..} object runs, for a value that is one.
| size_t object_to = 0 |
| std::optional<std::string> text |
The text, where the value is a string literal or a name bound to one.
| std::string value |
| size_t value_from = 0 |
| size_t value_to = 0 |