SILICON
Loading...
Searching...
No Matches
codeSyntax.hpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2026. Giulio Cocconi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include <span>
21#include <string>
22#include <string_view>
23
24namespace SILICON::ui {
25
41
44 std::span<const std::string_view> words;
45};
46
51
54 std::string_view pattern;
55 std::span<const CodeSyntaxContainedRule> containedRules;
56};
57
60 std::string_view startPattern;
61 std::string_view endPattern;
62 std::string_view skipPattern;
63 std::span<const CodeSyntaxContainedRule> containedRules;
65};
66
68 std::string_view currentLine;
69 std::span<const std::string_view> previousNonBlankLines;
71};
72
73using CodeIndentationFunction = std::string (*)(const CodeIndentationContext&);
74
82
84struct CodeSyntax {
85 std::span<const CodeSyntaxKeywordGroup> keywordGroups;
86 std::span<const CodeSyntaxMatchRule> matchRules;
87 std::span<const CodeSyntaxRegionRule> regionRules;
88 std::string_view extraWordCharacters;
90};
91
93extern const CodeSyntax SISL_CODE_SYNTAX;
94
95} // namespace SILICON::ui
std::string(*)(const CodeIndentationContext &) CodeIndentationFunction
const CodeSyntax SISL_CODE_SYNTAX
Definition sisl.cpp:101
const CodeSyntax VERILOG_CODE_SYNTAX
Definition verilog.cpp:437
std::span< const std::string_view > previousNonBlankLines
CodeIndentationFunction indentationFor
std::span< const std::string_view > triggerPatterns
std::span< const std::string_view > words
std::span< const CodeSyntaxContainedRule > containedRules
std::span< const CodeSyntaxContainedRule > containedRules
const CodeIndentation * indentation
std::string_view extraWordCharacters
std::span< const CodeSyntaxMatchRule > matchRules
std::span< const CodeSyntaxKeywordGroup > keywordGroups
std::span< const CodeSyntaxRegionRule > regionRules