mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-02 12:48:13 +00:00
Syntax error sanity tests.
This commit is contained in:
@@ -1 +0,0 @@
|
||||
{
|
||||
@@ -1 +0,0 @@
|
||||
(
|
||||
@@ -1 +0,0 @@
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
'
|
||||
@@ -1,2 +0,0 @@
|
||||
a:'''
|
||||
multi-line text literal
|
||||
@@ -1 +0,0 @@
|
||||
/* asd
|
||||
@@ -1 +0,0 @@
|
||||
/* /* asd */
|
||||
@@ -1 +0,0 @@
|
||||
label:@tag {1, 2, 3} /* unterminated comment
|
||||
@@ -1 +0,0 @@
|
||||
#include <stdio.h>
|
||||
@@ -1 +0,0 @@
|
||||
@"tag" node
|
||||
@@ -1,2 +0,0 @@
|
||||
#namespace foo
|
||||
{a,#b}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user