feat: lex and parse single-line code blocks
This commit is contained in:
parent
2387461e21
commit
c653d437bd
8 changed files with 128 additions and 10 deletions
|
|
@ -66,9 +66,25 @@ void test_lexer_simple1() {
|
|||
TEST_CHECK(t.type == mrk_token_type_text);
|
||||
}
|
||||
|
||||
void test_lexer_code() {
|
||||
LEXER_INIT();
|
||||
|
||||
const char *buf = "`world [hello](link)`";
|
||||
mrk_lexer_open(lxr, buf, 0);
|
||||
|
||||
mrk_token t;
|
||||
|
||||
TEST_CHECK(mrk_lexer_next(&t, lxr) == mrk_lexer_err_ok);
|
||||
TEST_CHECK(t.type == mrk_token_type_backtick);
|
||||
TEST_CHECK(t.start == 0);
|
||||
TEST_CHECK(t.end == 1);
|
||||
|
||||
}
|
||||
|
||||
TEST_LIST = {
|
||||
{ "lexer header", test_lexer_header },
|
||||
{ "lexer line break", test_lexer_line_break},
|
||||
{ "lexer simple 1", test_lexer_simple1 },
|
||||
{ "lexer code", test_lexer_code },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue