summaryrefslogtreecommitdiffstats
path: root/parser.h
blob: e771a9c7a5e62781c8e89e45d1e6025de4d94fcf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef VMP_PARSER_H
#define VMP_PARSER_H

#include "stack.h"

typedef enum {
	NODE_BOLD,
	NODE_ITALIC,
	NODE_LIST,
	NODE_CODEBLK,
} md_node_type;


struct md_token {
	size_t idx;
	size_t line_len;
	int start_pos;
	char* line;
	md_node_type type;
};


int parse_title(struct md_token* mt);
int parse_bold(const char* line);
int parse_ul(const char* line);
int parse_ol(const char* line);
int parse_content(struct md_token* mt);


#endif