dhcpkit.ipv6.server.pygments_plugin module

Extensions to Pygments to correctly parse DHCPKit config files

class dhcpkit.ipv6.server.pygments_plugin.DHCPKitConfLexer(**options)[source]

Bases: pygments.lexer.RegexLexer

Lexer for configuration files following the DHCPKit config file format.

aliases = ['dhcpkitconf', 'dhcpkit']
flags = 10
name = 'DHCPKitConf'
tokens = {'root': [('\\s+', Token.Text), ('(#.*?)$', Token.Comment), ('(<[^\\s>]+)(?:(\\s+)(.*?))?(>)', <function bygroups.<locals>.callback at 0x7f4f94f71488>), ('([a-z][\\w-]*)(\\s+)', <function bygroups.<locals>.callback at 0x7f4f94f71598>, 'value'), ('\\.+', Token.Text)], 'value': [('\\\\\\n', Token.Text), ('$', Token.Text, '#pop'), ('\\\\', Token.Text), ('[^\\S\\n]+', Token.Text), ('/([a-z0-9][\\w./-]+)', Token.Literal.String.Other), ('(on|off|yes|no|true|false|critical|error|warn|warning|info|debug-packets|debug-handling|debug|notset|authpriv|auth|cron|daemon|ftp|kern|lpr|mail|news|security|syslog|uucp|local[0-7]|udp|dgram|tcp|stream|hourly|hour|daily|day|weekly|week|size|user|group)\\b', Token.Keyword), ('"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"', Token.Literal.String.Double), ('[^\\s"\\\\]+', Token.Text)]}