Skip to content

Commit

Permalink
add support for Pek, #855
Browse files Browse the repository at this point in the history
  • Loading branch information
AlDanial committed Sep 23, 2024
1 parent 8297197 commit c480131
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Unix/cloc
Original file line number Diff line number Diff line change
Expand Up @@ -9066,6 +9066,7 @@ sub set_constants { # {{{1
'pawn' => 'Pawn' ,
'ses' => 'Patran Command Language' ,
'pcl' => 'Patran Command Language' ,
'pek' => 'Pek' ,
'peg' => 'PEG' ,
'pegjs' => 'peg.js' ,
'peggy' => 'peggy' ,
Expand Down Expand Up @@ -10466,6 +10467,10 @@ sub set_constants { # {{{1
[ 'rm_comments_in_strings', '"', '//', '' ],
[ 'call_regexp_common' , 'C++' ],
],
'Pek' => [
[ 'remove_matches' , '^\s*//' ],
[ 'remove_inline' , '//.*$' ],
],
'Pest' => [
[ 'remove_matches' , '^\s*//' ],
[ 'remove_inline' , '//.*$' ],
Expand Down Expand Up @@ -11584,6 +11589,7 @@ sub set_constants { # {{{1
'PEG' => 3.00,
'peg.js' => 3.00,
'peggy' => 3.00,
'Pek' => 2.50,
'Pest' => 2.00,
'tspeg' => 3.00,
'Pig Latin' => 1.00,
Expand Down
5 changes: 5 additions & 0 deletions Unix/t/00_C.t
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,11 @@ my @Tests = (
'ref' => '../tests/outputs/sdp_parser.peggy.yaml',
'args' => '../tests/inputs/sdp_parser.peggy',
},
{
'name' => 'Pek',
'ref' => '../tests/outputs/pek_example.pek.yaml',
'args' => '../tests/inputs/pek_example.pek',
},
{
'name' => 'Pest',
'ref' => '../tests/outputs/toml.pest.yaml',
Expand Down
6 changes: 6 additions & 0 deletions cloc
Original file line number Diff line number Diff line change
Expand Up @@ -9081,6 +9081,7 @@ sub set_constants { # {{{1
'pawn' => 'Pawn' ,
'ses' => 'Patran Command Language' ,
'pcl' => 'Patran Command Language' ,
'pek' => 'Pek' ,
'peg' => 'PEG' ,
'pegjs' => 'peg.js' ,
'peggy' => 'peggy' ,
Expand Down Expand Up @@ -10481,6 +10482,10 @@ sub set_constants { # {{{1
[ 'rm_comments_in_strings', '"', '//', '' ],
[ 'call_regexp_common' , 'C++' ],
],
'Pek' => [
[ 'remove_matches' , '^\s*//' ],
[ 'remove_inline' , '//.*$' ],
],
'Pest' => [
[ 'remove_matches' , '^\s*//' ],
[ 'remove_inline' , '//.*$' ],
Expand Down Expand Up @@ -11599,6 +11604,7 @@ sub set_constants { # {{{1
'PEG' => 3.00,
'peg.js' => 3.00,
'peggy' => 3.00,
'Pek' => 2.50,
'Pest' => 2.00,
'tspeg' => 3.00,
'Pig Latin' => 1.00,
Expand Down
15 changes: 15 additions & 0 deletions tests/inputs/pek_example.pek
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// https://github.com/nektro/zig-pek/tree/master
// language request: pek #855

html[lang="en"](
head(
title("Pek Example")
meta[charset="UTF-8"]
meta[name="viewport" content="width=device-width,initial-scale=1"]
)
body(
h1("Pek Example")
hr
p("This is an example HTML document written in "a[href="https://github.com/nektro/zig-pek"]("Pek")".")
)
)
21 changes: 21 additions & 0 deletions tests/outputs/pek_example.pek.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# github.com/AlDanial/cloc
header :
cloc_url : github.com/AlDanial/cloc
cloc_version : 2.03
elapsed_seconds : 0.00303912162780762
n_files : 1
n_lines : 15
files_per_second : 329.042441358751
lines_per_second : 4935.63662038127
report_file : tests/outputs/pek_example.pek.yaml
'Pek' :
nFiles: 1
blank: 1
comment: 2
code: 12
SUM:
blank: 1
comment: 2
code: 12
nFiles: 1

0 comments on commit c480131

Please sign in to comment.