aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-14 07:25:40 +0200
committerlemon <lsof@mailbox.org>2022-08-14 07:25:53 +0200
commitf0def28d9aeeb7f1f9b3d8880a34a05ec59d80ed (patch)
tree72b4f9776a8bc1964d32b3db2e8bf2d78120ad57 /bootstrap
parent4a656bf19a45e0b3f553f9c518e7e842cc6cbf51 (diff)
multiline comment and stuff
Diffstat (limited to 'bootstrap')
-rw-r--r--bootstrap/parse.c12
-rw-r--r--bootstrap/types.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/bootstrap/parse.c b/bootstrap/parse.c
index be32985..8707709 100644
--- a/bootstrap/parse.c
+++ b/bootstrap/parse.c
@@ -394,6 +394,18 @@ lex(struct parser *P) {
tok.t = '#FIL';
} else if (!strcmp(s, "#LINE")) {
tok.t = '#LIN';
+ } else if (!strcmp(s, "#!")) {
+ if (chr(P) != '{') fatal(P, P->tokspan, "expected '{' after '#!'");
+ int bal = 1;
+ while (bal != 0) {
+ switch (lex(P).t) {
+ case '{': ++bal; break;
+ case '}': --bal; break;
+ case TKeof: fatal(P, tok.span, "unterminated comment");
+ }
+ }
+ return lex(P);
+
} else {
fatal(P, P->tokspan, "invalid #keyword");
}
diff --git a/bootstrap/types.c b/bootstrap/types.c
index 289f69f..0be365f 100644
--- a/bootstrap/types.c
+++ b/bootstrap/types.c
@@ -10,7 +10,7 @@ static struct {
} **buckets;
char *tags;
} types;
-static vec_t(const struct type *) typesvec;
+static vec_t(const struct type *) typesvec; // insertion order
void
inittypes() {