package c import ( . "github.com/alecthomas/chroma" // nolint "github.com/alecthomas/chroma/lexers/internal" ) // Coffeescript lexer. var Coffeescript = internal.Register(MustNewLexer( &Config{ Name: "CoffeeScript", Aliases: []string{"coffee-script", "coffeescript", "coffee"}, Filenames: []string{"*.coffee"}, MimeTypes: []string{"text/coffeescript"}, NotMultiline: true, DotAll: true, }, Rules{ "commentsandwhitespace": { {`\s+`, Text, nil}, {`###[^#].*?###`, CommentMultiline, nil}, {`#(?!##[^#]).*?\n`, CommentSingle, nil}, }, "multilineregex": { {`[^/#]+`, LiteralStringRegex, nil}, {`///([gim]+\b|\B)`, LiteralStringRegex, Pop(1)}, {`#\{`, LiteralStringInterpol, Push("interpoling_string")}, {`[/#]`, LiteralStringRegex, nil}, }, "slashstartsregex": { Include("commentsandwhitespace"), {`///`, LiteralStringRegex, Push("#pop", "multilineregex")}, {`/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)`, LiteralStringRegex, Pop(1)}, {`/`, Operator, nil}, Default(Pop(1)), }, "root": { Include("commentsandwhitespace"), {`^(?=\s|/)`, Text, Push("slashstartsregex")}, {"\\+\\+|~|&&|\\band\\b|\\bor\\b|\\bis\\b|\\bisnt\\b|\\bnot\\b|\\?|:|\\|\\||\\\\(?=\\n)|(<<|>>>?|==?(?!>)|!=?|=(?!>)|-(?!>)|[<>+*`%&\\|\\^/])=?", Operator, Push("slashstartsregex")}, {`(?:\([^()]*\))?\s*[=-]>`, NameFunction, Push("slashstartsregex")}, {`[{(\[;,]`, Punctuation, Push("slashstartsregex")}, {`[})\].]`, Punctuation, nil}, {`(?