Squashed commit of the following:

commit 95479c8ad744db48386a5c78e54ef8da80e9120b
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Apr 28 12:26:32 2021 -0400

    chore(version): bump version to 4.2.1

commit 6956f51cae
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Apr 28 12:24:21 2021 -0400

    fix(Makefile): `vendor-update`

    Update the `vendor-update` build target to run `go mod vendor` after
    updating dependencies.

commit 0aca411279
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Apr 28 12:23:24 2021 -0400

    chore(deps): update dependencies

commit e847956b02
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Apr 28 08:26:51 2021 -0400

    chore(deps): build updates

    - Upgrade `go` to `1.16.3`

    - Attempt to fix build errors regarding dependencies
This commit is contained in:
Chris Lane
2021-04-28 12:35:32 -04:00
parent 883a17092f
commit 55b18b4897
495 changed files with 16144 additions and 2927 deletions

View File

@ -6,14 +6,18 @@ import (
)
// R/S lexer.
var R = internal.Register(MustNewLexer(
var R = internal.Register(MustNewLazyLexer(
&Config{
Name: "R",
Aliases: []string{"splus", "s", "r"},
Filenames: []string{"*.S", "*.R", "*.r", ".Rhistory", ".Rprofile", ".Renviron"},
MimeTypes: []string{"text/S-plus", "text/S", "text/x-r-source", "text/x-r", "text/x-R", "text/x-r-history", "text/x-r-profile"},
},
Rules{
rRules,
))
func rRules() Rules {
return Rules{
"comments": {
{`#.*$`, CommentSingle, nil},
},
@ -62,5 +66,5 @@ var R = internal.Register(MustNewLexer(
"string_dquote": {
{`([^"\\]|\\.)*"`, LiteralString, Pop(1)},
},
},
))
}
}

View File

@ -6,14 +6,18 @@ import (
)
// Racket lexer.
var Racket = internal.Register(MustNewLexer(
var Racket = internal.Register(MustNewLazyLexer(
&Config{
Name: "Racket",
Aliases: []string{"racket", "rkt"},
Filenames: []string{"*.rkt", "*.rktd", "*.rktl"},
MimeTypes: []string{"text/x-racket", "application/x-racket"},
},
Rules{
racketRules,
))
func racketRules() Rules {
return Rules{
"root": {
{`[)\]}]`, Error, nil},
{`(?!\Z)`, Text, Push("unquoted-datum")},
@ -98,5 +102,5 @@ var Racket = internal.Register(MustNewLexer(
{`(?s)\\([0-7]{1,3}|x[\da-fA-F]{1,2}|u[\da-fA-F]{1,4}|U[\da-fA-F]{1,8}|.)`, LiteralStringEscape, nil},
{`[^\\"]+`, LiteralStringDouble, nil},
},
},
))
}
}

View File

@ -6,14 +6,18 @@ import (
)
// Ragel lexer.
var Ragel = internal.Register(MustNewLexer(
var Ragel = internal.Register(MustNewLazyLexer(
&Config{
Name: "Ragel",
Aliases: []string{"ragel"},
Filenames: []string{},
MimeTypes: []string{},
},
Rules{
ragelRules,
))
func ragelRules() Rules {
return Rules{
"whitespace": {
{`\s+`, TextWhitespace, nil},
},
@ -72,5 +76,5 @@ var Ragel = internal.Register(MustNewLexer(
{`\{`, Punctuation, Push()},
{`\}`, Punctuation, Pop(1)},
},
},
))
}
}

View File

@ -6,14 +6,18 @@ import (
)
// Reasonml lexer.
var Reasonml = internal.Register(MustNewLexer(
var Reasonml = internal.Register(MustNewLazyLexer(
&Config{
Name: "ReasonML",
Aliases: []string{"reason", "reasonml"},
Filenames: []string{"*.re", "*.rei"},
MimeTypes: []string{"text/x-reasonml"},
},
Rules{
reasonmlRules,
))
func reasonmlRules() Rules {
return Rules{
"escape-sequence": {
{`\\[\\"\'ntbr]`, LiteralStringEscape, nil},
{`\\[0-9]{3}`, LiteralStringEscape, nil},
@ -63,5 +67,5 @@ var Reasonml = internal.Register(MustNewLexer(
{`[a-z_][\w\']*`, Name, Pop(1)},
Default(Pop(1)),
},
},
))
}
}

View File

@ -6,14 +6,18 @@ import (
)
// Reg lexer.
var Reg = internal.Register(MustNewLexer(
var Reg = internal.Register(MustNewLazyLexer(
&Config{
Name: "reg",
Aliases: []string{"registry"},
Filenames: []string{"*.reg"},
MimeTypes: []string{"text/x-windows-registry"},
},
Rules{
regRules,
))
func regRules() Rules {
return Rules{
"root": {
{`Windows Registry Editor.*`, Text, nil},
{`\s+`, Text, nil},
@ -28,5 +32,5 @@ var Reg = internal.Register(MustNewLexer(
{`.+`, LiteralString, Pop(1)},
Default(Pop(1)),
},
},
))
}
}

View File

@ -6,7 +6,7 @@ import (
)
// Rexx lexer.
var Rexx = internal.Register(MustNewLexer(
var Rexx = internal.Register(MustNewLazyLexer(
&Config{
Name: "Rexx",
Aliases: []string{"rexx", "arexx"},
@ -15,7 +15,11 @@ var Rexx = internal.Register(MustNewLexer(
NotMultiline: true,
CaseInsensitive: true,
},
Rules{
rexxRules,
))
func rexxRules() Rules {
return Rules{
"root": {
{`\s`, TextWhitespace, nil},
{`/\*`, CommentMultiline, Push("comment")},
@ -55,5 +59,5 @@ var Rexx = internal.Register(MustNewLexer(
{`\*/`, CommentMultiline, Pop(1)},
{`\*`, CommentMultiline, nil},
},
},
))
}
}

View File

@ -8,14 +8,18 @@ import (
)
// Restructuredtext lexer.
var Restructuredtext = internal.Register(MustNewLexer(
var Restructuredtext = internal.Register(MustNewLazyLexer(
&Config{
Name: "reStructuredText",
Aliases: []string{"rst", "rest", "restructuredtext"},
Filenames: []string{"*.rst", "*.rest"},
MimeTypes: []string{"text/x-rst", "text/prs.fallenstein.rst"},
},
Rules{
restructuredtextRules,
))
func restructuredtextRules() Rules {
return Rules{
"root": {
{"^(=+|-+|`+|:+|\\.+|\\'+|\"+|~+|\\^+|_+|\\*+|\\++|#+)([ \\t]*\\n)(.+)(\\n)(\\1)(\\n)", ByGroups(GenericHeading, Text, GenericHeading, Text, GenericHeading, Text), nil},
{"^(\\S.*)(\\n)(={3,}|-{3,}|`{3,}|:{3,}|\\.{3,}|\\'{3,}|\"{3,}|~{3,}|\\^{3,}|_{3,}|\\*{3,}|\\+{3,}|#{3,})(\\n)", ByGroups(GenericHeading, Text, GenericHeading, Text), nil},
@ -56,8 +60,8 @@ var Restructuredtext = internal.Register(MustNewLexer(
{"``((?=$)|(?=[-/:.,; \\n\\x00\\\u2010\\\u2011\\\u2012\\\u2013\\\u2014\\\u00a0\\'\\\"\\)\\]\\}\\>\\\u2019\\\u201d\\\u00bb\\!\\?]))", LiteralString, Pop(1)},
{"`", LiteralString, nil},
},
},
))
}
}
func rstCodeBlock(groups []string, lexer Lexer) Iterator {
iterators := []Iterator{}

View File

@ -6,7 +6,7 @@ import (
)
// Ruby lexer.
var Ruby = internal.Register(MustNewLexer(
var Ruby = internal.Register(MustNewLazyLexer(
&Config{
Name: "Ruby",
Aliases: []string{"rb", "ruby", "duby"},
@ -14,7 +14,11 @@ var Ruby = internal.Register(MustNewLexer(
MimeTypes: []string{"text/x-ruby", "application/x-ruby"},
DotAll: true,
},
Rules{
rubyRules,
))
func rubyRules() Rules {
return Rules{
"root": {
{`\A#!.+?$`, CommentHashbang, nil},
{`#.*?$`, CommentSingle, nil},
@ -39,7 +43,7 @@ var Ruby = internal.Register(MustNewLexer(
{`(0_?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?`, ByGroups(LiteralNumberOct, Text, Operator), nil},
{`(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?`, ByGroups(LiteralNumberHex, Text, Operator), nil},
{`(0b[01]+(?:_[01]+)*)(\s*)([/?])?`, ByGroups(LiteralNumberBin, Text, Operator), nil},
{`([\d]+(?:_\d+)*)(\s*)([/?])?`, ByGroups(LiteralNumberInteger, Text, Operator), nil},
{`([\d]+(?:[_e]\d+)*)(\s*)([/?])?`, ByGroups(LiteralNumberInteger, Text, Operator), nil},
{`@@[a-zA-Z_]\w*`, NameVariableClass, nil},
{`@[a-zA-Z_]\w*`, NameVariableInstance, nil},
{`\$\w+`, NameVariableGlobal, nil},
@ -246,5 +250,5 @@ var Ruby = internal.Register(MustNewLexer(
{`[\\#<>]`, LiteralStringRegex, nil},
{`[^\\#<>]+`, LiteralStringRegex, nil},
},
},
))
}
}

View File

@ -6,7 +6,7 @@ import (
)
// Rust lexer.
var Rust = internal.Register(MustNewLexer(
var Rust = internal.Register(MustNewLazyLexer(
&Config{
Name: "Rust",
Aliases: []string{"rust"},
@ -14,7 +14,11 @@ var Rust = internal.Register(MustNewLexer(
MimeTypes: []string{"text/rust"},
EnsureNL: true,
},
Rules{
rustRules,
))
func rustRules() Rules {
return Rules{
"root": {
{`#![^[\r\n].*$`, CommentPreproc, nil},
Default(Push("base")),
@ -131,5 +135,5 @@ var Rust = internal.Register(MustNewLexer(
{`\);?`, CommentPreproc, Pop(1)},
{`[^")]+`, CommentPreproc, nil},
},
},
))
}
}