diff --git a/content/treehouse/dev/syntax-highlighting.tree b/content/treehouse/dev/syntax-highlighting.tree index 167ac45..2526ac6 100644 --- a/content/treehouse/dev/syntax-highlighting.tree +++ b/content/treehouse/dev/syntax-highlighting.tree @@ -91,3 +91,44 @@ ``` note that `[^]` is not the same as `.`, because the latter omits newlines. + +% id = "01HRT0W4AKQJEAMJ8XHJVMY4ZV" +- `json` + + % id = "01HRT0W4AKPFENNFWMA7AAGN5Z" + - patterns + ```json + abcd + 0.912392198e+2113 + "abcd": + "abcd" + , + ``` + + % id = "01HRT0W4AK8D1W9ZN9HJTHC85Q" + - keywords + ```json + null true false + ``` + + % id = "01HRT0W4AK4F2S65M1NT75PCGQ" + - sample + ```json + { + "patterns": [ + { "regex": "[a-zA-Z_][a-zA-Z0-9_]*", "is": "error" }, + { "regex": "[0-9]+(\\.[0-9]*([eE][-+]?[0-9]+)?)?", "is": "literal" }, + { + "regex": "\"(\\\\\"|[^\"])*\"(:)", + "is": { "default": "keyword2", "captures": ["keyword2", "punct"] } + }, + { "regex": "\"(\\\\\"|[^\"])*\"", "is": "string" }, + { "regex": "[,]", "is": "punct" } + ], + "keywords": { + "null": { "into": "literal" }, + "true": { "into": "literal" }, + "false": { "into": "literal" } + } + } + ```