2022-01-15 21:13:47 +02:00
|
|
|
HOCON = Human-Optimized Config Object Notation
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @field
|
|
|
|
|
// ^ @string
|
|
|
|
|
// ^ @string
|
|
|
|
|
// ^ @string
|
|
|
|
|
// ^ @string
|
2022-01-15 21:13:47 +02:00
|
|
|
|
|
|
|
|
"it's": "a JSON\nsuperset",
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @string
|
|
|
|
|
// ^ @string.escape
|
|
|
|
|
// ^ @punctuation.delimiter
|
2022-01-15 21:13:47 +02:00
|
|
|
|
|
|
|
|
features: [
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @operator
|
|
|
|
|
// ^ @punctuation.bracket
|
2022-01-15 21:13:47 +02:00
|
|
|
less noisy / less pedantic syntax
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @string
|
2022-01-15 21:13:47 +02:00
|
|
|
ability to refer to another part of the configuration
|
|
|
|
|
import/include another configuration file into the current file
|
|
|
|
|
a mapping to a flat properties list such as Java's system properties
|
|
|
|
|
ability to get values from environment variables
|
|
|
|
|
# ability to write comments
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^@ comment
|
|
|
|
|
// ^ @comment
|
2022-01-15 21:13:47 +02:00
|
|
|
// this is also a comment
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @comment
|
|
|
|
|
// ^ @comment
|
2022-01-15 21:13:47 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
specs url: "https://github.com/lightbend/config/blob/master/HOCON.md"
|
|
|
|
|
includes: {
|
|
|
|
|
include required(file("~/prog/tree-sitter-hocon/grammar.js"))
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @keyword
|
|
|
|
|
//^ @include
|
|
|
|
|
// ^ @punctuation.bracket
|
|
|
|
|
// ^ @punctuation.bracket
|
2022-01-15 21:13:47 +02:00
|
|
|
override = true
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @boolean
|
2022-01-15 21:13:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
it's: ${it's}. A ${HOCON}
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @punctuation.special
|
|
|
|
|
// ^ @punctuation.special
|
|
|
|
|
// ^ @punctuation.special
|
|
|
|
|
// ^ @string
|
|
|
|
|
// ^ @string
|
|
|
|
|
// ^ @punctuation.special
|
|
|
|
|
// ^ @punctuation.special
|
2022-01-15 21:13:47 +02:00
|
|
|
|
|
|
|
|
this.is.a."long.key" = null,
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @punctuation.delimiter
|
|
|
|
|
// ^ @punctuation.delimiter
|
|
|
|
|
// ^ @punctuation.delimiter
|
|
|
|
|
// ^ @constant.builtin
|
2022-01-15 21:13:47 +02:00
|
|
|
week = 7 days
|
2023-12-24 12:52:21 +01:00
|
|
|
// ^ @number
|
|
|
|
|
// ^ @keyword
|
2022-01-15 21:13:47 +02:00
|
|
|
|
|
|
|
|
|