Skip to content

Instantly share code, notes, and snippets.

@anthonykasza
Created April 24, 2020 22:28
Show Gist options
  • Save anthonykasza/2d74bcd0c2f76280b242172b934b83a8 to your computer and use it in GitHub Desktop.
Save anthonykasza/2d74bcd0c2f76280b242172b934b83a8 to your computer and use it in GitHub Desktop.
spicy nano syntax
syntax "spicy" "\.spicy$"
color magenta "\w+\("
color magenta "\$\w+"
color magenta "\?\w+"
color brightcyan "public|global|const|local"
color brightcyan "\b(print|on|foreach|stop|switch|case|default|if|new|in|inout|exception|throw|try|catch|assert|break|for|return|while|from|continue)\b"
color brightcyan "module|import"
color cyan "\<(type|bytes|unit|\(not set\)|addr|bitfield|enum|void|iterator|sink|stream|view|tuple|bool|struct|map|real|regexp|set|error|function)\>"
color cyan "u?int(8|16|32|64)"
color cyan "[0-9]+\/(tcp|udp|icmp)"
color green "(:|\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|& |&&|\||\?|%|\+|\*|-\W|\^|,|\.)"
color yellow "(\w+?)::\b"
color yellow "\bself\b"
color yellow "(\$){2}"
color yellow "(\$\.)"
color yellow "(\.\$)"
color brightgreen "\&(default|byte-order|convert|eod|optional|bit-order|size|until|chunked|type|string|vector|until_including|while|parse-from|parse-at)"
icolor red "\%(init|done|error|byte-order|mime-type|description|port|ipv4|ipv6|random-access|filter|debug)"
icolor red "\%(on_gap|on_overlap|on_skipped|on_skipped)"
icolor brightred "@(\w|-)+"
color brightyellow "b?"(\\.|[^"])*"" "'(\\.|[^'])*'"
color brightyellow "\/.*?\/"
# Comments
color blue "(^|[[:space:]])#.*$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment