* 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>
74 lines
2 KiB
Text
74 lines
2 KiB
Text
---input---
|
|
root:$6$L95fNbtS$IZ8affe7h2B.DF81HZ:17262:0:14600:14:::
|
|
#nobody:*:18375:0:99999:7:::
|
|
bin:*:17110:0:99999:7:::
|
|
user:$6$KmghZnvbZs7f3SQ9$H6f0M61q5Cf8JLrS0kR3M97/o6GzD6FH3MbLs92CM/l9mHZ7FngBzRfa8D5NrWl.K8nM64affeWrY/L0U7nBt/:19097:0:99999:7:::
|
|
linoadmin:!!:17289:0:99999:7:::
|
|
|
|
---tokens---
|
|
'root' Text
|
|
':' Punctuation
|
|
'$6$L95fNbtS$IZ8affe7h2B.DF81HZ' Literal.String
|
|
':' Punctuation
|
|
'17262' Literal.Number
|
|
':' Punctuation
|
|
'0' Literal.Number
|
|
':' Punctuation
|
|
'14600' Literal.Number
|
|
':' Punctuation
|
|
'14' Literal.Number
|
|
':' Punctuation
|
|
':' Punctuation
|
|
':' Punctuation
|
|
'\n' Text.Whitespace
|
|
|
|
'#nobody:*:18375:0:99999:7:::' Comment
|
|
'\n' Text.Whitespace
|
|
|
|
'bin' Text
|
|
':' Punctuation
|
|
'*' Literal.String
|
|
':' Punctuation
|
|
'17110' Literal.Number
|
|
':' Punctuation
|
|
'0' Literal.Number
|
|
':' Punctuation
|
|
'99999' Literal.Number
|
|
':' Punctuation
|
|
'7' Literal.Number
|
|
':' Punctuation
|
|
':' Punctuation
|
|
':' Punctuation
|
|
'\n' Text.Whitespace
|
|
|
|
'user' Text
|
|
':' Punctuation
|
|
'$6$KmghZnvbZs7f3SQ9$H6f0M61q5Cf8JLrS0kR3M97/o6GzD6FH3MbLs92CM/l9mHZ7FngBzRfa8D5NrWl.K8nM64affeWrY/L0U7nBt/' Literal.String
|
|
':' Punctuation
|
|
'19097' Literal.Number
|
|
':' Punctuation
|
|
'0' Literal.Number
|
|
':' Punctuation
|
|
'99999' Literal.Number
|
|
':' Punctuation
|
|
'7' Literal.Number
|
|
':' Punctuation
|
|
':' Punctuation
|
|
':' Punctuation
|
|
'\n' Text.Whitespace
|
|
|
|
'linoadmin' Text
|
|
':' Punctuation
|
|
'!!' Literal.String
|
|
':' Punctuation
|
|
'17289' Literal.Number
|
|
':' Punctuation
|
|
'0' Literal.Number
|
|
':' Punctuation
|
|
'99999' Literal.Number
|
|
':' Punctuation
|
|
'7' Literal.Number
|
|
':' Punctuation
|
|
':' Punctuation
|
|
':' Punctuation
|
|
'\n' Text.Whitespace
|