Syntax error sanity tests.

This commit is contained in:
Miguel Lechon
2021-03-14 11:24:26 +01:00
parent e4fbe7a81d
commit e3357f0759
17 changed files with 49 additions and 68 deletions
-1
View File
@@ -1 +0,0 @@
{
-1
View File
@@ -1 +0,0 @@
(
-1
View File
@@ -1 +0,0 @@
}
-1
View File
@@ -1 +0,0 @@
'
-2
View File
@@ -1,2 +0,0 @@
a:'''
multi-line text literal
-1
View File
@@ -1 +0,0 @@
/* asd
-1
View File
@@ -1 +0,0 @@
/* /* asd */
-1
View File
@@ -1 +0,0 @@
label:@tag {1, 2, 3} /* unterminated comment
-1
View File
@@ -1 +0,0 @@
#include <stdio.h>
-1
View File
@@ -1 +0,0 @@
@"tag" node
-2
View File
@@ -1,2 +0,0 @@
#namespace foo
{a,#b}
-25
View File
@@ -1,25 +0,0 @@
// Sample code to demonstrate syntax error detection and reporting
#include "md.h"
#include "md.c"
int main(int argument_count, char **arguments)
{
for(int i = 1; i < argument_count; i += 1)
{
MD_ParseResult parse = MD_ParseWholeFile(MD_S8CString(arguments[i]));
if(parse.first_error)
{
for(MD_Error *error = parse.first_error; error; error = error->next)
{
MD_OutputError(stderr, error);
}
}
else
{
printf("No error in file %s\n", arguments[i]);
}
}
return 0;
}