# Seed7 syntax highlighting for Nano editor.
# On Debian distros, this file lives in $HOME/.config/nano
# The global nanorc files are in /usr/share/nano
# Change the colours to suit your taste.

syntax "seed7" "\.s(d7|7i)"

## Keywords
color brightblue "\<(begin|block|case|const|do|downto|else|elsif|end|enum|exception|for|forward|func|false|if|in|include|inout|is|local|new|of|otherwise|param|range|ref|repeat|result|return|step|struct|syntax|system|then|to|true|until|val|var|when|while)\>"

## Types
color brightred "array|bigInteger|bigRational|bin32|bin64|bitset|boolean|char|clib_file|color|complex|duration|expr|file|float|func|hash|integer|object|proc|program|rational|reference|ref_list|set|string|text|time|type|varfunc|void"

## Keyword correction
color brightblue "\<(end func)\>"

## Operator symbols
color cyan "\+(:=)?|-(:=|>(<-)?)?|\*(:=|\*)?|/(:=)?|<([=>&]|<(:=)?|-(>)?)?|>([=<]|>(:=)?)?|:=?|\^|&(:=)?|@:="

## Named operators
color brightblue "\<(and|conv|digits|div|exp|lpad|lpad0|mdiv|mod|mult|not|or|parse|rem|rpad|sci|times|varconv)\>"

## Function names
color brightcyan "read|readln|write|writeln"

## Numeric literals
color brightmagenta "\<[0-9]+(_|#[0-9a-zA-Z]+_?|[Ee](\+|-)?[0-9]+|\.[0-9]+([Ee](\+|-)?[0-9]+)?)?\>"

## String literals
color magenta "("|\\)([^"\\]|\\([abefnrtv\\'"A-Z]|[0-9]+(#[0-9a-zA-Z]+)?;)|"")*("|\\([ \t]|$))"

## Char literals
color magenta "'([^\\]|\\([abefnrtv\\'"A-Z]|[0-9]+(#[0-9a-fA-F]+)?))*'"

## Line comment
color green "(^|[ \t!"\$%&'\(\)\*\+,\-\.:;<=>\?a-zA-Z])#.*$"

## Block comment
color green "\(\*(.|$[ \t]*^)*\*\)"
color green start="\(\*" end="\*\)"
