...

Source file src/github.com/alecthomas/chroma/lexers/c/coldfusion.go

Documentation: github.com/alecthomas/chroma/lexers/c

     1  package c
     2  
     3  import (
     4  	. "github.com/alecthomas/chroma" // nolint
     5  	"github.com/alecthomas/chroma/lexers/internal"
     6  )
     7  
     8  // Cfstatement lexer.
     9  var Cfstatement = internal.Register(MustNewLazyLexer(
    10  	&Config{
    11  		Name:            "cfstatement",
    12  		Aliases:         []string{"cfs"},
    13  		Filenames:       []string{},
    14  		MimeTypes:       []string{},
    15  		NotMultiline:    true,
    16  		CaseInsensitive: true,
    17  	},
    18  	cfstatementRules,
    19  ))
    20  
    21  func cfstatementRules() Rules {
    22  	return Rules{
    23  		"root": {
    24  			{`//.*?\n`, CommentSingle, nil},
    25  			{`/\*(?:.|\n)*?\*/`, CommentMultiline, nil},
    26  			{`\+\+|--`, Operator, nil},
    27  			{`[-+*/^&=!]`, Operator, nil},
    28  			{`<=|>=|<|>|==`, Operator, nil},
    29  			{`mod\b`, Operator, nil},
    30  			{`(eq|lt|gt|lte|gte|not|is|and|or)\b`, Operator, nil},
    31  			{`\|\||&&`, Operator, nil},
    32  			{`\?`, Operator, nil},
    33  			{`"`, LiteralStringDouble, Push("string")},
    34  			{`'.*?'`, LiteralStringSingle, nil},
    35  			{`\d+`, LiteralNumber, nil},
    36  			{`(if|else|len|var|xml|default|break|switch|component|property|function|do|try|catch|in|continue|for|return|while|required|any|array|binary|boolean|component|date|guid|numeric|query|string|struct|uuid|case)\b`, Keyword, nil},
    37  			{`(true|false|null)\b`, KeywordConstant, nil},
    38  			{`(application|session|client|cookie|super|this|variables|arguments)\b`, NameConstant, nil},
    39  			{`([a-z_$][\w.]*)(\s*)(\()`, ByGroups(NameFunction, Text, Punctuation), nil},
    40  			{`[a-z_$][\w.]*`, NameVariable, nil},
    41  			{`[()\[\]{};:,.\\]`, Punctuation, nil},
    42  			{`\s+`, Text, nil},
    43  		},
    44  		"string": {
    45  			{`""`, LiteralStringDouble, nil},
    46  			{`#.+?#`, LiteralStringInterpol, nil},
    47  			{`[^"#]+`, LiteralStringDouble, nil},
    48  			{`#`, LiteralStringDouble, nil},
    49  			{`"`, LiteralStringDouble, Pop(1)},
    50  		},
    51  	}
    52  }
    53  

View as plain text