mirror of
https://github.com/git/git
synced 2024-10-02 22:55:18 +00:00
ec0e3075d2
- Support multi-line methods by not requiring closing parenthesis. - Support multiple generics (comma was missing before). - Add missing `foreach`, `lock` and `fixed` keywords to skip over. - Remove `instanceof` keyword, which isn't C#. - Also detect non-method keywords not positioned at the start of a line. - Added tests; none existed before. The overall strategy is to focus more on what isn't expected for method/property definitions, instead of what is, but is fully optional. Signed-off-by: Steven Jeuris <steven.jeuris@gmail.com> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
27 lines
498 B
Plaintext
27 lines
498 B
Plaintext
using System.Linq;
|
|
|
|
class Example
|
|
{
|
|
string Method(int RIGHT)
|
|
{
|
|
do { } while (true);
|
|
do MethodCall(
|
|
); while (true);
|
|
while (true);
|
|
while (true) {
|
|
break;
|
|
}
|
|
for (int i = 0; i < 10; ++i)
|
|
{
|
|
}
|
|
foreach (int i in Enumerable.Range(0, 10))
|
|
{
|
|
}
|
|
int[] numbers = [5, 4, 1, 3, 9, 8, 6, 7, 2, 0];
|
|
|
|
return "ChangeMe";
|
|
}
|
|
|
|
string MethodCall(int a = 0, int b = 0) => "test";
|
|
}
|