diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 13:19:41 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 13:19:41 -0400 |
| commit | 64143f0a131a053414e4b73c17bff994522b11c2 (patch) | |
| tree | 2545507fde623f8846bf183388acdbb0234b5e65 /parse.c | |
| parent | 5feecff9d93522002c74a1423d138c2aa8bc150d (diff) | |
Syntax overhaul (comments back to `#`, print statments to `!!`),
using `$/.../` for patterns and using a DSL for patterns
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -378,7 +378,7 @@ const char *get_id(const char **inout) { } bool comment(const char **pos) { - if ((*pos)[0] == '/' && (*pos)[1] == '/' && (*pos)[2] != '!') { + if ((*pos)[0] == '#') { *pos += strcspn(*pos, "\r\n"); return true; } else { @@ -1194,6 +1194,9 @@ PARSER(parse_text) { open_quote = *pos; ++pos; close_quote = closing[(int)open_quote] ? closing[(int)open_quote] : open_quote; + + if (!lang && open_quote == '/') + lang = "Pattern"; } else { return NULL; } @@ -2132,7 +2135,7 @@ PARSER(parse_doctest) { PARSER(parse_say) { const char *start = pos; - if (!match(&pos, "//!")) return NULL; + if (!match(&pos, "!!")) return NULL; spaces(&pos); ast_list_t *chunks = NULL; |
