A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
generate.h
Go to the documentation of this file.
1/*
2 * Copyright 2026 The A11 Authors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef A11_FLOW_GENERATE_H_
18#define A11_FLOW_GENERATE_H_
19
20#include <string>
21#include <string_view>
22
23#include <absl/types/span.h>
24
25namespace a11::flow {
26
28enum class SyntaxTarget {
37 // `editors/vscode/a11flow.tmLanguage.json`: a TextMate grammar in the JSON
38 // dialect VSCode reads.
49 kVsCode,
50 // `editors/vscode/a11flow-injection.tmLanguage.json`: the same words, as an
51 // injection into the string literals of a host language.
61};
62
64absl::Span<const SyntaxTarget> SyntaxTargets();
65
68
71
74
90
91} // namespace a11::flow
92
93#endif // A11_FLOW_GENERATE_H_
std::string name
The name and its colon, which travel together because they always do.
Definition format.cc:49
Definition boundary.cc:32
absl::Span< const SyntaxTarget > SyntaxTargets()
Every target, for a command that offers a choice of them.
SyntaxTarget
An editor definition the language can write for itself.
Definition generate.h:28
@ kPygments
editors/pygments/a11flow_lexer.py: a Pygments lexer, which is what colours a fenced flow in A11's own...
@ kSublime
editors/sublime-text/A11 Flow.sublime-syntax: a Sublime/TextMate-family YAML grammar,...
@ kVsCodeInjection
editors/vscode/a11flow-injection.tmLanguage.json: the same words, as an injection into the string lit...
@ kVsCode
editors/vscode/a11flow.tmLanguage.json: a TextMate grammar in the JSON dialect VSCode reads.
std::string GenerateSyntax(SyntaxTarget target)
The whole definition, generated.
std::string_view SyntaxTargetPath(SyntaxTarget target)
Where the generated file belongs, relative to the repository root.
std::string_view SyntaxTargetName(SyntaxTarget target)
The name a target is asked for by: sublime.
bool SyntaxTargetFromName(std::string_view name, SyntaxTarget &target)
A target from its name, or nullopt.
std::string target
Which editor definition syntax is about; every one when empty, which is the default.
Definition main.cc:74