diff --git a/README.md b/README.md index 5cfa88d78..c32bcc3c5 100644 --- a/README.md +++ b/README.md @@ -349,6 +349,7 @@ Bitbake BrightScript C Cabal +Cairo Cassius Ceylon CHeader diff --git a/languages.json b/languages.json index 0f142f02c..8558fcb54 100644 --- a/languages.json +++ b/languages.json @@ -182,6 +182,11 @@ "multi_line_comments": [["{-", "-}"]], "extensions": ["cabal"] }, + "Cairo": { + "line_comment": ["//"], + "extensions": ["cairo"], + "quotes": [["\\\"", "\\\""], ["'", "'"]] + }, "Cassius": { "line_comment": ["//"], "multi_line_comments": [["/*", "*/"]], @@ -1480,13 +1485,6 @@ "extensions": ["smk", "rules"], "filenames": ["snakefile"] }, - "Snakemake": { - "line_comment": ["#"], - "doc_quotes": [["\\\"\\\"\\\"", "\\\"\\\"\\\""], ["'''", "'''"]], - "quotes": [["\\\"", "\\\""], ["'", "'"]], - "extensions": ["smk", "rules"], - "filenames": ["snakefile"] - }, "Solidity": { "name": "Solidity", "line_comment": ["//"], diff --git a/tests/data/cairo.cairo b/tests/data/cairo.cairo new file mode 100644 index 000000000..b43300a3c --- /dev/null +++ b/tests/data/cairo.cairo @@ -0,0 +1,51 @@ +//! 51 lines 32 code 13 comments 6 blanks +//! ```rust +//! fn main () { +//! // Comment +//! +//! println!("Hello World!"); +//! } +//! ``` + +/// The main function +fn main() { + let x: ByteArray = "\"/*##\"\"##\'\'"; + // comment + loop { + if x.len() >= 2 && x[0] == '*' && x[1] == '/' { // found the */ + break; + } + } +} + +fn foo>(name: T) { + let this_ends = 'a "\'test/"*.'; + call1(); + call2(); + let this_does_not = // a // nested // comment " // + ///"*/another /*test + call3(); +//*/"; +} + +fn call1() {} +fn call2() {} +fn call3() {} + +fn foobar() { + let does_not_start: ByteArray = // " + "until here, + test/* + test"; // a quote: " + let also_doesnt_start = + /// " */ + 'until here, + test,'; // another quote: " +} + +fn foo2() { + let a = 4; // /// + let b = '5'; + let c = 6; // /// +} +