From: Maxim Kim Date: Fri, 3 Jul 2026 16:15:35 +0000 (+0000) Subject: runtime(syntax-tests): add typst syntax tests X-Git-Tag: v9.2.0782~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d94bb14047c6c02eb155e92eb102f431950c64be;p=thirdparty%2Fvim.git runtime(syntax-tests): add typst syntax tests closes: #20694 Signed-off-by: Maxim Kim Signed-off-by: Christian Brabandt --- diff --git a/runtime/syntax/testdir/dumps/typst_bolditalic_00.dump b/runtime/syntax/testdir/dumps/typst_bolditalic_00.dump new file mode 100644 index 0000000000..a3fcd1f4d2 --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_bolditalic_00.dump @@ -0,0 +1,20 @@ +>-+0#e000e06#ffffff0| |t+0#0000000&|*|h|e|*|r|e| @65 +|-+0#e000e06&| |*+2#0000000&| |t|h|e|r|e| |m|i|g|h|t| |*| +0&&|*+2&&| |b|e|*| +0&&|*+2&&|s|p|a|c|e|s| |b|o|l|d| |*| +0&&@36 +|-+0#e000e06&| |_+0#0000000&| |t|h|e|r|e| |m|i|g|h|t| |_| |_| |b|e|_| |_|s|p|a|c|e|s| |i|n| |i|t|a|l|i|c| |_| @31 +|-+0#e000e06&| |T+0#0000000&|h|i|s| |s|h|o|u|l|d|n|'|t| |*@1|b|e| |b|o|l|d| |a|n|d| |i|t|a|l|i|c|*@1|.| @34 +|-+0#e000e06&| |T+0#0000000&|h|i|s| |s|h|o|u|l|d| |*+2&&|_|b|e| |b|o|l|d| |a|n|d| |i|t|a|l|i|c|_|*|.+0&&| @37 +|-+0#e000e06&| |T+0#0000000&|h|i|s| |s|h|o|u|l|d| |_+2&&|*|b|e| |b|o|l|d| |a|n|d| |i|t|a|l|i|c| |t|o@1| |*|_|.+0&&| @32 +|-+0#e000e06&| |T+0#0000000&|h|i|s| |s|h|o|u|l|d|n|'|t| |_@1|b|e| |i|t|a|l|i|c|_@1| @44 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/typst_codeblocks_00.dump b/runtime/syntax/testdir/dumps/typst_codeblocks_00.dump new file mode 100644 index 0000000000..80fbbe795a --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_codeblocks_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|t|y|p|s|t|_|e|m|b|e|d@1|e|d|_|l|a|n|g|u|a|g|e|s| |=| |[|'|p|y|t|h|o|n|'|,| |'|s|q|l|'|]| +0#0000000&@6 +@75 +|=+0#00e0003&| |C+0#e000e06&|o|d|e| |B|l|o|c|k|s| +0#0000000&@61 +@75 +|=+0#00e0003&@1| |P+0#e000e06&|y|t|h|o|n| +0#0000000&@65 +@75 +|`+0#e000e06&@2|p|y|t|h|o|n| +0#0000000&@65 +|d+0#af5f00255&|e|f| +0#0000000&|h+0#00e0e07&|e|l@1|o|(+0#0000000&|w|o|r|l|d|)|:| @57 +@4|p+0#00e0e07&|r|i|n|t|(+0#0000000&|"+0#e000002&|h|e|l@1|o| |{|}|"| +0#0000000&|%| |w|o|r|l|d|)| @45 +|`+0#e000e06&@2| +0#0000000&@71 +@75 +|=+0#00e0003&@1| |S+0#e000e06&|Q|L| +0#0000000&@68 +@75 +|`+0#e000e06&@2|s|q|l| +0#0000000&@68 +|s+0#af5f00255&|e|l|e|c|t| +0#0000000&|*| |f+0#e000e06&|r|o|m| +0#0000000&|m|y|_|t|a|b|l|e| @52 +|`+0#e000e06&@2| +0#0000000&@71 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/typst_lists_00.dump b/runtime/syntax/testdir/dumps/typst_lists_00.dump new file mode 100644 index 0000000000..0eedd9e48d --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_lists_00.dump @@ -0,0 +1,20 @@ +>=+0#00e0003#ffffff0| |L+0#e000e06&|i|s|t|s| +0#0000000&@67 +@75 +|++0#e000e06&| |#|l+0#00e0e07&|o|r|e|m|(+0#0000000&|1+0#e000002&|0|)+0#0000000&| @62 +|++0#e000e06&| |#|l+0#00e0e07&|o|r|e|m|(+0#0000000&|2+0#e000002&|0|)+0#0000000&| @62 +| +0#e000e06&@1|-| |#|l+0#00e0e07&|o|r|e|m|(+0#0000000&|1+0#e000002&|5|)+0#0000000&| @60 +| +0#e000e06&@3|-| |#|l+0#00e0e07&|o|r|e|m|(+0#0000000&|1+0#e000002&|5|)+0#0000000&| @58 +| +0#e000e06&@3|-| |#|l+0#00e0e07&|o|r|e|m|(+0#0000000&|1+0#e000002&|5|)+0#0000000&| @58 +| +0#e000e06&@1|-| |#|l+0#00e0e07&|o|r|e|m|(+0#0000000&|1+0#e000002&|5|)+0#0000000&| @60 +|++0#e000e06&| |#|l+0#00e0e07&|o|r|e|m|(+0#0000000&|3+0#e000002&|0|)+0#0000000&| @62 +@75 +|/+0#e000e06&| |T+2#0000000&|e|r|m| |1|\+0&&|:|:+0#e000e06&| +0#0000000&@63 +| +0#e000e06&@3|+| |D+0#0000000&|e|f|i|n|i|t|i|o|n| |1| @56 +| +0#e000e06&@3|+| |D+0#0000000&|e|f|i|n|i|t|i|o|n| |2| @56 +@75 +|/+0#e000e06&| |T+2#0000000&|e|r|m| |2|\+0&&|:|:+0#e000e06&|\| +0#0000000&@62 +@2|#+0#e000e06&|l+0#00e0e07&|o|r|e|m|(+0#0000000&|2+0#e000002&|5|)+0#0000000&| @62 +@75 +|/+0#e000e06&| |S+2#0000000&|o|m|e| |L|o|r|e|m|:+0#e000e06&| +0#0000000&|#+0#e000e06&|l+0#00e0e07&|o|r|e|m|(+0#0000000&|5+0#e000002&|0|)+0#0000000&| @50 +|~+0#4040ff13&| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/typst_script_base_00.dump b/runtime/syntax/testdir/dumps/typst_script_base_00.dump new file mode 100644 index 0000000000..d5db7950b6 --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_script_base_00.dump @@ -0,0 +1,20 @@ +>#+0#e000e06#ffffff0|s+0#af5f00255&|e|t| +0#0000000&|d+0#00e0e07&|o|c|u|m|e|n|t|(+0#0000000&|t|i|t|l|e|:| |"+0#e000002&|S|a|m|p|l|e| |D|o|c|u|m|e|n|t|"|)+0#0000000&| @35 +|#+0#e000e06&|i+0#af5f00255&|m|p|o|r|t| +0#0000000&|"+0#e000002&|/|t|y|p|s|t|/|h|a|b|a|m|a|x|.|t|y|p|"|:+0#0000000&| |*| @43 +|#+0#e000e06&|s+0#af5f00255&|h|o|w|:+0#0000000&| |h+0#00e0e07&|a|b|a|m|a|x|.+0#0000000&|w+0#00e0e07&|i|t|h|(+0#0000000&|n|a|m|e|:| |"+0#e000002&|M|a|x|i|m| |K|i|m|"|,+0#0000000&| |e|m|a|i|l|:| |"+0#e000002&|t|e|s|t|@|g|m|a|i|l|.|c|o|m|"|)+0#0000000&| @11 +|#+0#e000e06&|s+0#af5f00255&|e|t| +0#0000000&|h+0#00e0e07&|e|a|d|i|n|g|(+0#0000000&|n|u|m|b|e|r|i|n|g|:| |"+0#e000002&|(|I|)|"|)+0#0000000&| @44 +|#+0#e000e06&|s+0#af5f00255&|h|o|w| +0#0000000&|h|e|a|d|i|n|g|:| |s+0#af5f00255&|e|t| +0#0000000&|a+0#00e0e07&|l|i|g|n|(+0#0000000&|c|e|n|t|e|r|)| @42 +|#+0#e000e06&|s+0#af5f00255&|h|o|w| +0#0000000&|h|e|a|d|i|n|g|:| |s+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|e|x|t|(+0#0000000&|f|o|n|t|:| |"+0#e000002&|A|r|i|a|l|"|)+0#0000000&| @36 +@75 +|#+0#e000e06&|s+0#af5f00255&|h|o|w| +0#0000000&|"+0#e000002&|o|n|c|e|?|"|:+0#0000000&| |i|t| |=|>| |[|#+0#e000e06&|i+0#00e0e07&|t| +0#0000000&|#+0#e000e06&|i+0#00e0e07&|t|]+0#0000000&| @44 +@75 +|#+0#e000e06&|s+0#af5f00255&|h|o|w| +0#0000000&|h|e|a|d|i|n|g|:| |i|t| |=|>| |b+0#00e0e07&|l|o|c|k|[+0#0000000&| @47 +@2|\|~| @70 +@2|#+0#e000e06&|e+0#00e0e07&|m|p|h|(+0#0000000&|i|t|.|b|o|d|y|)| |/+0#0000e05&@1| |c|o|m@1|e|n|t| |1| +0#0000000&@45 +@2|#+0#e000e06&|c+0#00e0e07&|o|u|n|t|e|r|(+0#0000000&|h|e|a|d|i|n|g|)|.|d+0#00e0e07&|i|s|p|l|a|y|(+0#0000000&|)| |/+0#0000e05&@1| |c|o|m@1|e|n|t| |2| +0#0000000&@32 +@2|\|~| @70 +|]| @73 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/typst_script_extended_00.dump b/runtime/syntax/testdir/dumps/typst_script_extended_00.dump new file mode 100644 index 0000000000..5843bce53c --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_script_extended_00.dump @@ -0,0 +1,20 @@ +>#+0#e000e06#ffffff0|l+0#af5f00255&|e|t| +0#0000000&|h+0#00e0e07&|a|b|a|m|a|x|(+0#0000000&|n|a|m|e|:| |"+0#e000002&@1|,+0#0000000&| |e|m|a|i|l|:| |"+0#e000002&@1|,+0#0000000&| |t|e|x|t|_|s|i|z|e|:| |1+0#e000002&|4|p|t|,+0#0000000&| |d|o|c|)| |=| |{| @15 +@2|i+0#af5f00255&|m|p|o|r|t| +0#0000000&|"+0#e000002&|@|p|r|e|v|i|e|w|/|c|h|e|q|:|0|.|3|.|0|"|:+0#0000000&| |c|h|e|c|k|l|i|s|t| @33 +@2|s+0#af5f00255&|h|o|w|:+0#0000000&| |c|h|e|c|k|l|i|s|t| @57 +@75 +@2|s+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|e|x|t|(+0#0000000&|s|i|z|e|:| |t|e|x|t|_|s|i|z|e|,| |l|a|n|g|:| |"+0#e000002&|e|n|"|)+0#0000000&| @35 +@75 +@2|s+0#af5f00255&|e|t| +0#0000000&|p+0#00e0e07&|a|g|e|(+0#0000000&| @63 +@4|h|e|a|d|e|r|:| |c+0#af5f00255&|o|n|t|e|x|t| +0#0000000&|{| @53 +@6|i+0#af5f00255&|f| +0#0000000&|c+0#00e0e07&|o|u|n|t|e|r|(+0#0000000&|p|a|g|e|)|.|g+0#00e0e07&|e|t|(+0#0000000&|)|.|f+0#00e0e07&|i|r|s|t|(+0#0000000&|)| |>| |1+0#e000002&| +0#0000000&|{| @32 +@8|s+0#af5f00255&|e|t| +0#0000000&|a+0#00e0e07&|l|i|g|n|(+0#0000000&|r|i|g|h|t|)| @50 +@8|s+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|e|x|t|(+0#0000000&|8+0#e000002&|p|t|)+0#0000000&| @53 +@8|s+0#00e0e07&|m|a|l@1|c|a|p|s|(+0#0000000&|d|o|c|u|m|e|n|t|.|t|i|t|l|e|)| @41 +@6|}| @67 +@4|}|,| @68 +@4|f|o@1|t|e|r|:| |c+0#af5f00255&|o|n|t|e|x|t| +0#0000000&|{| @53 +@6|i+0#af5f00255&|f| +0#0000000&|c+0#00e0e07&|o|u|n|t|e|r|(+0#0000000&|p|a|g|e|)|.|f+0#00e0e07&|i|n|a|l|(+0#0000000&|)|.|f+0#00e0e07&|i|r|s|t|(+0#0000000&|)| |>| |1+0#e000002&| +0#0000000&|{| @30 +@8|s+0#af5f00255&|e|t| +0#0000000&|a+0#00e0e07&|l|i|g|n|(+0#0000000&|r|i|g|h|t|)| @50 +@8|s+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|e|x|t|(+0#0000000&|8+0#e000002&|p|t|)+0#0000000&| @53 +@8|c+0#00e0e07&|o|u|n|t|e|r|(+0#0000000&|p|a|g|e|)|.|d+0#00e0e07&|i|s|p|l|a|y|(+0#0000000&|"+0#e000002&|1| |/| |1|"|,+0#0000000&| |b|o|t|h|:| |t+0#e000002&|r|u|e|)+0#0000000&| @24 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/typst_script_extended_01.dump b/runtime/syntax/testdir/dumps/typst_script_extended_01.dump new file mode 100644 index 0000000000..ee4a8f286e --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_script_extended_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|}|,| @68 +@4|f|o@1|t|e|r|:| |c+0#af5f00255&|o|n|t|e|x|t| +0#0000000&|{| @53 +@6|i+0#af5f00255&|f| +0#0000000&|c+0#00e0e07&|o|u|n|t|e|r|(+0#0000000&|p|a|g|e|)|.|f+0#00e0e07&|i|n|a|l|(+0#0000000&|)|.|f+0#00e0e07&|i|r|s|t|(+0#0000000&|)| |>| |1+0#e000002&| +0#0000000&|{| @30 +@8|s+0#af5f00255&|e|t| +0#0000000&|a+0#00e0e07&|l|i|g|n|(+0#0000000&|r|i|g|h|t|)| @50 +@8|s+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|e|x|t|(+0#0000000&|8+0#e000002&|p|t|)+0#0000000&| @53 +@8>c+0#00e0e07&|o|u|n|t|e|r|(+0#0000000&|p|a|g|e|)|.|d+0#00e0e07&|i|s|p|l|a|y|(+0#0000000&|"+0#e000002&|1| |/| |1|"|,+0#0000000&| |b|o|t|h|:| |t+0#e000002&|r|u|e|)+0#0000000&| @24 +@6|}| @67 +@4|}|,| @68 +@2|)| @71 +@2|/+0#0000e05&@1| |s|e|t| |p|a|r|(| +0#0000000&@61 +@2|/+0#0000e05&@1| @2|j|u|s|t|i|f|y|:| |t|r|u|e|,| +0#0000000&@53 +@2|/+0#0000e05&@1| @2|f|i|r|s|t|-|l|i|n|e|-|i|n|d|e|n|t|:| |2|e|m|,| +0#0000000&@44 +@2|/+0#0000e05&@1| @2|s|p|a|c|i|n|g|:| |0|.|6|5|e|m|)| +0#0000000&@51 +@2|s+0#af5f00255&|e|t| +0#0000000&|p+0#00e0e07&|a|r|(+0#0000000&|j|u|s|t|i|f|y|:| |t+0#e000002&|r|u|e|)+0#0000000&| @50 +@2|s+0#af5f00255&|e|t| +0#0000000&|h+0#00e0e07&|e|a|d|i|n|g|(+0#0000000&|n|u|m|b|e|r|i|n|g|:| |"+0#e000002&|1|.|"|)+0#0000000&| @44 +@2|s+0#af5f00255&|h|o|w| +0#0000000&|t|i|t|l|e|:| |s+0#af5f00255&|e|t| +0#0000000&|a+0#00e0e07&|l|i|g|n|(+0#0000000&|c|e|n|t|e|r|)| @43 +@2|s+0#af5f00255&|h|o|w| +0#0000000&|t|i|t|l|e|:| |s|m|a|l@1|c|a|p|s| @51 +@2|i+0#af5f00255&|f| +0#0000000&|n|a|m|e| |=@1| |"+0#e000002&@1| +0#0000000&|{| @57 +@4|s+0#af5f00255&|h|o|w| +0#0000000&|t|i|t|l|e|:| |s+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|l|o|c|k|(+0#0000000&|b|e|l|o|w|:| |2+0#e000002&|e|m|)+0#0000000&| @37 +@57|1|9|,|9| @9|3|6|%| diff --git a/runtime/syntax/testdir/dumps/typst_script_extended_02.dump b/runtime/syntax/testdir/dumps/typst_script_extended_02.dump new file mode 100644 index 0000000000..a5ddff1bca --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_script_extended_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|s+0#af5f00255&|h|o|w| +0#0000000&|t|i|t|l|e|:| |s+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|l|o|c|k|(+0#0000000&|b|e|l|o|w|:| |2+0#e000002&|e|m|)+0#0000000&| @37 +@4|t+0#00e0e07&|i|t|l|e|(+0#0000000&|)| @63 +@2|}| |e+0#af5f00255&|l|s|e| +0#0000000&|{| @64 +@4|t+0#00e0e07&|i|t|l|e|(+0#0000000&|)| @63 +@4|p+0#00e0e07&|a|d|(+0#0000000&|b|o|t@1|o|m|:| |2+0#e000002&|e|m|,+0#0000000&| @54 +@4>a+0#00e0e07&|l|i|g|n|(+0#0000000&|c|e|n|t|e|r|)|[| @56 +@6|#+0#e000e06&|n+0#00e0e07&|a|m|e| +0#0000000&@63 +@6|#+0#e000e06&|h+0#00e0e07&|(+0#0000000&|5+0#e000002&|p|t|)+0#0000000&| @61 +@6|#+0#e000e06&|i+0#af5f00255&|f| +0#0000000&|e|m|a|i|l| |!|=| |"+0#e000002&@1| +0#0000000&|{| @51 +@8|[|(| |#+0#e000e06&|l+0#00e0e07&|i|n|k|(+0#0000000&|"+0#e000002&|m|a|i|l|t|o|:|"| +0#0000000&|+| |e|m|a|i|l|)| |)|]| @36 +@6|}| @67 +@4|]|)| @68 +@2|}| @71 +@75 +@2|s+0#af5f00255&|h|o|w| +0#0000000&|r+0#00e0e07&|a|w|.+0#0000000&|w+0#00e0e07&|h|e|r|e|(+0#0000000&|b|l|o|c|k|:| |t+0#e000002&|r|u|e|)+0#0000000&|:| |i|t| |=|>| |b+0#00e0e07&|l|o|c|k|(+0#0000000&| @31 +@4|s|t|r|o|k|e|:| |(|l|e|f|t|:| |1+0#e000002&|.|5|p|t| +0#0000000&|+| |l+0#00e0e07&|u|m|a|(+0#0000000&|2+0#e000002&@1|0|)+0#0000000&@1|,| @36 +@4|i|n|s|e|t|:| |1+0#e000002&|0|p|t|,+0#0000000&| @58 +@4|r|a|d|i|u|s|:| |6+0#e000002&|p|t|,+0#0000000&| @58 +@4|w|i|d|t|h|:| |1+0#e000002&|0@1|%|,+0#0000000&| @58 +@57|3|7|,|5| @9|8|6|%| diff --git a/runtime/syntax/testdir/dumps/typst_script_extended_03.dump b/runtime/syntax/testdir/dumps/typst_script_extended_03.dump new file mode 100644 index 0000000000..bc948c00cf --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_script_extended_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|w|i|d|t|h|:| |1+0#e000002&|0@1|%|,+0#0000000&| @58 +@4|i|t|,| @67 +@2|)| @71 +@75 +@2|d|o|c| @69 +>}| @73 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|5@1|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/typst_tables_00.dump b/runtime/syntax/testdir/dumps/typst_tables_00.dump new file mode 100644 index 0000000000..08f44c1393 --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_tables_00.dump @@ -0,0 +1,20 @@ +>=+0#00e0003#ffffff0| |T+0#e000e06&|a|b|l|e|s| +0#0000000&@66 +@75 +|#+0#e000e06&|t+0#00e0e07&|a|b|l|e|(+0#0000000&| @67 +@2|c|o|l|u|m|n|s|:| |(|1+0#e000002&|f|r|,+0#0000000&| |a+0#e000002&|u|t|o|,+0#0000000&| |a+0#e000002&|u|t|o|)+0#0000000&|,| @45 +@2|i|n|s|e|t|:| |1+0#e000002&|0|p|t|,+0#0000000&| @60 +@2|a|l|i|g|n|:| |h|o|r|i|z|o|n|,| @57 +@2|t+0#00e0e07&|a|b|l|e|.+0#0000000&|h+0#00e0e07&|e|a|d|e|r|(+0#0000000&| @59 +@4|[|]|,| |[|*+2&&|V|o|l|u|m|e|*|]+0&&|,| |[|*+2&&|P|a|r|a|m|e|t|e|r|s|*|]+0&&|,| @39 +@2|)|,| @70 +@2|[|c|y|l|i|n|d|e|r|]|,| @61 +@2|$+0#e000e06&| +0#0000000&|p+0#00e0e07&|i| +0#0000000&|h| |(|D|^|2+0#e000002&| +0#0000000&|-| |d|^|2+0#e000002&|)+0#0000000&| |/| |4+0#e000002&| +0#0000000&|$+0#e000e06&|,+0#0000000&| @47 +@2|[| @71 +@4|$+0#e000e06&|h+0#0000000&|$+0#e000e06&|:+0#0000000&| |h|e|i|g|h|t| |\+0#e000e06&| +0#0000000&@57 +@4|$+0#e000e06&|D+0#0000000&|$+0#e000e06&|:+0#0000000&| |o|u|t|e|r| |r|a|d|i|u|s| |\+0#e000e06&| +0#0000000&@51 +@4|$+0#e000e06&|d+0#0000000&|$+0#e000e06&|:+0#0000000&| |i|n@1|e|r| |r|a|d|i|u|s| @53 +@2|]|,| @70 +@2|[|t|e|t|r|a|h|e|d|r|o|n|]|,| @58 +@2|$+0#e000e06&| +0#0000000&|s+0#af5f00255&|q|r|t|(+0#0000000&|2+0#e000002&|)+0#0000000&| |/| |1+0#e000002&|2| +0#0000000&|a|^|3+0#e000002&| +0#0000000&|$+0#e000e06&|,+0#0000000&| @51 +@2|[|$+0#e000e06&|a+0#0000000&|$+0#e000e06&|:+0#0000000&| |e|d|g|e| |l|e|n|g|t|h|]| @54 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/typst_tables_01.dump b/runtime/syntax/testdir/dumps/typst_tables_01.dump new file mode 100644 index 0000000000..e9dcb4fc56 --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_tables_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|$+0#e000e06&|D+0#0000000&|$+0#e000e06&|:+0#0000000&| |o|u|t|e|r| |r|a|d|i|u|s| |\+0#e000e06&| +0#0000000&@51 +@4|$+0#e000e06&|d+0#0000000&|$+0#e000e06&|:+0#0000000&| |i|n@1|e|r| |r|a|d|i|u|s| @53 +@2|]|,| @70 +@2|[|t|e|t|r|a|h|e|d|r|o|n|]|,| @58 +@2|$+0#e000e06&| +0#0000000&|s+0#af5f00255&|q|r|t|(+0#0000000&|2+0#e000002&|)+0#0000000&| |/| |1+0#e000002&|2| +0#0000000&|a|^|3+0#e000002&| +0#0000000&|$+0#e000e06&|,+0#0000000&| @51 +@2>[|$+0#e000e06&|a+0#0000000&|$+0#e000e06&|:+0#0000000&| |e|d|g|e| |l|e|n|g|t|h|]| @54 +|)| @73 +@75 +|#+0#e000e06&|s+0#af5f00255&|h|o|w| +0#0000000&|t+0#00e0e07&|a|b|l|e|.+0#0000000&|c+0#00e0e07&|e|l@1|.+0#0000000&|w+0#00e0e07&|h|e|r|e|(+0#0000000&|y|:| |0+0#e000002&|)+0#0000000&|:| |s|t|r|o|n|g| @38 +|#+0#e000e06&|s+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|a|b|l|e|(+0#0000000&| @63 +@2|s|t|r|o|k|e|:| |(|x|,| |y|)| |=|>| |i+0#af5f00255&|f| +0#0000000&|y| |=@1| |0+0#e000002&| +0#0000000&|{| @43 +@4|(|b|o|t@1|o|m|:| |0+0#e000002&|.|7|p|t| +0#0000000&|+| |b|l|a|c|k|)| @47 +@2|}|,| @70 +@2|a|l|i|g|n|:| |(|x|,| |y|)| |=|>| |(| @54 +@4|i+0#af5f00255&|f| +0#0000000&|x| |>| |0+0#e000002&| +0#0000000&|{| |c|e|n|t|e|r| |}| @51 +@4|e+0#af5f00255&|l|s|e| +0#0000000&|{| |l|e|f|t| |}| @57 +@2|)| @71 +|)| @73 +@75 +@57|1|9|,|3| @9|2|0|%| diff --git a/runtime/syntax/testdir/dumps/typst_tables_02.dump b/runtime/syntax/testdir/dumps/typst_tables_02.dump new file mode 100644 index 0000000000..fc0a2ad20a --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_tables_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|#+0#e000e06&|t+0#00e0e07&|a|b|l|e|(+0#0000000&| @67 +@2|c|o|l|u|m|n|s|:| |3+0#e000002&|,+0#0000000&| @61 +@2|t+0#00e0e07&|a|b|l|e|.+0#0000000&|h+0#00e0e07&|e|a|d|e|r|(+0#0000000&| @59 +@4|[|*+2&&|S|u|b|s|t|a|n|c|e|*|]+0&&|,| @56 +@4>[|_|S|u|b|c|r|i|t|i|c|a|l|_| |°|C|]|,| @51 +@4|[|S|u|p|e|r|c|r|i|t|i|c|a|l| |°|C|]|,| @51 +@2|)|,| @70 +@2|[|H|y|d|r|o|c|h|l|o|r|i|c| |A|c|i|d|]|,| @52 +@2|[|1|2|.|0|]|,| |[|9|2|.|1|]|,| @57 +@2|[|S|o|d|i|u|m| |_|M|y|r|e|t|h|_| |*+2&&|_|S|u|l|f|a|t|e|_|*|]+0&&|,| @42 +@2|[|1|6|.|6|]|,| |[|1|0|4|]|,| @58 +@2|[|P|o|t|a|s@1|i|u|m| |H|y|d|r|o|x|i|d|e|]|,| @50 +@2|t+0#00e0e07&|a|b|l|e|.+0#0000000&|c+0#00e0e07&|e|l@1|(+0#0000000&|c|o|l|s|p|a|n|:| |2+0#e000002&|)+0#0000000&|[|2|4|.|7|]|,| @43 +|)| @73 +@75 +|#+0#e000e06&|s+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|a|b|l|e|(+0#0000000&| @63 +@2|s|t|r|o|k|e|:| |n+0#e000002&|o|n|e|,+0#0000000&| @59 +@2|g|u|t@1|e|r|:| |0+0#e000002&|.|2|e|m|,+0#0000000&| @58 +@57|3|7|,|5| @9|4|9|%| diff --git a/runtime/syntax/testdir/dumps/typst_tables_03.dump b/runtime/syntax/testdir/dumps/typst_tables_03.dump new file mode 100644 index 0000000000..58921fcaec --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_tables_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|g|u|t@1|e|r|:| |0+0#e000002&|.|2|e|m|,+0#0000000&| @58 +@2|f|i|l@1|:| |(|x|,| |y|)| |=|>| @57 +@4|i+0#af5f00255&|f| +0#0000000&|x| |=@1| |0+0#e000002&| +0#0000000&|o+0#af5f00255&|r| +0#0000000&|y| |=@1| |0+0#e000002&| +0#0000000&|{| |g|r|a|y| |}|,| @41 +@2|i|n|s|e|t|:| |(|r|i|g|h|t|:| |1+0#e000002&|.|5|e|m|)+0#0000000&|,| @50 +|)| @73 +> @74 +|#+0#e000e06&|s+0#af5f00255&|h|o|w| +0#0000000&|t|a|b|l|e|.|c|e|l@1|:| |i|t| |=|>| |{| @49 +@2|i+0#af5f00255&|f| +0#0000000&|i|t|.|x| |=@1| |0+0#e000002&| +0#0000000&|o+0#af5f00255&|r| +0#0000000&|i|t|.|y| |=@1| |0+0#e000002&| +0#0000000&|{| @45 +@4|s+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|e|x|t|(+0#0000000&|w|h|i|t|e|)| @55 +@4|s+0#00e0e07&|t|r|o|n|g|(+0#0000000&|i|t|)| @60 +@2|}| |e+0#af5f00255&|l|s|e| +0#0000000&|i+0#af5f00255&|f| +0#0000000&|i|t|.|b|o|d|y| |=@1| |[|]| |{| @47 +@4|/+0#0000e05&@1| |R|e|p|l|a|c|e| |e|m|p|t|y| |c|e|l@1|s| |w|i|t|h| |'|N|/|A|'| +0#0000000&@37 +@4|p+0#00e0e07&|a|d|(+0#0000000&|.@1|i|t|.|i|n|s|e|t|)|[|_|N|/|A|_|]| @48 +@2|}| |e+0#af5f00255&|l|s|e| +0#0000000&|{| @64 +@4|i|t| @68 +@2|}| @71 +|}| @73 +@75 +|#+0#e000e06&|l+0#af5f00255&|e|t| +0#0000000&|a| |=| |t+0#00e0e07&|a|b|l|e|.+0#0000000&|c+0#00e0e07&|e|l@1|(+0#0000000&| @54 +@57|5@1|,|0|-|1| @7|7@1|%| diff --git a/runtime/syntax/testdir/dumps/typst_tables_04.dump b/runtime/syntax/testdir/dumps/typst_tables_04.dump new file mode 100644 index 0000000000..d401cfb962 --- /dev/null +++ b/runtime/syntax/testdir/dumps/typst_tables_04.dump @@ -0,0 +1,20 @@ +|#+0#e000e06#ffffff0|l+0#af5f00255&|e|t| +0#0000000&|a| |=| |t+0#00e0e07&|a|b|l|e|.+0#0000000&|c+0#00e0e07&|e|l@1|(+0#0000000&| @54 +@2|f|i|l@1|:| |g+0#00e0e07&|r|e@1|n|.+0#0000000&|l+0#00e0e07&|i|g|h|t|e|n|(+0#0000000&|6+0#e000002&|0|%|)+0#0000000&|,| @47 +|)|[|A|]| @70 +|#+0#e000e06&|l+0#af5f00255&|e|t| +0#0000000&|b| |=| |t+0#00e0e07&|a|b|l|e|.+0#0000000&|c+0#00e0e07&|e|l@1|(+0#0000000&| @54 +@2|f|i|l@1|:| |a+0#00e0e07&|q|u|a|.+0#0000000&|l+0#00e0e07&|i|g|h|t|e|n|(+0#0000000&|6+0#e000002&|0|%|)+0#0000000&|,| @48 +>)|[|B|]| @70 +@75 +|#+0#e000e06&|t+0#00e0e07&|a|b|l|e|(+0#0000000&| @67 +@2|c|o|l|u|m|n|s|:| |4+0#e000002&|,+0#0000000&| @61 +@2|[|]|,| |[|E|x|a|m| |1|]|,| |[|E|x|a|m| |2|]|,| |[|E|x|a|m| |3|]|,| @39 +@75 +@2|[|J|o|h|n|]|,| |[|]|,| |a|,| |[|]|,| @54 +@2|[|M|a|r|y|]|,| |[|]|,| |a|,| |a|,| @55 +@2|[|R|o|b|e|r|t|]|,| |b|,| |a|,| |b|,| @54 +|)| @73 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|7|3|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/typst_bolditalic.typ b/runtime/syntax/testdir/input/typst_bolditalic.typ new file mode 100644 index 0000000000..bfe8aa6452 --- /dev/null +++ b/runtime/syntax/testdir/input/typst_bolditalic.typ @@ -0,0 +1,7 @@ +- t*he*re +- * there might * * be* *spaces bold * +- _ there might _ _ be_ _spaces in italic _ +- This shouldn't **be bold and italic**. +- This should *_be bold and italic_*. +- This should _*be bold and italic too *_. +- This shouldn't __be italic__ diff --git a/runtime/syntax/testdir/input/typst_codeblocks.typ b/runtime/syntax/testdir/input/typst_codeblocks.typ new file mode 100644 index 0000000000..81c80c606b --- /dev/null +++ b/runtime/syntax/testdir/input/typst_codeblocks.typ @@ -0,0 +1,16 @@ +// VIM_TEST_SETUP let g:typst_embedded_languages = ['python', 'sql'] + += Code Blocks + +== Python + +```python +def hello(world): + print("hello {}" % world) +``` + +== SQL + +```sql +select * from my_table +``` diff --git a/runtime/syntax/testdir/input/typst_lists.typ b/runtime/syntax/testdir/input/typst_lists.typ new file mode 100644 index 0000000000..68dbc76cc4 --- /dev/null +++ b/runtime/syntax/testdir/input/typst_lists.typ @@ -0,0 +1,18 @@ += Lists + ++ #lorem(10) ++ #lorem(20) + - #lorem(15) + - #lorem(15) + - #lorem(15) + - #lorem(15) ++ #lorem(30) + +/ Term 1\:: + + Definition 1 + + Definition 2 + +/ Term 2\::\ + #lorem(25) + +/ Some Lorem: #lorem(50) diff --git a/runtime/syntax/testdir/input/typst_script_base.typ b/runtime/syntax/testdir/input/typst_script_base.typ new file mode 100644 index 0000000000..b8ea883ba6 --- /dev/null +++ b/runtime/syntax/testdir/input/typst_script_base.typ @@ -0,0 +1,15 @@ +#set document(title: "Sample Document") +#import "/typst/habamax.typ": * +#show: habamax.with(name: "Maxim Kim", email: "test@gmail.com") +#set heading(numbering: "(I)") +#show heading: set align(center) +#show heading: set text(font: "Arial") + +#show "once?": it => [#it #it] + +#show heading: it => block[ + \~ + #emph(it.body) // comment 1 + #counter(heading).display() // comment 2 + \~ +] diff --git a/runtime/syntax/testdir/input/typst_script_extended.typ b/runtime/syntax/testdir/input/typst_script_extended.typ new file mode 100644 index 0000000000..69127c381c --- /dev/null +++ b/runtime/syntax/testdir/input/typst_script_extended.typ @@ -0,0 +1,55 @@ +#let habamax(name: "", email: "", text_size: 14pt, doc) = { + import "@preview/cheq:0.3.0": checklist + show: checklist + + set text(size: text_size, lang: "en") + + set page( + header: context { + if counter(page).get().first() > 1 { + set align(right) + set text(8pt) + smallcaps(document.title) + } + }, + footer: context { + if counter(page).final().first() > 1 { + set align(right) + set text(8pt) + counter(page).display("1 / 1", both: true) + } + }, + ) + // set par( + // justify: true, + // first-line-indent: 2em, + // spacing: 0.65em) + set par(justify: true) + set heading(numbering: "1.") + show title: set align(center) + show title: smallcaps + if name == "" { + show title: set block(below: 2em) + title() + } else { + title() + pad(bottom: 2em, + align(center)[ + #name + #h(5pt) + #if email != "" { + [( #link("mailto:" + email) )] + } + ]) + } + + show raw.where(block: true): it => block( + stroke: (left: 1.5pt + luma(220)), + inset: 10pt, + radius: 6pt, + width: 100%, + it, + ) + + doc +} diff --git a/runtime/syntax/testdir/input/typst_tables.typ b/runtime/syntax/testdir/input/typst_tables.typ new file mode 100644 index 0000000000..7cf1089efb --- /dev/null +++ b/runtime/syntax/testdir/input/typst_tables.typ @@ -0,0 +1,82 @@ += Tables + +#table( + columns: (1fr, auto, auto), + inset: 10pt, + align: horizon, + table.header( + [], [*Volume*], [*Parameters*], + ), + [cylinder], + $ pi h (D^2 - d^2) / 4 $, + [ + $h$: height \ + $D$: outer radius \ + $d$: inner radius + ], + [tetrahedron], + $ sqrt(2) / 12 a^3 $, + [$a$: edge length] +) + +#show table.cell.where(y: 0): strong +#set table( + stroke: (x, y) => if y == 0 { + (bottom: 0.7pt + black) + }, + align: (x, y) => ( + if x > 0 { center } + else { left } + ) +) + +#table( + columns: 3, + table.header( + [*Substance*], + [_Subcritical_ °C], + [Supercritical °C], + ), + [Hydrochloric Acid], + [12.0], [92.1], + [Sodium _Myreth_ *_Sulfate_*], + [16.6], [104], + [Potassium Hydroxide], + table.cell(colspan: 2)[24.7], +) + +#set table( + stroke: none, + gutter: 0.2em, + fill: (x, y) => + if x == 0 or y == 0 { gray }, + inset: (right: 1.5em), +) + +#show table.cell: it => { + if it.x == 0 or it.y == 0 { + set text(white) + strong(it) + } else if it.body == [] { + // Replace empty cells with 'N/A' + pad(..it.inset)[_N/A_] + } else { + it + } +} + +#let a = table.cell( + fill: green.lighten(60%), +)[A] +#let b = table.cell( + fill: aqua.lighten(60%), +)[B] + +#table( + columns: 4, + [], [Exam 1], [Exam 2], [Exam 3], + + [John], [], a, [], + [Mary], [], a, a, + [Robert], b, a, b, +)