This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/snippets/unixconfig/etc_group.txt
Leistungsabfall 29392ea678
Add lexer for colon-separated value config files like /etc/passwd, /etc/shadow and /etc/group (#2112)
* 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>
2022-04-16 08:36:49 +02:00

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