aboutsummaryrefslogtreecommitdiff
path: root/src/parse.cff
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.cff')
-rw-r--r--src/parse.cff16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/parse.cff b/src/parse.cff
index 5c3ac63..2e6cec9 100644
--- a/src/parse.cff
+++ b/src/parse.cff
@@ -804,6 +804,7 @@ fn parseagg(P *Parser, loc Loc, kind AggKind, name *const u8, retdecl **Decl) *c
fld.off += off;
}
}
+ llvm_addtype(ty);
if havedecls {
agg.decls = mkenv(P.curenv, P.alloc);
constty.u.Agg.decls = agg.decls;
@@ -1461,8 +1462,19 @@ fn pexprimary(P *Parser) Expr {
ex = { tok.loc, ty_voidptr, .u: :NullLit };
case :str;
- let ty = mkarrtype(tok.u.str.#len + 1, #t, ty_u8);
- ex = { tok.loc, ty, .u: :StrLit(tok.u.str) };
+ let str = tok.u.str;
+ let s Vec<u8> = {};
+ if lexpeek(P).t == :str {
+ foreach (c, _, tok.u.str) { s->push(c); }
+ while lexmatch(P, &tok, :str) {
+ foreach (c, _, tok.u.str) { s->push(c); }
+ }
+ s->push('\0');
+ --s.len;
+ str = s->move(P.tlalloc);
+ }
+ let ty = mkarrtype(str.#len + 1, #t, ty_u8);
+ ex = { tok.loc, ty, .u: :StrLit(str) };
case :ident;
let ident = tok.u.ident;