diff options
| author | Samuel Lidén Borell <samuel@kodafritt.se> | 2026-01-12 22:34:47 +0100 |
|---|---|---|
| committer | Samuel Lidén Borell <samuel@kodafritt.se> | 2026-01-12 22:34:47 +0100 |
| commit | f947af6259901d107197a890fafce9d24e8cbdac (patch) | |
| tree | caa8a073730b97ca756f62ecd26f685a6fe1c87f /bootstrap/parsespec.c | |
| parent | 2d42d29d2b36b2bd80debfaaa51553b56629b659 (diff) | |
| download | slul-try2-main.tar.gz slul-try2-main.zip | |
Diffstat (limited to 'bootstrap/parsespec.c')
| -rw-r--r-- | bootstrap/parsespec.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/bootstrap/parsespec.c b/bootstrap/parsespec.c index 7f0ce55..dfd3fe5 100644 --- a/bootstrap/parsespec.c +++ b/bootstrap/parsespec.c @@ -98,3 +98,38 @@ void parse_giveme_section(void) } } } + +static void add_version(const char *s, size_t len) +{ + /* TODO */ + (void)s; + (void)len; + fprintf(stderr, "add version >%.*s<\n", (int)len, s); +} + +void parse_versions_section(void) +{ + assert(!tokenize_numbers_as_versions); + tokenize_numbers_as_versions = true; + for (;;) { + struct LexemeInfo li; + enum Token t = tokenize(&li); + if (t == T_EOL) { + if (!tokenizer_next_line()) { + break; /* EOF */ + } + continue; /* Blank line */ + } else if (t != T_Version) { + if (tokenizer_line_is_indented()) { + error("Unexpected token in `versions` section " + "(or unexpected identation before symbol)"); + } + unread_line(); /* End of version section */ + break; + } + + add_version(li.string, li.len); + expect_next_line_or_eof(); + } + tokenize_numbers_as_versions = false; +} |
