You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bnf.go 490B

123456789101112131415161718192021222324
  1. package b
  2. import (
  3. . "github.com/alecthomas/chroma" // nolint
  4. "github.com/alecthomas/chroma/lexers/internal"
  5. )
  6. // Bnf lexer.
  7. var Bnf = internal.Register(MustNewLexer(
  8. &Config{
  9. Name: "BNF",
  10. Aliases: []string{"bnf"},
  11. Filenames: []string{"*.bnf"},
  12. MimeTypes: []string{"text/x-bnf"},
  13. },
  14. Rules{
  15. "root": {
  16. {`(<)([ -;=?-~]+)(>)`, ByGroups(Punctuation, NameClass, Punctuation), nil},
  17. {`::=`, Operator, nil},
  18. {`[^<>:]+`, Text, nil},
  19. {`.`, Text, nil},
  20. },
  21. },
  22. ))