* add PasswdLexer and ShadowLexer for lexing /etc/passwd and /etc/shadow * fix regex * Update pygments/lexers/configs.py Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr> * address review comments * update _mapping.py * Create united lexer UnixConfigLexer for config files using colon-separated values, typically used in Unix/Linux system config files. * format docstring * UnixConfigLexer: add whitespace detection * add test snippets for UnixConfigLexer * address review comment Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr> Co-authored-by: Leistungsabfall <Leistungsabfall@users.noreply.github.com>
45 lines
912 B
Text
45 lines
912 B
Text
---input---
|
|
root:x:0:
|
|
sudo:x:1:syslog,user
|
|
syslog:x:2:
|
|
#adm:x:3:
|
|
|
|
user:x:1000
|
|
|
|
---tokens---
|
|
'root' Text
|
|
':' Punctuation
|
|
'x' Literal.String
|
|
':' Punctuation
|
|
'0' Literal.Number
|
|
':' Punctuation
|
|
'\n' Text.Whitespace
|
|
|
|
'sudo' Text
|
|
':' Punctuation
|
|
'x' Literal.String
|
|
':' Punctuation
|
|
'1' Literal.Number
|
|
':' Punctuation
|
|
'syslog,user' Text
|
|
'\n' Text.Whitespace
|
|
|
|
'syslog' Text
|
|
':' Punctuation
|
|
'x' Literal.String
|
|
':' Punctuation
|
|
'2' Literal.Number
|
|
':' Punctuation
|
|
'\n' Text.Whitespace
|
|
|
|
'#adm:x:3:' Comment
|
|
'\n' Text.Whitespace
|
|
|
|
'\n' Text.Whitespace
|
|
|
|
'user' Text
|
|
':' Punctuation
|
|
'x' Literal.String
|
|
':' Punctuation
|
|
'1000' Literal.Number
|
|
'\n' Text.Whitespace
|