mirror of
https://github.com/XAMPPRocky/tokei
synced 2024-09-28 20:13:35 +00:00
* add cangjie language definition * add test file cangjie.cj Co-authored-by: Chengxiang Liu <chengxiang@qcraft.ai>
This commit is contained in:
parent
48bd659d6b
commit
3c1536825b
|
@ -174,6 +174,15 @@
|
|||
"multi_line_comments": [["{-", "-}"]],
|
||||
"extensions": ["cabal"]
|
||||
},
|
||||
"Cangjie": {
|
||||
"line_comment": ["//"],
|
||||
"multi_line_comments": [["/*", "*/"]],
|
||||
"nested": true,
|
||||
"quotes": [["\\\"", "\\\""],["\\\"\\\"\\\"", "\\\"\\\"\\\""]],
|
||||
"verbatim_quotes": [["#\\\"", "\\\"#"],["##\\\"", "\\\"##"],["###\\\"", "\\\"###"],
|
||||
["#'", "'#"],["##'", "'##"],["###'", "'###"]],
|
||||
"extensions": ["cj"]
|
||||
},
|
||||
"Cassius": {
|
||||
"line_comment": ["//"],
|
||||
"multi_line_comments": [["/*", "*/"]],
|
||||
|
|
50
tests/data/cangjie.cj
Normal file
50
tests/data/cangjie.cj
Normal file
|
@ -0,0 +1,50 @@
|
|||
/* 50 lines 34 code 8 comments 8 blanks */
|
||||
|
||||
/* /* we can nest block*/ comments in cangjie */
|
||||
main(): Unit {
|
||||
let start: String = "/*"
|
||||
|
||||
var x: Int64 = 1
|
||||
x += 2 // end of line comment */
|
||||
}
|
||||
|
||||
func foo(): Unit {
|
||||
let esc: String = "\"/*escaped quotes in a string and block comment*/\"";
|
||||
let next_line: String = """
|
||||
*/ /*string on new line
|
||||
continued to another line
|
||||
bar();
|
||||
*/"
|
||||
"""
|
||||
|
||||
/* Block comment
|
||||
// line comment in a block comment
|
||||
end block comment*/
|
||||
let late_start: String = // "
|
||||
##"wow\
|
||||
that's pretty neat"##
|
||||
|
||||
let late_start2: String = /* " */
|
||||
"*/ still just a string" // but this is a line comment
|
||||
}
|
||||
|
||||
func foobar(): Unit {
|
||||
let a: Int64 = 4 // /*
|
||||
let b: Int64 = 5
|
||||
let c: Int64 = 6 // */
|
||||
}
|
||||
|
||||
/* \
|
||||
/ comment
|
||||
\*/
|
||||
struct Point {
|
||||
let x: Int64
|
||||
let y: Int64
|
||||
let z: Int64
|
||||
|
||||
public init(x: Int64, y: Int64, z: Int64) {
|
||||
this.x = x
|
||||
this.y = y
|
||||
this.z = z
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue