Skip to content

Commit

Permalink
Add https://pkl-lang.org/ support
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Feb 13, 2024
1 parent 9b762cd commit af51102
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 38 deletions.
1 change: 1 addition & 0 deletions LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ Perl (pl,pm)
PHP (php)
Picat (pi)
PKGBUILD (pkgbuild)
Pkl (pkl)
PL/SQL (fnc,pkb,pks,prc,trg,vw)
Plain Text (text,txt)
Polly (polly)
Expand Down
99 changes: 63 additions & 36 deletions SCC-OUTPUT-REPORT.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<th>465</th>
<th>7810</th>
<th>1593</th>
<th>399951</th>
<th>400883</th>
</tr><tr>
<th>Java</th>
<th>24</th>
Expand All @@ -39,12 +39,12 @@
</tr><tr>
<th>Markdown</th>
<th>11</th>
<th>1477</th>
<th>356</th>
<th>1492</th>
<th>362</th>
<th>0</th>
<th>1121</th>
<th>1130</th>
<th>0</th>
<th>59816</th>
<th>60283</th>
</tr><tr>
<th>Python</th>
<th>11</th>
Expand All @@ -56,13 +56,13 @@
<th>18844</th>
</tr><tr>
<th>YAML</th>
<th>8</th>
<th>395</th>
<th>9</th>
<th>906</th>
<th>66</th>
<th>59</th>
<th>270</th>
<th>62</th>
<th>778</th>
<th>0</th>
<th>12155</th>
<th>18672</th>
</tr><tr>
<th>CSS</th>
<th>5</th>
Expand Down Expand Up @@ -107,7 +107,7 @@
<th>92</th>
<th>928</th>
<th>106</th>
<th>41870</th>
<th>41877</th>
</tr><tr>
<th>C#</th>
<th>2</th>
Expand All @@ -125,7 +125,25 @@
<th>0</th>
<th>12</th>
<th>0</th>
<th>322</th>
<th>268</th>
</tr><tr>
<th>HTML</th>
<th>2</th>
<th>1540</th>
<th>0</th>
<th>0</th>
<th>1540</th>
<th>0</th>
<th>22334</th>
</tr><tr>
<th>JSON</th>
<th>2</th>
<th>8877</th>
<th>8</th>
<th>0</th>
<th>8869</th>
<th>0</th>
<th>136751</th>
</tr><tr>
<th>JavaServer Pages</th>
<th>2</th>
Expand Down Expand Up @@ -270,6 +288,15 @@
<th>3</th>
<th>0</th>
<th>76</th>
</tr><tr>
<th>CSV</th>
<th>1</th>
<th>84</th>
<th>0</th>
<th>0</th>
<th>84</th>
<th>0</th>
<th>2224</th>
</tr><tr>
<th>Cairo</th>
<th>1</th>
Expand Down Expand Up @@ -468,15 +495,6 @@
<th>10</th>
<th>0</th>
<th>245</th>
</tr><tr>
<th>HTML</th>
<th>1</th>
<th>770</th>
<th>0</th>
<th>0</th>
<th>770</th>
<th>0</th>
<th>11166</th>
</tr><tr>
<th>Hare</th>
<th>1</th>
Expand All @@ -495,15 +513,6 @@
<th>7</th>
<th>0</th>
<th>226</th>
</tr><tr>
<th>JSON</th>
<th>1</th>
<th>8831</th>
<th>8</th>
<th>0</th>
<th>8823</th>
<th>0</th>
<th>123714</th>
</tr><tr>
<th>Korn Shell</th>
<th>1</th>
Expand Down Expand Up @@ -585,6 +594,15 @@
<th>1</th>
<th>0</th>
<th>43</th>
</tr><tr>
<th>Pkl</th>
<th>1</th>
<th>39</th>
<th>7</th>
<th>21</th>
<th>11</th>
<th>0</th>
<th>1340</th>
</tr><tr>
<th>Q#</th>
<th>1</th>
Expand Down Expand Up @@ -621,6 +639,15 @@
<th>0</th>
<th>0</th>
<th>0</th>
</tr><tr>
<th>SQL</th>
<th>1</th>
<th>225</th>
<th>0</th>
<th>0</th>
<th>225</th>
<th>0</th>
<th>26445</th>
</tr><tr>
<th>Sieve</th>
<th>1</th>
Expand Down Expand Up @@ -759,12 +786,12 @@
</tr></tbody>
<tfoot><tr>
<th>Total</th>
<th>205</th>
<th>93868</th>
<th>4597</th>
<th>5836</th>
<th>83435</th>
<th>211</th>
<th>95558</th>
<th>4610</th>
<th>5860</th>
<th>85088</th>
<th>2958</th>
<th>3128940</th>
<th>3191023</th>
</tr></tfoot>
</table></body></html>
39 changes: 39 additions & 0 deletions examples/language/pkl.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// ===----------------------------------------------------------------------===//
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ===----------------------------------------------------------------------===//
@go.Package { name = "github.com/apple/pkl-go-examples/gen/redisconfig" }
module org.pkl.golang.example.RedisConfig

import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"

class Auth {
/// Basic HTTP authorization username
username: String

/// Basic HTTP authorization password
password: String
}

/// Whether Redis connections are enabled or not.
enabled: Boolean

/// The hostname that Redis listens on
host: String

/// The port that Redis listens on
port: UInt16

/// Authorization settings for Redis
auth: Auth?
45 changes: 45 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -5258,6 +5258,51 @@
"multi_line": [],
"quotes": []
},
"Pkl": {
"complexitychecks": [
"function ",
"?? ",
"?.",
"ifNonNull(",
"if ",
" else ",
".map",
"for ",
"when ",
"..."
],
"extensions": [
"pkl"
],
"line_comment": [
"//"
],
"multi_line": [
[
"/*",
"*/"
]
],
"quotes": [
{
"end": "\"",
"start": "\""
},
{
"end": "#\"",
"start": "\"#"
},
{
"end": "##\"",
"start": "\"##"
},
{
"end": "\"\"\"",
"ignoreEscape": true,
"start": "\"\"\""
}
]
},
"PL/SQL": {
"complexitychecks": [
"and ",
Expand Down
2 changes: 1 addition & 1 deletion processor/constants.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ else
fi

# Try out specific languages
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell ' 'Racket ' 'DOT ' 'YAML ' 'Teal ' 'FSL ' 'INI ' 'Hare ' 'Templ ' 'Cuda ' 'GraphQL ' 'Bicep '
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell ' 'Racket ' 'DOT ' 'YAML ' 'Teal ' 'FSL ' 'INI ' 'Hare ' 'Templ ' 'Cuda ' 'GraphQL ' 'Bicep ' 'Pkl '
do
if ./scc "examples/language/" | grep -q "$i "; then
echo -e "${GREEN}PASSED $i Language Check"
Expand Down

0 comments on commit af51102

Please sign in to comment.