Also, colorize more quoted symbols and booleans, make the green for syntax words and the blue for keywords lighter, and show comments in grey italics. Also, don't miscolorize some empty strings as if they were the start of a multiline string. This addresses most of https://savannah.gnu.org/patch/?10558.
31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
## Syntax highlighting for Guile Scheme.
|
||
|
||
## Original authors: Mark Oteiza and Benno Schulenberg
|
||
## License: GPL version 3 or newer
|
||
|
||
syntax guile "\.(scm|sld|sls|ss)$"
|
||
header "^#!.*guile"
|
||
comment ";"
|
||
|
||
# Basic syntax
|
||
color lightgreen "\<((and|begin|case|cond|do|else|if|lambda|let(rec)?|or|quote|unless|when)\>|let\*|set!)"
|
||
# Basic procedures
|
||
color lightcyan "\<((append|apply|c[ad]{1,4}r|cons|display|for-each|list|map|newline)\>|reverse(\>|!)|set-c[ad]r!)"
|
||
color lightcyan "\<(boolean|char(-ci)?[<>]?=?|complex|eqv?|even|integer|list|nan|negative|null|number|odd|pair|positive|rational|real|string|symbol|vector|zero)\?"
|
||
color lightcyan "\<(abs|a?(cos|sin|tan)|ceiling|exp|floor|max|min|modulo|not|random|round|quotient|sqrt|square|truncate)\>"
|
||
# Defining things
|
||
color brightgreen "\<define(-macro|-module|-public|-syntax)?\>"
|
||
# Quoted symbols
|
||
color lightyellow "'(\w|[!$%&*+/:<=>?@^_~])(\w|[!$%&*+/:<=>?@^_~.0-9-])*"
|
||
# Characters
|
||
color brightmagenta "#\\(.|\w+)"
|
||
# Booleans
|
||
color brightred "#(t|true|f|false)\>"
|
||
# Keywords
|
||
color lagoon "#?:(\w|[?-])+"
|
||
# Strings
|
||
color yellow start="^[[:blank:]]*"([^"\]|\\.)*$" end="(^|[^\]|[^\]\\\\)""
|
||
color yellow ""([^"\]|\\.)*""
|
||
# Comments
|
||
color italic,#aaa "(^|[[:blank:]]);.*"
|