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 filetype: markdown
detect: detect:
@@ -7,43 +8,43 @@ rules:
# Tables (Github extension) # Tables (Github extension)
- type: ".*[ :]\\|[ :].*" - type: ".*[ :]\\|[ :].*"
# quotes # quotes
- statement: "^>.*" - statement: "^>.*"
# Emphasis # Emphasis
- type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)" - type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)"
# Strong emphasis # Strong emphasis
- type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)" - type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)"
# strike-through # strike-through
- type: "(^|[[:space:]])~~[^ ][^~]*~~" - type: "(^|[[:space:]])~~[^ ][^~]*~~"
# horizontal rules # horizontal rules
- special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$" - special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$"
# headlines # headlines
- special: "^#{1,6}.*" - special: "^#{1,6}.*"
# lists # lists
- identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. " - identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. "
# misc # misc
- preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))" - preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))"
# links # links
- constant: "\\[[^]]+\\]" - constant: "\\[[^]]+\\]"
- constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)" - constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)"
# images # images
- underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])" - underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])"
# urls # urls
- underlined: "https?://[^ )>]+" - underlined: "https?://[^ )>]+"
- special: "^```$" - special: "^```$"
- special: - special:
start: "`" start: "`"
end: "`" end: "`"
rules: [] rules: []
+1 -1
View File
@@ -1,3 +1,4 @@
---
filetype: serverlog filetype: serverlog
detect: detect:
@@ -12,4 +13,3 @@ rules:
- comment: "(referer\\: .*)" - comment: "(referer\\: .*)"
- statement: "[[:space:]]([0-9~:.]{2,}[-+:.0-9a-z~]+)[[:space:]]" - statement: "[[:space:]]([0-9~:.]{2,}[-+:.0-9a-z~]+)[[:space:]]"
- type: "(Mozilla|Chrome|Safari|Firefox|AppleWebKit|Linux x86_64|Gecko|Windows|Mac)" - type: "(Mozilla|Chrome|Safari|Firefox|AppleWebKit|Linux x86_64|Gecko|Windows|Mac)"
+1 -1
View File
@@ -12,7 +12,7 @@ rules:
# Shell commands # Shell commands
- type: "\\b(cd|echo|export|let|set|umask|unset)\\b" - type: "\\b(cd|echo|export|let|set|umask|unset)\\b"
# Common linux commands # 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 # 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" - 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_]+)" - 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-]+"