return errors from parse() #1

Merged
ralsina merged 12 commits from return-errors into main 2023-07-14 01:05:13 +00:00
2 changed files with 5 additions and 8 deletions
Showing only changes of commit b910e00a47 - Show all commits

View File

@ -1,12 +1,16 @@
#ifndef SHORTCODES_H #ifndef SHORTCODES_H
#define SHORTCODES_H #define SHORTCODES_H
// A chunk is a reference to a piece of string
// from "start" relative to its start
// and goes on for len characters.
struct chunk struct chunk
{ {
int start, len; int start, len;
}; };
typedef struct chunk chunk; typedef struct chunk chunk;
// Describes a parsed shortcode
struct shortcode struct shortcode
{ {
chunk whole; chunk whole;

View File

@ -129,10 +129,3 @@ shortcode *parse(char *input) {
return sc_list; return sc_list;
} }
// int main(int argc, char **argv) {
// parse(
// "bbb{{% sarasa sar1 sar2 \"sar3\" %}}ccc"
// "{{< c1 arg2 >}}foobar{{% /c1%}}aaa{{% sarasa name=\"pepe\" %}}");
// return 0;
// };