blob: 20d50c1dacef7529c5357447a61edc00f34b5e99 [file] [log] [blame]
Benno Schulenbergc7b0e542014-05-17 11:44:35 +00001## Syntax highlighting for JSON files.
2
3# See: http://www.json.org/
4# Original author: Aapo Rantalainen
5# License: GPLv3 or newer
6
7syntax "json" "\.json$"
Mike Scalora6a2032f2016-05-25 22:13:50 +02008# No comments are permitted in JSON.
9comment ""
Benno Schulenbergc7b0e542014-05-17 11:44:35 +000010
11# Numbers (used as value).
12color green ":[[:space:]]*\-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee]?[-+]?[0-9]+)?"
13# Values (well, any string).
14color brightmagenta "\".+\""
15# Hex numbers (used as value).
16color green ":[[:space:]]*\"#[0-9abcdefABCDEF]+\""
17# Escapes.
18color green "\\\\" "\\\"" "\\[bfnrt]" "\\u[0-9abcdefABCDEF]{4})"
19# Special words.
20color green "(true|false|null)"
21
22# Names (very unlikely to contain a quote).
23color brightblue "\"[^"]+\"[[:space:]]*:"
24
25# Brackets, braces, and separators.
26color brightblue "\[" "\]"
27color brightred "\{" "\}"
28color brightred "," ":"
29
30# Comments.
31color cyan "(^|[[:space:]]+)(//|#).*$"
32
33# Trailing whitespace.
34color ,green "[[:space:]]+$"