Skip to content

Commit

Permalink
Add support for templ language
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Dec 13, 2023
1 parent 6c62399 commit 955ce51
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 19 deletions.
1 change: 1 addition & 0 deletions LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ SystemVerilog (sv,svh)
TaskPaper (taskpaper)
TCL (tcl)
Teal (teal)
Templ (templ)
TemplateToolkit (tt,tt2)
Terraform (tf,tf.json)
TeX (tex,sty)
Expand Down
43 changes: 26 additions & 17 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>396656</th>
<th>397344</th>
</tr><tr>
<th>Java</th>
<th>24</th>
Expand All @@ -39,12 +39,12 @@
</tr><tr>
<th>Markdown</th>
<th>11</th>
<th>1472</th>
<th>1473</th>
<th>356</th>
<th>0</th>
<th>1116</th>
<th>1117</th>
<th>0</th>
<th>59748</th>
<th>59762</th>
</tr><tr>
<th>Python</th>
<th>11</th>
Expand Down Expand Up @@ -107,7 +107,7 @@
<th>92</th>
<th>928</th>
<th>106</th>
<th>41833</th>
<th>41842</th>
</tr><tr>
<th>C#</th>
<th>2</th>
Expand Down Expand Up @@ -444,12 +444,12 @@
</tr><tr>
<th>HTML</th>
<th>1</th>
<th>734</th>
<th>770</th>
<th>0</th>
<th>0</th>
<th>734</th>
<th>770</th>
<th>0</th>
<th>10653</th>
<th>11257</th>
</tr><tr>
<th>Hare</th>
<th>1</th>
Expand All @@ -471,12 +471,12 @@
</tr><tr>
<th>JSON</th>
<th>1</th>
<th>8649</th>
<th>8686</th>
<th>8</th>
<th>0</th>
<th>8641</th>
<th>8678</th>
<th>0</th>
<th>121199</th>
<th>121714</th>
</tr><tr>
<th>Korn Shell</th>
<th>1</th>
Expand Down Expand Up @@ -621,6 +621,15 @@
<th>9</th>
<th>2</th>
<th>213</th>
</tr><tr>
<th>Templ</th>
<th>1</th>
<th>9</th>
<th>1</th>
<th>0</th>
<th>8</th>
<th>1</th>
<th>123</th>
</tr><tr>
<th>Terraform</th>
<th>1</th>
Expand Down Expand Up @@ -723,12 +732,12 @@
</tr></tbody>
<tfoot><tr>
<th>Total</th>
<th>199</th>
<th>31829</th>
<th>3550</th>
<th>200</th>
<th>31912</th>
<th>3551</th>
<th>2032</th>
<th>26247</th>
<th>2786</th>
<th>1960030</th>
<th>26329</th>
<th>2787</th>
<th>1961983</th>
</tr></tfoot>
</table></body></html>
9 changes: 9 additions & 0 deletions examples/language/component.templ
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

templ nameList(items []Item) {
<ul>
for _, item := range items {
<li>{ item.Name }</li>
}
</ul>
}
37 changes: 37 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -7268,6 +7268,43 @@
],
"quotes": []
},
"Templ": {
"complexitychecks": [
"if ",
" else ",
"switch ",
"case ",
"default:",
"for ",
"|| ",
"&& ",
"!= ",
"== "
],
"extensions": [
"templ"
],
"line_comment": [
"//"
],
"multi_line": [
[
"/*",
"*/"
]
],
"quotes": [
{
"end": "\"",
"start": "\""
},
{
"end": "`",
"ignoreEscape": true,
"start": "`"
}
]
},
"Terraform": {
"complexitychecks": [
"count",
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 '
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 '
do
if ./scc "examples/language/" | grep -q "$i "; then
echo -e "${GREEN}PASSED $i Language Check"
Expand Down

0 comments on commit 955ce51

Please sign in to comment.