diff --git a/languages.json b/languages.json index dd18c7ec0..2c194f86f 100644 --- a/languages.json +++ b/languages.json @@ -1547,6 +1547,13 @@ "quotes": [["\\\"", "\\\""], ["'", "'"], ["`", "`"]], "extensions": ["ts", "mts", "cts"] }, + "Typst": { + "nested": true, + "line_comment": ["//"], + "multi_line_comments": [["/*", "*/"]], + "quotes": [["\\\"", "\\\""]], + "extensions": ["typ"] + }, "UMPL": { "line_comment": ["!"], "quotes": [["`", "`"]], diff --git a/tests/data/typst.typ b/tests/data/typst.typ new file mode 100644 index 000000000..f488999f2 --- /dev/null +++ b/tests/data/typst.typ @@ -0,0 +1,16 @@ +// 16 lines 9 code 3 comments 4 blanks + +// Some example settings +#set document(title: "a title", author: "an author") +#set page(numbering: "1 / 1", number-align: center) +#set par(justify: true) +#set text(size: 13pt, lang: "fr") // with a trailing comment +#set heading(numbering: "1.1") /* with another trailing comment */ + +#let foo = "multiline +string" + +#let bar = "singleline string" + +/* comment */ /* nested /* comment */ */ +#lorem(50)