...

Source file src/github.com/alecthomas/chroma/lexers/w/wdte.go

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

     1  package w
     2  
     3  import (
     4  	. "github.com/alecthomas/chroma" // nolint
     5  	"github.com/alecthomas/chroma/lexers/internal"
     6  )
     7  
     8  // WDTE lexer.
     9  var WDTE = internal.Register(MustNewLazyLexer(
    10  	&Config{
    11  		Name:      "WDTE",
    12  		Filenames: []string{"*.wdte"},
    13  	},
    14  	wdteRules,
    15  ))
    16  
    17  func wdteRules() Rules {
    18  	return Rules{
    19  		"root": {
    20  			{`\n`, Text, nil},
    21  			{`\s+`, Text, nil},
    22  			{`\\\n`, Text, nil},
    23  			{`#(.*?)\n`, CommentSingle, nil},
    24  			{`-?[0-9]+`, LiteralNumberInteger, nil},
    25  			{`-?[0-9]*\.[0-9]+`, LiteralNumberFloat, nil},
    26  			{`"[^"]*"`, LiteralString, nil},
    27  			{`'[^']*'`, LiteralString, nil},
    28  			{Words(``, `\b`, `switch`, `default`, `memo`), KeywordReserved, nil},
    29  			{`{|}|;|->|=>|\(|\)|\[|\]|\.`, Operator, nil},
    30  			{`[^{};()[\].\s]+`, NameVariable, nil},
    31  		},
    32  	}
    33  }
    34  

View as plain text