This commit is contained in:
Roberto Alsina 2023-07-11 16:48:02 -03:00
parent e0b1c8b365
commit 008bd05459

View File

@ -50,9 +50,10 @@
end_b = '>}}'; end_b = '>}}';
start = start_p | start_b ; start = start_p | start_b ;
end = end_p | end_b ; end = end_p | end_b ;\
shortcode = (start spc name (sep arg)* spc end) shortcode = (start spc name (sep arg)* spc end)
> {sc_start = p-start;};
@ { @ {
str_cats(&output, "+++ opening\n"); str_cats(&output, "+++ opening\n");
str_copy(&open_name, &new_name); str_copy(&open_name, &new_name);
@ -86,6 +87,7 @@ str parse(char *input) {
char *eof, *ts, *te = 0; char *eof, *ts, *te = 0;
int cs, act = 0; int cs, act = 0;
char *start = input;
char *p = input; char *p = input;
char *pe = p + strlen(input); char *pe = p + strlen(input);
str open_name, new_name, output, data; str open_name, new_name, output, data;
@ -94,6 +96,9 @@ str parse(char *input) {
str_init(&output); str_init(&output);
str_init(&data); str_init(&data);
int sc_start = 0;
int sc_end = 0;
char *mark = p; char *mark = p;
char *data_mark = p; char *data_mark = p;
@ -104,8 +109,8 @@ str parse(char *input) {
struct shortcode { struct shortcode {
str name; str name;
str args; int start;
str content; int end;
}; };
int main(int argc, char **argv) { int main(int argc, char **argv) {