nvim-treesitter/tests/indent/c/if_else.c
Amaan Qureshi ad3805f5c3
fix(c)!: update C, CPP parsers and queries
also update derived parsers (arduino, cuda, glsl, hlsl, ispc, objc)
2023-07-27 09:51:13 +02:00

59 lines
857 B
C

int foo(int x){
if (x > 10)
return 10;
if (x > 10)
return 10;
else
return 10;
if (x > 20)
return 20;
else if (x > 15)
return 15;
else
return 10;
}
int bar(int x){
if (x > 20)
return 10;
else {
return 10;
}
if (x > 20)
return 10;
else if (x > 10) {
return 10;
}
}
int baz(int x){
if (x > 20)
return x;
else if(x > 10) {
if(x > 10) {
if(x > 10)
return 10;
if(x > 5) {
return 5;
}
}
}
if (x > 20)
if (x > 19)
if(x > 18)
return x;
if (x > 20)
return x;
else if (x > 19) {
if (x > 18)
return x;
else
x++;
}
return 0;
}