Skip to content

Commit b4dfdd8

Browse files
committed
Add Pkl language support
1 parent af3bf6d commit b4dfdd8

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ Perl6
487487
Pest
488488
Phix
489489
Php
490+
Pkl
490491
Po
491492
Poke
492493
Polly

languages.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,16 @@
12881288
"quotes": [["\\\"", "\\\""], ["'", "'"]],
12891289
"extensions": ["php"]
12901290
},
1291+
"Pkl": {
1292+
"line_comment": ["//", "///"],
1293+
"filenames": [
1294+
"pklproject"
1295+
],
1296+
"extensions": ["pkl"],
1297+
"multi_line_comments": [["/*", "*/"]],
1298+
"quotes": [["\\\"\\\"\\\"", "\\\"\\\"\\\""]],
1299+
"verbatim_quotes": [["r##\\\"", "\\\"##"], ["r#\\\"", "\\\"#"]]
1300+
},
12911301
"PlantUml": {
12921302
"name": "PlantUML",
12931303
"line_comment": ["'"],

tests/data/pkl.pkl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// 32 lines 14 code 11 comments 7 blanks
2+
/// Doc comments
3+
/// not_a_real = "assignment"
4+
/// Pkl docs: <https://pkl-lang.org>
5+
module example.MyAppConfig
6+
7+
/* Multiline comment on one line */
8+
local function myFunction() = new {
9+
string = """
10+
Everything in here is a string.
11+
/* not a comment */
12+
// not a comment
13+
"""
14+
15+
other = #"Everything in here is a string. Quotes like " don't start a new string "#
16+
17+
// comment
18+
19+
a = 4 // /*
20+
b = 5
21+
c = 6 // */
22+
23+
/*
24+
* Multiline comment on multiple lines
25+
*/
26+
}
27+
28+
/// The hostname for the application
29+
host: String = "foo"
30+
31+
/// The port to listen on
32+
port: UInt16(this > 1000) = 1001

0 commit comments

Comments
 (0)