From c6cc0108ca7738023b45e0eeac0fa2390532dd93 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Fri, 25 Oct 2024 00:47:47 +0200 Subject: Added vendor lock on deps --- .../alecthomas/chroma/v2/lexers/mason.go | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 vendor/github.com/alecthomas/chroma/v2/lexers/mason.go (limited to 'vendor/github.com/alecthomas/chroma/v2/lexers/mason.go') diff --git a/vendor/github.com/alecthomas/chroma/v2/lexers/mason.go b/vendor/github.com/alecthomas/chroma/v2/lexers/mason.go new file mode 100644 index 0000000..57e6120 --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/v2/lexers/mason.go @@ -0,0 +1,44 @@ +package lexers + +import ( + . "github.com/alecthomas/chroma/v2" // nolint +) + +// Mason lexer. +var Mason = Register(MustNewLexer( + &Config{ + Name: "Mason", + Aliases: []string{"mason"}, + Filenames: []string{"*.m", "*.mhtml", "*.mc", "*.mi", "autohandler", "dhandler"}, + MimeTypes: []string{"application/x-mason"}, + Priority: 0.1, + }, + masonRules, +)) + +func masonRules() Rules { + return Rules{ + "root": { + {`\s+`, Text, nil}, + {`(<%doc>)(.*?)()(?s)`, ByGroups(NameTag, CommentMultiline, NameTag), nil}, + {`(<%(?:def|method))(\s*)(.*?)(>)(.*?)()(?s)`, ByGroups(NameTag, Text, NameFunction, NameTag, UsingSelf("root"), NameTag), nil}, + {`(<%\w+)(.*?)(>)(.*?)()(?s)`, ByGroups(NameTag, NameFunction, NameTag, Using("Perl"), NameTag), nil}, + {`(<&[^|])(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using("Perl"), NameTag), nil}, + {`(<&\|)(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using("Perl"), NameTag), nil}, + {``, NameTag, nil}, + {`(<%!?)(.*?)(%>)(?s)`, ByGroups(NameTag, Using("Perl"), NameTag), nil}, + {`(?<=^)#[^\n]*(\n|\Z)`, Comment, nil}, + {`(?<=^)(%)([^\n]*)(\n|\Z)`, ByGroups(NameTag, Using("Perl"), Other), nil}, + {`(?sx) + (.+?) # anything, followed by: + (?: + (?<=\n)(?=[%#]) | # an eval or comment line + (?=