Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,14 @@
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["kak"]
},
"KDL": {
"nested": true,
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
"extensions": ["kdl"],
"quotes": [["\\\"", "\\\""], ["\\\"\\\"\\\"", "\\\"\\\"\\\""]],
"verbatim_quotes": [["#\\\"", "\\\"#"], ["#\\\"\\\"\\\"", "\\\"\\\"\\\"#"]]
},
"Kotlin": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
Expand Down
36 changes: 36 additions & 0 deletions tests/data/kdl.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package {
name my-pkg
version "1.2.3"

dependencies {
// Nodes can have standalone values as well as
// key/value pairs.
lodash "^3.2.1" optional=#true alias=underscore
}

scripts {
// "Raw" and dedented multi-line strings are supported.
message """
hello
world
"""
build #"""
echo "foo"
node -c "console.log('hello, world!');"
echo "foo" > some-file.txt
"""#
}

// `\` breaks up a single node across multiple lines.
the-matrix 1 2 3 \
4 5 6 \
7 8 9

// "Slashdash" comments operate at the node level,
// with just `/-`.
/-this-is-commented {
this entire node {
is gone
}
}
}
Loading