From 0f75b2ad2e23107f8112b6dcd4785eeef6cc34aa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 20 Jun 2024 05:56:58 +0200 Subject: Merging upstream version 2:9.1.0496. Signed-off-by: Daniel Baumann --- runtime/syntax/testdir/input/html.html | 153 ++++++++++++++++++++ runtime/syntax/testdir/input/html_html | 146 ------------------- runtime/syntax/testdir/input/java_annotations.java | 78 +++++++++++ runtime/syntax/testdir/input/java_enfoldment.java | 86 ++++++++++++ .../testdir/input/java_lambda_expressions.java | 154 +++++++++++++++++++++ .../syntax/testdir/input/java_methods_indent.java | 70 ---------- .../syntax/testdir/input/java_methods_indent2.java | 92 ++++++++++++ .../syntax/testdir/input/java_methods_indent4.java | 92 ++++++++++++ .../syntax/testdir/input/java_methods_indent8.java | 92 ++++++++++++ .../syntax/testdir/input/java_methods_style.java | 38 +++-- runtime/syntax/testdir/input/java_unfoldment.java | 86 ++++++++++++ runtime/syntax/testdir/input/vim9_comment.vim | 64 +++++++++ .../testdir/input/vim9_ex_comment_strings.vim | 22 +++ .../testdir/input/vim9_ex_no_comment_strings.vim | 22 +++ runtime/syntax/testdir/input/vim9_shebang.vim | 7 + runtime/syntax/testdir/input/vim_comment.vim | 68 +++++++++ runtime/syntax/testdir/input/vim_ex_catch.vim | 17 +++ .../syntax/testdir/input/vim_ex_comment-vim9.vim | 41 ------ runtime/syntax/testdir/input/vim_ex_comment.vim | 45 ------ .../testdir/input/vim_ex_comment_strings.vim | 20 +++ .../testdir/input/vim_ex_no_comment_strings.vim | 20 +++ runtime/syntax/testdir/input/vim_ex_sleep.vim | 11 ++ runtime/syntax/testdir/input/vim_ex_substitute.vim | 58 ++++++++ runtime/syntax/testdir/input/vim_ex_throw.vim | 5 + runtime/syntax/testdir/input/vim_shebang.vim | 5 + 25 files changed, 1179 insertions(+), 313 deletions(-) create mode 100644 runtime/syntax/testdir/input/html.html delete mode 100644 runtime/syntax/testdir/input/html_html create mode 100644 runtime/syntax/testdir/input/java_annotations.java create mode 100644 runtime/syntax/testdir/input/java_enfoldment.java create mode 100644 runtime/syntax/testdir/input/java_lambda_expressions.java delete mode 100644 runtime/syntax/testdir/input/java_methods_indent.java create mode 100644 runtime/syntax/testdir/input/java_methods_indent2.java create mode 100644 runtime/syntax/testdir/input/java_methods_indent4.java create mode 100644 runtime/syntax/testdir/input/java_methods_indent8.java create mode 100644 runtime/syntax/testdir/input/java_unfoldment.java create mode 100644 runtime/syntax/testdir/input/vim9_comment.vim create mode 100644 runtime/syntax/testdir/input/vim9_ex_comment_strings.vim create mode 100644 runtime/syntax/testdir/input/vim9_ex_no_comment_strings.vim create mode 100755 runtime/syntax/testdir/input/vim9_shebang.vim create mode 100644 runtime/syntax/testdir/input/vim_comment.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_catch.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_comment-vim9.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_comment.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_comment_strings.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_no_comment_strings.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_sleep.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_throw.vim create mode 100755 runtime/syntax/testdir/input/vim_shebang.vim (limited to 'runtime/syntax/testdir/input') diff --git a/runtime/syntax/testdir/input/html.html b/runtime/syntax/testdir/input/html.html new file mode 100644 index 0000000..a4d0eb5 --- /dev/null +++ b/runtime/syntax/testdir/input/html.html @@ -0,0 +1,153 @@ + + + + + +
+ +
+ + +bring attention to + + + +
+ +
+ + + + + + + + + +
+deleted text +
+ + +
+
+
+emphasis + +
+
+
+
+
+

Heading Level 1

+

Heading Level 3

+

Heading Level 4

+

Heading Level 4

