diff options
| author | 2022-08-19 16:34:58 +0200 | |
|---|---|---|
| committer | 2022-08-19 16:34:58 +0200 | |
| commit | 80f5dca7aa8c9a7f3bf467f9ae2bdc1eae0e9a2b (patch) | |
| tree | b23c31e3304e715c7bbdb43ded559e088484a193 | |
| parent | 57af02b91cb3a9eef66137c85aab7e47bdd7d0a5 (diff) | |
attrib
| -rw-r--r-- | src/cffc.hff | 2 | ||||
| -rw-r--r-- | src/parse.cff | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/cffc.hff b/src/cffc.hff index 920f74a..9fd9080 100644 --- a/src/cffc.hff +++ b/src/cffc.hff @@ -288,6 +288,8 @@ struct Decl { myenv *Env, } +def ATTR_LAX = 1u32; + struct ExpanArg { name *const u8, toks [#]Tok, 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 { |