You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bat/tests/syntax-tests/highlighted/C/test.c

63 lines
7.2 KiB
C

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
void test_function()
{
#define TEST
#ifdef TEST
 printf("TEST is defined\n");
#endif
}
struct Node
{
 int val;
 struct Node *next;
};
int main(int argc, char **argv)
{
 /* This C program was written to help bat
 * with its syntax highlighting tests
 */
 // Calling test function
 test_function();
 struct Node *head = NULL;
 head = (struct Node *)malloc(sizeof(struct Node *));
 head->val = -1;
 if (head->val == 1 * -1)
 {
 head->val = 10;
 }
 else
 {
 head->val = argc;
 }
 int t = head->val, count = 0;
 free(head);
 while (t--)
 {
 count++;
 }
 for (int i = t; i < count; ++i)
 {
 do
 {
 --count;
 } while (false);
 }
 enum chars
 {
 M,
 I,
 T,
 H,
 L
 };
 char *string = "string";
 printf("true is #define true %d\n", true);
 return 0;
}