+
Heading Level 5
+
Heading Level 6
+ +
+
+
+ +idiomatic text + + + + + + + +
  • + +
    + + + + + + + + +
      + + + +

      + +
      preformatted text
      + + + + + + + + + +
      + + + + + +strong importance + + + + +
      + + + + + + + + + + + +unarticulated annotation + + + + + + + + + +
      + + + + + + + + + + + +strikethrough + + + + + + + + +<plaintext> diff --git a/runtime/syntax/testdir/input/html_html b/runtime/syntax/testdir/input/html_html deleted file mode 100644 index bfeca26..0000000 --- a/runtime/syntax/testdir/input/html_html +++ /dev/null @@ -1,146 +0,0 @@ -<!-- - HTML Syntax Test File - Maintainer: Doug Kearns <dougkearns@gmail.com> - Last Change: 2023 Nov 28 ---> - -<!-- HTML Elements --> -<a> -<abbr> -<address> -<area> -<article> -<aside> -<audio> -<b>...</b> -<base> -<bdi> -<bdo> -<blockquote> -<body> -<br> -<button> -<canvas> -<caption> -<cite> -<code> -<col> -<colgroup> -<data> -<datalist> -<dd> -<del>...</del> -<details> -<dfn> -<dialog> -<div> -<dl> -<dt> -<em>...</em> -<embed> -<fieldset> -<figcaption> -<figure> -<footer> -<form> -<h1>...</h1> -<h2>...</h2> -<h3>...</h3> -<h4>...</h4> -<h5>...</h5> -<h6>...</h6> -<head>...</head> -<header> -<hgroup> -<hr> -<html> -<i>...</i> -<iframe> -<img> -<input> -<ins> -<kbd> -<label> -<legend> -<li> -<link> -<main> -<map> -<mark> -<menu> -<meta> -<meter> -<nav> -<noscript> -<object> -<ol> -<optgroup> -<option> -<output> -<p> -<picture> -<pre>...</pre> -<progress> -<q> -<rp> -<rt> -<ruby> -<s>...</s> -<samp> -<script>...</script> -<search> -<section> -<select> -<slot> -<small> -<source> -<span> -<strong>...</strong> -<style>...</style> -<sub> -<summary> -<sup> -<table> -<tbody> -<td> -<template> -<textarea> -<tfoot> -<th> -<thead> -<time> -<title>...</title> -<tr> -<track> -<u>...</u> -<ul> -<var> -<video> -<wbr> -<xmp> - -<!-- Deprecated Elements --> -<acronym> -<big> -<center> -<dir> -<font> -<frame> -<frameset> -<marquee> -<menuitem> -<nobr> -<noframes> -<param> -<rb> -<rtc> -<strike>...</strike> -<tt> - -<!-- Note: these deprecated elements have never been matched --> -<image> -<noembed> -<plaintext> - -<!-- Experimental --> -<portal> diff --git a/runtime/syntax/testdir/input/java_annotations.java b/runtime/syntax/testdir/input/java_annotations.java new file mode 100644 index 0000000..c5871c3 --- /dev/null +++ b/runtime/syntax/testdir/input/java_annotations.java @@ -0,0 +1,78 @@ +// VIM_TEST_SETUP let g:java_highlight_functions = 'style' + + +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; + +class AnnotationsTests +{ + @Target(ElementType.TYPE_USE) + @interface Tag + { + String value() default ""; + String kind() default ""; + } + + @Target(ElementType.TYPE_USE) + @interface Text + { + String[] value() default {""}; + } + + @Target({ + ElementType.METHOD, + ElementType.PARAMETER, + ElementType.TYPE, + }) + @interface Labels + { + Label[] value(); + } + + @java.lang.annotation.Target({ + java.lang.annotation.ElementType.METHOD, + java.lang.annotation.ElementType.PARAMETER, + java.lang.annotation.ElementType.TYPE, + }) + @java.lang.annotation.Repeatable(Labels.class) + @interface Label + { + String value() default ""; + Class<?> type() default Label.class; + boolean redundant() default true; + Text text() default @Text; + Tag head() default @Tag(); + Tag tail() default @Tag(value = "", kind = ""); + } + + /* Use identity cast expressions to nest TYPE_USE annotations. */ + @Label( + (@Text({ + (@Text({ "a", "aa", "aaa", "aaaa", }) String) "as", + (@Text({ "b", "bb", "bbb", "bbbb", }) String) "bs", + (@Text({ "c", "cc", "ccc", "cccc", }) String) "cs", + (@Text({ "d", "dd", "ddd", "dddd", }) String) "ds", + }) String) "abcd") + interface Primer { } + + @Label @Label() @Label(""" + n\ + o\ + O\ + p""") + @Label(head = @Tag(value = "@Label"/*, kind = "name"*/)) + @Label(// value = "Method", + type = AnnotationsTests.class, + redundant = !!!(1 != 1), + head = @Tag(value = "@Label"), + text = @Text({ "})", "({" })) + static void noOp(@Label @Label() @Label("dummy") + @Label(head = @Tag(/*value = "@Label",*/ kind = "name")) + @Label(// value = "Parameter", + type = AnnotationsTests.class, + head = @Tag(value = "@Label"), + text = @Text({ "){", "}(" })) + Object dummy) + { + } +} diff --git a/runtime/syntax/testdir/input/java_enfoldment.java b/runtime/syntax/testdir/input/java_enfoldment.java new file mode 100644 index 0000000..b534122 --- /dev/null +++ b/runtime/syntax/testdir/input/java_enfoldment.java @@ -0,0 +1,86 @@ +// VIM_TEST_SETUP setlocal foldenable foldcolumn=2 foldmethod=syntax +// VIM_TEST_SETUP let g:java_mark_braces_in_parens_as_errors = 1 + + @SuppressWarnings({ + """ + bespoke + /* + * + */ + /** + * + */ + // + // + // + { + } +""" +}) +class FoldingTests { + interface Foldenable + { + } + + static { + new Object() { + { + { + new Object() {{{ + new Object() {{{}}}; + }}}; + } + } + }; + + switch (0) { + case 0: + case 1: { + break; + } + default: ; + }; + } + + { Object bb = ((Object) new byte[]{}); } + { +out: { + do { + if (true) + break out; + } while (false); +} + } + + /** + * No operation. + */ + void noOp1() { } + /** No operation. */ + void noOp2() + { + } + /** No operation. */ + void noOp3() { + } + /** No operation. */ + void noOp4() { + /*/\/\/\*/ ; } +} + +/* + * Some note. + * { + * } + */ +/** + * A summary. + * { + * } + */ +// +// { +// } + +/* 122|..........................................................................................*/ interface Foldenable { +} diff --git a/runtime/syntax/testdir/input/java_lambda_expressions.java b/runtime/syntax/testdir/input/java_lambda_expressions.java new file mode 100644 index 0000000..75f5af4 --- /dev/null +++ b/runtime/syntax/testdir/input/java_lambda_expressions.java @@ -0,0 +1,154 @@ +// VIM_TEST_SETUP let g:java_highlight_functions = 'style' + + +import java.lang.annotation.ElementType; +import java.util.function.BinaryOperator; +import java.util.function.Function; +import java.util.function.Predicate; + +class LambdaExpressionsTests // JDK 21+. +{ + <I1, C1, C2, T1, T2, T3, Z1, Z2, Z3, S1, S2, S3> void test() + { // Schönfinkel's functions. + I<I1> i = x -> x; + C<C1, C2> c = x -> y -> x; + T<T1, T2, T3> t = f -> y -> x -> f.apply(x).apply(y); + Z<Z1, Z2, Z3> z = f -> g -> x -> f.apply(g.apply(x)); + S<S1, S2, S3> s = f -> g -> x -> f.apply(x) + .apply(g.apply(x)); + + I<I1> i01 = (var x) -> x; + I<I1> i02 = (@Taggable var x) -> x; + I<I1> i03 = (@Taggable @Taggable var x) -> x; + I<I1> i04 = (final var x) -> x; + I<I1> i05 = (@Taggable final var x) -> x; + I<I1> i06 = (@Taggable @Taggable final var x) -> x; + I<I1> i07 = (I1 x) -> x; + I<I1> i08 = (@Taggable I1 x) -> x; + I<I1> i09 = (@Taggable @Taggable I1 x) -> x; + I<I1> i10 = (final I1 x) -> x; + I<I1> i11 = (@Taggable final I1 x) -> x; + I<I1> i12 = (@Taggable @Taggable final I1 x) -> x; + + I<I1[]> ii01 = (I1... x) -> x; + I<I1[]> ii02 = (@Taggable I1... x) -> x; + I<I1[]> ii03 = (@Taggable @Taggable I1... x) -> x; + I<I1[]> ii04 = (final I1... x) -> x; + I<I1[]> ii05 = (@Taggable final I1... x) -> x; + I<I1[]> ii06 = (@Taggable @Taggable final I1... x) -> x; + + BinaryOperator<I1> leftConst01 = (var x, var y) -> x; + BinaryOperator<I1> leftConst02 = (@Taggable var x, + @Taggable var y) -> x; + BinaryOperator<I1> leftConst03 = (@Taggable @Taggable var + x, @Taggable @Taggable var y) -> x; + BinaryOperator<I1> leftConst04 = (final var x, + final var y) -> x; + BinaryOperator<I1> leftConst05 = (@Taggable final + var x, @Taggable final var y) -> x; + BinaryOperator<I1> leftConst06 = (@Taggable + @Taggable final var x, + @Taggable + @Taggable final var y) -> x; + BinaryOperator<I1> leftConst07 = (I1 x, I1 y) -> x; + BinaryOperator<I1> leftConst08 = (@Taggable I1 x, + @Taggable I1 y) -> x; + BinaryOperator<I1> leftConst09 = (@Taggable @Taggable I1 + x, @Taggable @Taggable I1 y) -> x; + BinaryOperator<I1> leftConst10 = (final I1 x, + final I1 y) -> x; + BinaryOperator<I1> leftConst11 = (@Taggable final + I1 x, @Taggable final I1 y) -> x; + BinaryOperator<I1> leftConst12 = (@Taggable + @Taggable final I1 x, + @Taggable + @Taggable final I1 y) -> x; + + Runnable noOp = () -> {}; + BinaryOperator<I1> leftConst = (x, y) -> x; + I<I1> id1 = (x) -> (x); + @SuppressWarnings("unchecked") I<I1> id2 = + ((I<I<I1>>) (I<?>) (Function<I1, + I1> x) -> x).apply(switch (0) { + case ((int) (byte) 1) -> (I1 x) -> x; + default -> (@Taggable I1 x) -> x; }); + C<C1, C2> const1 = (x) -> (y) -> (x); + C<C1, C2> const2 = switch(switch ("") { + case "->"->"(s)->(s)"; + default->"default"; }) { + case ("->")->(var x)->(var y)->(x); + default->(@Taggable var x)->(@Taggable var y) + ->(x); + }; + } + + @java.lang.annotation.Target(ElementType.PARAMETER) + @java.lang.annotation.Repeatable(Taggables.class) + @interface Taggable { String[] value() default ""; } + + @java.lang.annotation.Target(ElementType.PARAMETER) + @interface Taggables { Taggable[] value(); } + + interface I<A1> extends Function<A1, A1> { } + interface C<A1, A2> extends Function<A1, Function<A2, A1>> { } + interface T<A1, A2, A3> extends + Function<Function<A1, Function<A2, A3>>, + Function<A2, + Function<A1, A3>>> { } + interface Z<A1, A2, A3> extends Function<Function<A2, A3>, + Function<Function<A1, A2>, + Function<A1, A3>>> { } + interface S<A1, A2, A3> extends + Function<Function<A1, Function<A2, A3>>, + Function<Function<A1, A2>, + Function<A1, A3>>> { } + + static void echo(Object o) { System.out.println(o); } + + static { + enum Letters { OTHER, ALPHA, BETA } + + Letters other = Letters.OTHER; + + switch (other) { + case Letters alpha when Letters.ALPHA == alpha: + { echo(alpha); break; } + case Letters beta when Letters.BETA == beta: + { echo(beta); break; } + default: { echo(other); } + } + + echo(switch (other) { + case Letters alpha when Letters.ALPHA == alpha + -> alpha; + case Letters beta when Letters.BETA == beta + -> beta; + default -> other; + }); + + switch (null) { + case String str when !"<empty>".equals(switch (str) { + case String str_ when + Predicate.<String>not(text -> + !text.isEmpty()) + .test(str_) + -> "<empty>"; + case String str_ -> str_; + }): { echo(str); break; } + case null: default: { echo("Other"); } + }; + + echo(switch (null) { + case String str when !"<empty>".equals( + switch (str) { + case String str_ when + Predicate.<String>not(text -> + !text.isEmpty()) + .test(str_) + -> "<empty>"; + case String str_ -> str_; + }) -> str; + case null, default -> "Other"; + }); + } +} diff --git a/runtime/syntax/testdir/input/java_methods_indent.java b/runtime/syntax/testdir/input/java_methods_indent.java deleted file mode 100644 index 627eb8b..0000000 --- a/runtime/syntax/testdir/input/java_methods_indent.java +++ /dev/null @@ -1,70 +0,0 @@ -// VIM_TEST_SETUP let g:java_highlight_functions = 'indent' - - -import java.lang.annotation.Target; - -abstract class IndentMethodsTests -{ // DO NOT retab! THIS FILE; REMEMBER ABOUT testdir/ftplugin. - protected IndentMethodsTests() { } - - record Τʬ<α>(α a) { } - - enum 𝓔 - { - A("𝕬"), B("𝕭"), C("𝕮"), D("𝕯"), - E("𝕰"), F("𝕱"), G("𝕲"), H("𝕳"); - final String 𝐬; - private 𝓔(String 𝐬) { this.𝐬 = 𝐬; } - } - - @Target(java.lang.annotation.ElementType.METHOD) - @java.lang.annotation.Repeatable(Tɐggablɘs.class) - @interface Tɐggablɘ - { - String[] value() default ""; - } - - @Target(java.lang.annotation.ElementType.METHOD) - @interface Tɐggablɘs - { - Tɐggablɘ[] value(); - } - - interface Stylable<Α> - { - default void ascii$0_() { } - default Α μʭʭ$0_() { return null; } - } - - @Tɐggablɘ @Tɐggablɘ - abstract void ascii$0_(); - - @Tɐggablɘ @Tɐggablɘ - abstract <α, β> Τʬ<α> μʭʭ$0_(β 𝛽); - - @Tɐggablɘ - private native void ascii$1_(); - - @Tɐggablɘ - private native <α, β> Τʬ<α>[] μʭʭ$1_( - java.util.function.Function<β, Τʬ<α>[]> ƒ); - - static final native synchronized void ascii$98_(); - static final native synchronized <α, β> Τʬ<α>[][] μʭʭ$98_( - java.util.function.Function<β, Τʬ<α>[][]> ƒ); - - @SuppressWarnings("strictfp") - protected static final synchronized strictfp void ascii$99_() - { ascii$98_(); } - - @SuppressWarnings("strictfp") - protected static final synchronized strictfp <α, β> Τʬ<α>[] μʭʭ$99_( - java.util.function.Function<β, Τʬ<α>[][]> ƒ) - { - return - IndentMethodsTests.<α, β>μʭʭ$98_(ƒ)[0]; - } - - @Override @SuppressWarnings("cast") - public String toString() { return (String) "IndentMethodsTests"; } -} diff --git a/runtime/syntax/testdir/input/java_methods_indent2.java b/runtime/syntax/testdir/input/java_methods_indent2.java new file mode 100644 index 0000000..58a6900 --- /dev/null +++ b/runtime/syntax/testdir/input/java_methods_indent2.java @@ -0,0 +1,92 @@ +// VIM_TEST_SETUP let g:java_highlight_functions = 'indent2' +// VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8 + +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; + +abstract class Indent2MethodsTests +{ // DO NOT retab! THIS FILE; REMEMBER ABOUT testdir/ftplugin. + // TYPES. + record Τʬ<α>(α a) { } + + enum E + { + A("a"), B("b"), C("c"), D("d"), + E("e"), F("f"), G("g"), H("h"); + final String s; + private E(String s) { this.s = s; } + } + + @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) + @java.lang.annotation.Repeatable(Tɐggablɘs.class) + @interface Tɐggablɘ + { + String[] value() default ""; + } + + @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) + @interface Tɐggablɘs + { + Tɐggablɘ[] value(); + } + + interface Stylable<Α> + { + default void ascii$0_() { } + default Α μʭʭ$0_() { return null; } + } + + // FIELDS. + private static final Class<?> CLASS_LOCK = classLock(); + + private final Object instanceLock = new Object(); + + // CONSTRUCTORS. + @Tɐggablɘ @Tɐggablɘ protected Indent2MethodsTests() { } + <T extends Comparable<T>> Indent2MethodsTests(T t, Void v) { } + private <T extends Comparable<T>> Indent2MethodsTests(T t) { } + + // METHODS. + @Tɐggablɘ @Tɐggablɘ abstract void ascii$0_(//////////////// + ); + @Tɐggablɘ @Tɐggablɘ abstract <α, β> Τʬ<α> μʭʭ$0_( + @SuppressWarnings("bespoke") β b); + + @Tɐggablɘ private native void ascii$1_(/*////////////*/); + @Tɐggablɘ private native <α, β> Τʬ<α>[] μʭʭ$1_( + java.util.function.Function<β, Τʬ<α>[]> ƒ); + + void Ascii$2_() { } + <T, U extends Stylable<T>> void Μʭʭ$2_(U u) { } + + static final native synchronized void ascii$98_(); + static final native synchronized <α, β> Τʬ<α>[][] μʭʭ$98_( + java.util.function.Function<β, Τʬ<α>[][]> ƒ); + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp void ascii$99_() + { ascii$98_(); } + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp <α, β> Τʬ<α>[] μʭʭ$99_( + java.util.function.Function<β, Τʬ<α>[][]> ƒ) + { + return + Indent2MethodsTests.<α, β>μʭʭ$98_(ƒ)[0]; + } + + public static Class<?> classLock() { return Indent2MethodsTests.class; } + + @Override @SuppressWarnings("cast") + public String toString() { return (String) "Indent2MethodsTests"; } +} + +enum E2 +{ + @SuppressWarnings("bespoke") A("a"), + B("b"), + C("c"), D("d"), + E("e"), F("f"), G("g"), H("h"); + final String s; + private E2(String s) { this.s = s; } +} diff --git a/runtime/syntax/testdir/input/java_methods_indent4.java b/runtime/syntax/testdir/input/java_methods_indent4.java new file mode 100644 index 0000000..972cdf3 --- /dev/null +++ b/runtime/syntax/testdir/input/java_methods_indent4.java @@ -0,0 +1,92 @@ +// VIM_TEST_SETUP let g:java_highlight_functions = 'indent4' +// VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8 + +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; + +abstract class Indent4MethodsTests +{ // DO NOT retab! THIS FILE; REMEMBER ABOUT testdir/ftplugin. + // TYPES. + record Τʬ<α>(α a) { } + + enum E + { + A("a"), B("b"), C("c"), D("d"), + E("e"), F("f"), G("g"), H("h"); + final String s; + private E(String s) { this.s = s; } + } + + @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) + @java.lang.annotation.Repeatable(Tɐggablɘs.class) + @interface Tɐggablɘ + { + String[] value() default ""; + } + + @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) + @interface Tɐggablɘs + { + Tɐggablɘ[] value(); + } + + interface Stylable<Α> + { + default void ascii$0_() { } + default Α μʭʭ$0_() { return null; } + } + + // FIELDS. + private static final Class<?> CLASS_LOCK = classLock(); + + private final Object instanceLock = new Object(); + + // CONSTRUCTORS. + @Tɐggablɘ @Tɐggablɘ protected Indent4MethodsTests() { } + <T extends Comparable<T>> Indent4MethodsTests(T t, Void v) { } + private <T extends Comparable<T>> Indent4MethodsTests(T t) { } + + // METHODS. + @Tɐggablɘ @Tɐggablɘ abstract void ascii$0_(//////////////// + ); + @Tɐggablɘ @Tɐggablɘ abstract <α, β> Τʬ<α> μʭʭ$0_( + @SuppressWarnings("bespoke") β b); + + @Tɐggablɘ private native void ascii$1_(/*////////////*/); + @Tɐggablɘ private native <α, β> Τʬ<α>[] μʭʭ$1_( + java.util.function.Function<β, Τʬ<α>[]> ƒ); + + void Ascii$2_() { } + <T, U extends Stylable<T>> void Μʭʭ$2_(U u) { } + + static final native synchronized void ascii$98_(); + static final native synchronized <α, β> Τʬ<α>[][] μʭʭ$98_( + java.util.function.Function<β, Τʬ<α>[][]> ƒ); + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp void ascii$99_() + { ascii$98_(); } + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp <α, β> Τʬ<α>[] μʭʭ$99_( + java.util.function.Function<β, Τʬ<α>[][]> ƒ) + { + return + Indent4MethodsTests.<α, β>μʭʭ$98_(ƒ)[0]; + } + + public static Class<?> classLock() { return Indent4MethodsTests.class; } + + @Override @SuppressWarnings("cast") + public String toString() { return (String) "Indent4MethodsTests"; } +} + +enum E4 +{ + @SuppressWarnings("bespoke") A("a"), + B("b"), + C("c"), D("d"), + E("e"), F("f"), G("g"), H("h"); + final String s; + private E4(String s) { this.s = s; } +} diff --git a/runtime/syntax/testdir/input/java_methods_indent8.java b/runtime/syntax/testdir/input/java_methods_indent8.java new file mode 100644 index 0000000..40fd26b --- /dev/null +++ b/runtime/syntax/testdir/input/java_methods_indent8.java @@ -0,0 +1,92 @@ +// VIM_TEST_SETUP let g:java_highlight_functions = 'indent8' +// VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8 + +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; + +abstract class Indent8MethodsTests +{ // DO NOT retab! THIS FILE; REMEMBER ABOUT testdir/ftplugin. + // TYPES. + record Τʬ<α>(α a) { } + + enum E + { + A("a"), B("b"), C("c"), D("d"), + E("e"), F("f"), G("g"), H("h"); + final String s; + private E(String s) { this.s = s; } + } + + @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) + @java.lang.annotation.Repeatable(Tɐggablɘs.class) + @interface Tɐggablɘ + { + String[] value() default ""; + } + + @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) + @interface Tɐggablɘs + { + Tɐggablɘ[] value(); + } + + interface Stylable<Α> + { + default void ascii$0_() { } + default Α μʭʭ$0_() { return null; } + } + + // FIELDS. + private static final Class<?> CLASS_LOCK = classLock(); + + private final Object instanceLock = new Object(); + + // CONSTRUCTORS. + @Tɐggablɘ @Tɐggablɘ protected Indent8MethodsTests() { } + <T extends Comparable<T>> Indent8MethodsTests(T t, Void v) { } + private <T extends Comparable<T>> Indent8MethodsTests(T t) { } + + // METHODS. + @Tɐggablɘ @Tɐggablɘ abstract void ascii$0_(//////////////// + ); + @Tɐggablɘ @Tɐggablɘ abstract <α, β> Τʬ<α> μʭʭ$0_( + @SuppressWarnings("bespoke") β b); + + @Tɐggablɘ private native void ascii$1_(/*////////////*/); + @Tɐggablɘ private native <α, β> Τʬ<α>[] μʭʭ$1_( + java.util.function.Function<β, Τʬ<α>[]> ƒ); + + void Ascii$2_() { } + <T, U extends Stylable<T>> void Μʭʭ$2_(U u) { } + + static final native synchronized void ascii$98_(); + static final native synchronized <α, β> Τʬ<α>[][] μʭʭ$98_( + java.util.function.Function<β, Τʬ<α>[][]> ƒ); + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp void ascii$99_() + { ascii$98_(); } + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp <α, β> Τʬ<α>[] μʭʭ$99_( + java.util.function.Function<β, Τʬ<α>[][]> ƒ) + { + return + Indent8MethodsTests.<α, β>μʭʭ$98_(ƒ)[0]; + } + + public static Class<?> classLock() { return Indent8MethodsTests.class; } + + @Override @SuppressWarnings("cast") + public String toString() { return (String) "Indent8MethodsTests"; } +} + +enum E8 +{ + @SuppressWarnings("bespoke") A("a"), + B("b"), + C("c"), D("d"), + E("e"), F("f"), G("g"), H("h"); + final String s; + private E8(String s) { this.s = s; } +} diff --git a/runtime/syntax/testdir/input/java_methods_style.java b/runtime/syntax/testdir/input/java_methods_style.java index b3e36fb..e2e7d38 100644 --- a/runtime/syntax/testdir/input/java_methods_style.java +++ b/runtime/syntax/testdir/input/java_methods_style.java @@ -1,30 +1,30 @@ // VIM_TEST_SETUP let g:java_highlight_functions = 'style' +// VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8 - +import java.lang.annotation.ElementType; import java.lang.annotation.Target; abstract class StyleMethodsTests { - protected StyleMethodsTests() { } - + // TYPES. record Τʬ<α>(α a) { } - enum 𝓔 + enum E { - A("𝕬"), B("𝕭"), C("𝕮"), D("𝕯"), - E("𝕰"), F("𝕱"), G("𝕲"), H("𝕳"); - final String 𝐬; - private 𝓔(String 𝐬) { this.𝐬 = 𝐬; } + A("a"), B("b"), C("c"), D("d"), + E("e"), F("f"), G("g"), H("h"); + final String s; + private E(String s) { this.s = s; } } - @Target(java.lang.annotation.ElementType.METHOD) + @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) @java.lang.annotation.Repeatable(Tɐggablɘs.class) @interface Tɐggablɘ { String[] value() default ""; } - @Target(java.lang.annotation.ElementType.METHOD) + @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) @interface Tɐggablɘs { Tɐggablɘ[] value(); @@ -36,15 +36,29 @@ abstract class StyleMethodsTests default Α μʭʭ$0_() { return null; } } + // FIELDS. + private static final Class<?> CLASS_LOCK = classLock(); + + private final Object instanceLock = new Object(); + + // CONSTRUCTORS. + @Tɐggablɘ @Tɐggablɘ protected StyleMethodsTests() { } + <T extends Comparable<T>> StyleMethodsTests(T t, Void v) { } + private <T extends Comparable<T>> StyleMethodsTests(T t) { } + + // METHODS. @Tɐggablɘ @Tɐggablɘ abstract void ascii$0_(//////////////// ); @Tɐggablɘ @Tɐggablɘ abstract <α, β> Τʬ<α> μʭʭ$0_( - /* TODO: @SuppressWarnings("bespoke")*/ β 𝛽); + @SuppressWarnings("bespoke") β b); @Tɐggablɘ private native void ascii$1_(/*////////////*/); @Tɐggablɘ private native <α, β> Τʬ<α>[] μʭʭ$1_( java.util.function.Function<β, Τʬ<α>[]> ƒ); + void Ascii$2_() { } + <T, U extends Stylable<T>> void Μʭʭ$2_(U u) { } + static final native synchronized void ascii$98_(); static final native synchronized <α, β> Τʬ<α>[][] μʭʭ$98_( java.util.function.Function<β, Τʬ<α>[][]> ƒ); @@ -61,6 +75,8 @@ abstract class StyleMethodsTests StyleMethodsTests.<α, β>μʭʭ$98_(ƒ)[0]; } + public static Class<?> classLock() { return StyleMethodsTests.class; } + @Override @SuppressWarnings("cast") public String toString() { return (String) "StyleMethodsTests"; } } diff --git a/runtime/syntax/testdir/input/java_unfoldment.java b/runtime/syntax/testdir/input/java_unfoldment.java new file mode 100644 index 0000000..78dd234 --- /dev/null +++ b/runtime/syntax/testdir/input/java_unfoldment.java @@ -0,0 +1,86 @@ +// VIM_TEST_SETUP setlocal nofoldenable +// VIM_TEST_SETUP let g:java_mark_braces_in_parens_as_errors = 1 + + @SuppressWarnings({ + """ + bespoke + /* + * + */ + /** + * + */ + // + // + // + { + } +""" +}) +class UnfoldingTests { + interface Unfoldenable + { + } + + static { + new Object() { + { + { + new Object() {{{ + new Object() {{{}}}; + }}}; + } + } + }; + + switch (0) { + case 0: + case 1: { + break; + } + default: ; + }; + } + + { Object bb = ((Object) new byte[]{}); } + { +out: { + do { + if (true) + break out; + } while (false); +} + } + + /** + * No operation. + */ + void noOp1() { } + /** No operation. */ + void noOp2() + { + } + /** No operation. */ + void noOp3() { + } + /** No operation. */ + void noOp4() { + /*/\/\/\*/ ; } +} + +/* + * Some note. + * { + * } + */ +/** + * A summary. + * { + * } + */ +// +// { +// } + +/* 122|........................................................................................*/ interface Unfoldenable { +} diff --git a/runtime/syntax/testdir/input/vim9_comment.vim b/runtime/syntax/testdir/input/vim9_comment.vim new file mode 100644 index 0000000..fd6a5d2 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_comment.vim @@ -0,0 +1,64 @@ +vim9script + +# Vim comments + +# Vim9-script comment + + # string only recognised with leading char + "useless string" + +function! Foo() + " Legacy-script comment + # 42 " comment +endfunction + +def! Bar() + # Vim9-script comment + "useless string" # comment +enddef + +command -count FooCommand { + # Vim9-script comment + "useless string" # comment +} + +autocmd BufNewFile * { + # Vim9-script comment + "useless string" # comment +} + + +# Multiline comments + +# comment + \ continuing comment + \ continuing comment + +# :Foo + \ arg1 + #\ comment + \ arg2 + +echo "TOP" + + +# Line-continuation comments + +:Foo + #\ line continuation comment + \ arg1 + #\ line continuation comment + \ arg2 + + +# Issue: #13047 + +if !exists(":DiffOrig") + command DiffOrig vert new | set bt=nofile | r ++edit %% | 0d_ | diffthis + \ | wincmd p | diffthis +endif + + +# Issue: #11307 and #11560 + +# This is what we call " blah diff --git a/runtime/syntax/testdir/input/vim9_ex_comment_strings.vim b/runtime/syntax/testdir/input/vim9_ex_comment_strings.vim new file mode 100644 index 0000000..fd02c1a --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_ex_comment_strings.vim @@ -0,0 +1,22 @@ +vim9script + +# Vim comment strings +# VIM_TEST_SETUP let g:vimsyn_comment_strings = v:true + +# pre "string" post + +function Foo() + " pre "string" post +endfunction + +def Bar() + # pre "string" post +enddef + +command Foo { + # pre "string" post +} + +autocmd BufNewFile * { + # pre "string" post +} diff --git a/runtime/syntax/testdir/input/vim9_ex_no_comment_strings.vim b/runtime/syntax/testdir/input/vim9_ex_no_comment_strings.vim new file mode 100644 index 0000000..dcea14d --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_ex_no_comment_strings.vim @@ -0,0 +1,22 @@ +vim9script + +# Vim comment strings +# VIM_TEST_SETUP let g:vimsyn_comment_strings = v:false + +# pre "string" post + +function Foo() + " pre "string" post +endfunction + +def Bar() + # pre "string" post +enddef + +command Foo { + # pre "string" post +} + +autocmd BufNewFile * { + # pre "string" post +} diff --git a/runtime/syntax/testdir/input/vim9_shebang.vim b/runtime/syntax/testdir/input/vim9_shebang.vim new file mode 100755 index 0000000..c012fd9 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_shebang.vim @@ -0,0 +1,7 @@ +#!/usr/bin/env vim -S +vim9script + +# Vim shebang line + +# just a line comment +#!/usr/bin/env vim -S diff --git a/runtime/syntax/testdir/input/vim_comment.vim b/runtime/syntax/testdir/input/vim_comment.vim new file mode 100644 index 0000000..f382f8d --- /dev/null +++ b/runtime/syntax/testdir/input/vim_comment.vim @@ -0,0 +1,68 @@ +" Vim comments + +" Legacy-script comment + +# 42 " comment + +function! Foo() + " Legacy-script comment + # 42 " comment +endfunction + +def! Bar() + # Vim9-script comment + "useless string" # comment +enddef + +command -nargs=1 FooCommand { + # Vim9-script comment + "useless string" # comment +} + +autocmd BufNewFile * { + # Vim9-script comment + "useless string" # comment +} + + +" Multiline comments + +" comment + \ continuing comment + \ continuing comment + +" :Foo + \ arg1 + "\ comment + \ arg2 + +echo "TOP" + + +" Line-continuation comments + +:Foo + "\ line continuation comment + \ arg1 + "\ line continuation comment + \ arg2 + + +" Issue: #13047 + +if !exists(":DiffOrig") + command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis + \ | wincmd p | diffthis +endif + + +" Issue: #11307 and #11560 + +" This is what we call " blah + + +" Issue # #9587 + +def CommentTitle() + # Title: ... +enddef diff --git a/runtime/syntax/testdir/input/vim_ex_catch.vim b/runtime/syntax/testdir/input/vim_ex_catch.vim new file mode 100644 index 0000000..f0e2a8f --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_catch.vim @@ -0,0 +1,17 @@ +" Vim :catch command + +" :help :catch + +catch /^Vim:Interrupt$/ " catch interrupts (CTRL-C) +catch /^Vim\%((\a\+)\)\=:E/ " catch all Vim errors +catch /^Vim\%((\a\+)\)\=:/ " catch errors and interrupts +catch /^Vim(write):/ " catch all errors in :write +catch /^Vim\%((\a\+)\)\=:E123:/ " catch error E123 +catch /my-exception/ " catch user exception +catch /.*/ " catch everything +catch " same as /.*/ + +" :help :try + +try | sleep 100 | catch /^Vim:Interrupt$/ | endtry +try | edit | catch /^Vim(edit):E\d\+/ | echo "error" | endtry diff --git a/runtime/syntax/testdir/input/vim_ex_comment-vim9.vim b/runtime/syntax/testdir/input/vim_ex_comment-vim9.vim deleted file mode 100644 index 786d11b..0000000 --- a/runtime/syntax/testdir/input/vim_ex_comment-vim9.vim +++ /dev/null @@ -1,41 +0,0 @@ -vim9script - -# Vim comments - -# Vim9-script comment - - # string only recognised with leading char - "useless string" - -function! Foo() - " Legacy-script comment - # 42 " comment -endfunction - -def! Bar() - # Vim9-script comment - "useless string" # comment -enddef - -command -count FooCommand { - # Vim9-script comment - "useless string" # comment -} - -autocmd BufNewFile * { - # Vim9-script comment - "useless string" # comment -} - - -# Issue: #13047 - -if !exists(":DiffOrig") - command DiffOrig vert new | set bt=nofile | r ++edit %% | 0d_ | diffthis - \ | wincmd p | diffthis -endif - - -# Issue: #11307 and #11560 - -# This is what we call " blah diff --git a/runtime/syntax/testdir/input/vim_ex_comment.vim b/runtime/syntax/testdir/input/vim_ex_comment.vim deleted file mode 100644 index 54e514e..0000000 --- a/runtime/syntax/testdir/input/vim_ex_comment.vim +++ /dev/null @@ -1,45 +0,0 @@ -" Vim comments - -" Legacy-script comment - -# 42 " comment - -function! Foo() - " Legacy-script comment - # 42 " comment -endfunction - -def! Bar() - # Vim9-script comment - "useless string" # comment -enddef - -command -nargs=1 FooCommand { - # Vim9-script comment - "useless string" # comment -} - -autocmd BufNewFile * { - # Vim9-script comment - "useless string" # comment -} - - -" Issue: #13047 - -if !exists(":DiffOrig") - command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis - \ | wincmd p | diffthis -endif - - -" Issue: #11307 and #11560 - -" This is what we call " blah - - -" Issue # #9587 - -def CommentTitle() - # Title: ... -enddef diff --git a/runtime/syntax/testdir/input/vim_ex_comment_strings.vim b/runtime/syntax/testdir/input/vim_ex_comment_strings.vim new file mode 100644 index 0000000..4214d6b --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_comment_strings.vim @@ -0,0 +1,20 @@ +" Vim comment strings +" VIM_TEST_SETUP let g:vimsyn_comment_strings = v:true + +" pre "string" post + +function Foo() + " pre "string" post +endfunction + +def Bar() + # pre "string" post +enddef + +command Foo { + # pre "string" post +} + +autocmd BufNewFile * { + # pre "string" post +} diff --git a/runtime/syntax/testdir/input/vim_ex_no_comment_strings.vim b/runtime/syntax/testdir/input/vim_ex_no_comment_strings.vim new file mode 100644 index 0000000..d9b53b3 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_no_comment_strings.vim @@ -0,0 +1,20 @@ +" Vim comment strings +" VIM_TEST_SETUP let g:vimsyn_comment_strings = v:false + +" pre "string" post + +function Foo() + " pre "string" post +endfunction + +def Bar() + # pre "string" post +enddef + +command Foo { + # pre "string" post +} + +autocmd BufNewFile * { + # pre "string" post +} diff --git a/runtime/syntax/testdir/input/vim_ex_sleep.vim b/runtime/syntax/testdir/input/vim_ex_sleep.vim new file mode 100644 index 0000000..49fd31e --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_sleep.vim @@ -0,0 +1,11 @@ +" Vim :sleep command + +sleep " sleep for one second +5 sleep " sleep for five seconds +sleep 100m " sleep for 100 milliseconds +100 sleep m " sleep for 100 milliseconds + +sleep! " sleep for one second +5 sleep! " sleep for five seconds +sleep! 100m " sleep for 100 milliseconds +100 sleep! m " sleep for 100 milliseconds diff --git a/runtime/syntax/testdir/input/vim_ex_substitute.vim b/runtime/syntax/testdir/input/vim_ex_substitute.vim index 340d573..021060a 100644 --- a/runtime/syntax/testdir/input/vim_ex_substitute.vim +++ b/runtime/syntax/testdir/input/vim_ex_substitute.vim @@ -73,6 +73,64 @@ s{/{//{ " comment s}/}//} " comment s~/~//~ " comment +s !/!//! " comment +" s "/"//" " comment (works but disallowed) +s #/#//# " comment +s $/$//$ " comment +s %/%//% " comment +s &/&//& " comment +s '/'//' " comment +" FIXME - matches vimUserFunc +" s (/(//( " comment +s )/)//) " comment +s */*//* " comment +s +/+//+ " comment +s ,/,//, " comment +s -/-//- " comment +s ././/. " comment +s /X/XX/ " comment +s :/://: " comment +s ;/;//; " comment +s </<//< " comment +s =/=//= " comment +s >/>//> " comment +s ?/?//? " comment +s @/@//@ " comment +s [/[//[ " comment +" s \/\//\ " comment (disallowed) +s ]/]//] " comment +s ^/^//^ " comment +s _/_//_ " comment +s `/`//` " comment +s {/{//{ " comment +" s |/|//| " comment (disallowed) +s }/}//} " comment +s ~/~//~ " comment + +s//{string}/ +s //{string}/ + + +" Vi compatibility + +s\/{string}/ +s\?{string}? +s\&{string}& + +s \/{string}/ +s \?{string}? +s \&{string}& + + +" Trailing comment and bar + +" FIXME: trailing comment, no whitespace +s" comment +s| echo "Foo" + +s " comment +s | echo "Foo" + " Issue #13883 diff --git a/runtime/syntax/testdir/input/vim_ex_throw.vim b/runtime/syntax/testdir/input/vim_ex_throw.vim new file mode 100644 index 0000000..4adbc88 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_throw.vim @@ -0,0 +1,5 @@ +" Vim :throw command + +" :help :throw + +try | throw "oops" | catch /^oo/ | echo "caught" | endtry diff --git a/runtime/syntax/testdir/input/vim_shebang.vim b/runtime/syntax/testdir/input/vim_shebang.vim new file mode 100755 index 0000000..47a550c --- /dev/null +++ b/runtime/syntax/testdir/input/vim_shebang.vim @@ -0,0 +1,5 @@ +#!/usr/bin/env vim -S + +" Vim shebang line + +#!/usr/bin/env vim -S -- cgit v1.2.3