mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 04:47:21 +00:00
27 lines
919 B
C#
27 lines
919 B
C#
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("'", "'"),
|
|
],
|
|
};
|
|
} |