mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 07:07:21 +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,27 @@
|
||||
namespace AIStudio.Tools.CodeHighlighting.Languages;
|
||||
|
||||
/// <summary>
|
||||
/// How Lua code looks to the tokenizer, the language of the plugins of AI Studio, too.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Lua writes long strings and comments in brackets, such as [[ … ]] and --[==[ … ]==].
|
||||
/// </remarks>
|
||||
public static class LuaCodeRules
|
||||
{
|
||||
public static readonly CodeLanguageRules RULES = new()
|
||||
{
|
||||
Keywords = CodeLanguageRules.Words(
|
||||
"and", "break", "do", "else", "elseif", "end", "for", "function", "goto", "if", "in", "local", "not", "or",
|
||||
"repeat", "return", "then", "until", "while"),
|
||||
|
||||
Literals = CodeLanguageRules.Words("nil", "true", "false"),
|
||||
FunctionDeclarations = CodeLanguageRules.Words("function"),
|
||||
LineComments = ["--"],
|
||||
HasLongBrackets = true,
|
||||
Strings =
|
||||
[
|
||||
new("\"", "\""),
|
||||
new("'", "'"),
|
||||
],
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user