Added tcpdump lexer

Some indentation fixes
This commit is contained in:
Jesse Portnoy
2025-03-25 15:49:23 +00:00
parent 09ec4f4a7f
commit bf17668d56
4 changed files with 38 additions and 21 deletions
+19 -18
View File
@@ -1,3 +1,4 @@
---
filetype: markdown
detect:
@@ -7,43 +8,43 @@ rules:
# Tables (Github extension)
- type: ".*[ :]\\|[ :].*"
# quotes
- statement: "^>.*"
# quotes
- statement: "^>.*"
# Emphasis
# Emphasis
- type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)"
# Strong emphasis
# Strong emphasis
- type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)"
# strike-through
# strike-through
- type: "(^|[[:space:]])~~[^ ][^~]*~~"
# horizontal rules
# horizontal rules
- special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$"
# headlines
- special: "^#{1,6}.*"
# headlines
- special: "^#{1,6}.*"
# lists
- identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. "
# lists
- identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. "
# misc
- preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))"
# misc
- preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))"
# links
# links
- constant: "\\[[^]]+\\]"
- constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)"
# images
# images
- underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])"
# urls
# urls
- underlined: "https?://[^ )>]+"
- special: "^```$"
- special:
start: "`"
end: "`"
rules: []
start: "`"
end: "`"
rules: []
+2 -2
View File
@@ -1,3 +1,4 @@
---
filetype: serverlog
detect:
@@ -8,8 +9,7 @@ rules:
- preproc: "([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})"
- preproc: "\\\\."
- preproc: "(\\[(error|warning|info|warn)\\])"
- constant.specialChar: "((GET|POST|HEAD)\\ [^\\ ]+)"
- constant.specialChar: "((GET|POST|HEAD)\\ [^\\ ]+)"
- comment: "(referer\\: .*)"
- statement: "[[:space:]]([0-9~:.]{2,}[-+:.0-9a-z~]+)[[:space:]]"
- type: "(Mozilla|Chrome|Safari|Firefox|AppleWebKit|Linux x86_64|Gecko|Windows|Mac)"
+1 -1
View File
@@ -12,7 +12,7 @@ rules:
# Shell commands
- type: "\\b(cd|echo|export|let|set|umask|unset)\\b"
# Common linux commands
- type: "\\b((g|ig)?awk|bash|dash|find|\\w{0,4}grep|kill|killall|\\w{0,4}less|make|pkill|sed|sh|tar|ping|traceroute|service|apt|apt-get|aptitude|yum)\\b"
- type: "\\b((g|ig)?awk|bash|dash|find|\\w{0,4}grep|kill|killall|\\w{0,4}less|make|pkill|sed|sh|tar|ping|traceroute|service|dpkg|apt|apt-get|apt-cache|aptitude|dpkg-buildpackage|yum)\\b"
# Coreutils commands
- type: "\\b(which|sudo|base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|(l)?dd|df|dir|dircolors|dirname|du|env|expand|expr|factor|false|fmt|fold|head|hostid|id|install|join|link|ln|logname|ls|md5sum|mkdir|mkfifo|mknod|mktemp|mv|nice|nl|nohup|nproc|numfmt|od|paste|pathchk|pinky|pr|printenv|printf|ptx|pwd|readlink|realpath|rm|rmdir|runcon|seq|(sha1|sha224|sha256|sha384|sha512)sum|shred|shuf|sleep|sort|split|stat|stdbuf|stty|sum|sync|tac|tail|tee|test|time|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\\b"
- identifier.var: "(^([[:space:]]+)?[A-Za-z0-9_]+)"
+16
View File
@@ -0,0 +1,16 @@
---
filetype: tcpdump
detect:
filename: "\\.tcpdump$"
rules:
- yellow: "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.([0-9]+|[a-z]+)"
- constant.number: "(\\[[^]]+\\])"
- preproc: "([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})"
- cyan: "^(\\d+):(\\d+):(\\d+)"
- red: "(\\s+\\d+)/(\\w+).*"
- magenta: "options\\s\\[.*\\].*"
- magenta: "\\s+([a-zA-Z-]+)$"
- comment: "\\s(seq|ack|win|IP)\\s"
- yellow: "\\s+([a-z-]+\\.)?[a-z-]+\\.[a-z-]+\\.[a-z-]+"