Regenerate nvim config
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
void foo(int a,
|
||||
int b,
|
||||
int c);
|
||||
|
||||
void foo(int a,
|
||||
int b
|
||||
|
||||
14
config/neovim/store/nvim-treesitter/tests/indent/c/array.c
Normal file
14
config/neovim/store/nvim-treesitter/tests/indent/c/array.c
Normal file
@ -0,0 +1,14 @@
|
||||
int x[] = {
|
||||
1, 2, 3,
|
||||
4, 5,
|
||||
6
|
||||
};
|
||||
|
||||
int y[][2] = {
|
||||
{0, 1},
|
||||
{1, 2},
|
||||
{
|
||||
2,
|
||||
3
|
||||
},
|
||||
};
|
||||
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Function foo
|
||||
* @param[out] x output
|
||||
* @param[in] x input
|
||||
*/
|
||||
void foo(int *x, int y) {
|
||||
*x = y;
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
struct foo {
|
||||
int x, y;
|
||||
};
|
||||
|
||||
struct foo bar(int x, int y) {
|
||||
return (struct foo) {
|
||||
.x = x,
|
||||
.y = y
|
||||
};
|
||||
}
|
||||
10
config/neovim/store/nvim-treesitter/tests/indent/c/cond.c
Normal file
10
config/neovim/store/nvim-treesitter/tests/indent/c/cond.c
Normal file
@ -0,0 +1,10 @@
|
||||
void foo(int x)
|
||||
{
|
||||
if (x > 10) {
|
||||
return;
|
||||
} else if (x < -10) {
|
||||
x = -10;
|
||||
} else {
|
||||
x = -x;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
enum foo {
|
||||
A = 1,
|
||||
B,
|
||||
C,
|
||||
};
|
||||
12
config/neovim/store/nvim-treesitter/tests/indent/c/expr.c
Normal file
12
config/neovim/store/nvim-treesitter/tests/indent/c/expr.c
Normal file
@ -0,0 +1,12 @@
|
||||
void foo(int x, int y)
|
||||
{
|
||||
if ((x*x - y*y > 0) ||
|
||||
(x == 1 || y == 1) &&
|
||||
(x != 2 && y != 2)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
int z = (x + y) *
|
||||
(x - y);
|
||||
}
|
||||
33
config/neovim/store/nvim-treesitter/tests/indent/c/func.c
Normal file
33
config/neovim/store/nvim-treesitter/tests/indent/c/func.c
Normal file
@ -0,0 +1,33 @@
|
||||
int f1(int x) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int f2(int x)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int f3(
|
||||
int x
|
||||
) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int f4(
|
||||
int x,
|
||||
int y
|
||||
) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int f5(int x,
|
||||
int y)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
f6(int x, int y)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
59
config/neovim/store/nvim-treesitter/tests/indent/c/if_else.c
Normal file
59
config/neovim/store/nvim-treesitter/tests/indent/c/if_else.c
Normal file
@ -0,0 +1,59 @@
|
||||
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;
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
int main() {
|
||||
if (1) {
|
||||
foobar();
|
||||
} else {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
statement;
|
||||
statement;
|
||||
@ -0,0 +1,7 @@
|
||||
int main(){
|
||||
for(;;)
|
||||
}
|
||||
|
||||
int foo(){
|
||||
while(1)
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
int main(){
|
||||
if(1){
|
||||
}
|
||||
else {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
|
||||
char *a = "a" "b" "c" D;
|
||||
|
||||
static int a, b, c;
|
||||
a = b = c = 0;
|
||||
|
||||
static int d = 0, e = 0, f = 0;
|
||||
|
||||
int main(void) {
|
||||
printf("String" PRIu64 "\n", (uint64_t)0);
|
||||
printf("String" AND_ERROR_NODE "and string");
|
||||
fflush(stdout);
|
||||
a = 0; b = 0; c = 0;
|
||||
int x = 0; int y = 0; int z = 0;
|
||||
foo(1, 2);
|
||||
x++;
|
||||
a = b
|
||||
= c
|
||||
= d;
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
int foo(int x)
|
||||
{
|
||||
goto error;
|
||||
return 0;
|
||||
error:
|
||||
return 1;
|
||||
}
|
||||
16
config/neovim/store/nvim-treesitter/tests/indent/c/loop.c
Normal file
16
config/neovim/store/nvim-treesitter/tests/indent/c/loop.c
Normal file
@ -0,0 +1,16 @@
|
||||
void foo(int x)
|
||||
{
|
||||
while (x > 0) {
|
||||
x--;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
x++;
|
||||
break;
|
||||
}
|
||||
|
||||
do {
|
||||
x++;
|
||||
} while (x < 0);
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
int foo(int x) {
|
||||
if (x > 10)
|
||||
return 10;
|
||||
else
|
||||
return x;
|
||||
|
||||
while (1)
|
||||
x++;
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
x--;
|
||||
}
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
void foo(int x)
|
||||
{
|
||||
x = x + 1;
|
||||
#if 1
|
||||
x = x + 2;
|
||||
#else
|
||||
x = x + 3;
|
||||
#endif
|
||||
x = x + 4;
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
#define FOO(x) do { \
|
||||
x = x + 1; \
|
||||
x = x / 2; \
|
||||
} while (x > 0);
|
||||
|
||||
void foo(int x)
|
||||
{
|
||||
FOO(x);
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
const char *a = "hello \
|
||||
world";
|
||||
|
||||
const char *b = "hello "
|
||||
"world";
|
||||
11
config/neovim/store/nvim-treesitter/tests/indent/c/struct.c
Normal file
11
config/neovim/store/nvim-treesitter/tests/indent/c/struct.c
Normal file
@ -0,0 +1,11 @@
|
||||
struct foo {
|
||||
int a;
|
||||
struct bar {
|
||||
int x;
|
||||
} b;
|
||||
};
|
||||
|
||||
union baz {
|
||||
struct foo;
|
||||
int x;
|
||||
};
|
||||
16
config/neovim/store/nvim-treesitter/tests/indent/c/switch.c
Normal file
16
config/neovim/store/nvim-treesitter/tests/indent/c/switch.c
Normal file
@ -0,0 +1,16 @@
|
||||
void foo(int x) {
|
||||
switch (x) {
|
||||
case 1:
|
||||
x += 1;
|
||||
break;
|
||||
case 2: x += 2;
|
||||
break;
|
||||
case 3: x += 3; break;
|
||||
case 4: {
|
||||
x += 4;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
x = -x;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
void foo(int x)
|
||||
{
|
||||
int y = (x > 10) ? 10
|
||||
: (x < -10) ? -10
|
||||
: x;
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
/*
|
||||
*
|
||||
Reference in New Issue
Block a user