mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 19:47:22 +00:00
Highlighted code blocks inside the app (#1153)
This commit is contained in:
1 parent
0b42c0288e
commit
f4a86c2fb8
60 files changed
+2550
-41
No files matched your search
@@ -0,0 +1,30 @@
|
||||
namespace AIStudio.Tools.CodeHighlighting.Languages;
|
||||
|
||||
/// <summary>
|
||||
/// How a script of a Unix shell, such as Bash, looks to the tokenizer.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A # starts a comment only at the start of a word, so $# and ${#list[@]} stay variables. Strings may
|
||||
/// run over several lines, and the variables within double quotation marks stay a part of the string.
|
||||
/// </remarks>
|
||||
public static class ShellCodeRules
|
||||
{
|
||||
public static readonly CodeLanguageRules RULES = new()
|
||||
{
|
||||
Keywords = CodeLanguageRules.Words(
|
||||
"break", "case", "continue", "declare", "do", "done", "elif", "else", "esac", "exit", "export", "fi", "for",
|
||||
"function", "if", "in", "local", "readonly", "return", "select", "source", "then", "time", "until", "unset",
|
||||
"while"),
|
||||
|
||||
FunctionDeclarations = CodeLanguageRules.Words("function"),
|
||||
LineComments = ["#"],
|
||||
LineCommentsNeedSeparator = true,
|
||||
Strings =
|
||||
[
|
||||
new("\"", "\"", IsMultiline: true),
|
||||
new("'", "'", Escape: null, IsMultiline: true),
|
||||
],
|
||||
|
||||
VariablePrefix = '$',
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user