From 80f5dca7aa8c9a7f3bf467f9ae2bdc1eae0e9a2b Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 19 Aug 2022 16:34:58 +0200 Subject: attrib --- src/parse.cff | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/parse.cff') diff --git a/src/parse.cff b/src/parse.cff index 2f5fbe2..3453485 100644 --- a/src/parse.cff +++ b/src/parse.cff @@ -2562,6 +2562,19 @@ fn parsedecls(P *Parser, loc Loc, yield DeclYielder, yarg *void, toplevel bool) externp = #f, name *const u8 = #null; + let attr u32 = 0; + if lexmatch(P, &tok, '#') { + lexexpect(P, '['); + while !lexmatch(P, #null, ']') { + let a = (tok = lexexpect(P, :ident)).u.ident; + if streq(a, "lax") { + attr |= ATTR_LAX; + } else { + err(P, tok.loc, "unknown attribute %qT", tok); + } + } + } + if lexmatch(P, &tok, :kw_extern) { externp = #t; if (tok = lexpeek(P)).t != :kw_fn and tok.t != :kw_static { -- cgit v1.2.3