+ if (parser->tok == TOKEN_ATTRIBUTE_OPEN) {
+ /* parse an attribute */
+ if (!parser_next(parser)) {
+ parseerror(parser, "expected attribute after `[[`");
+ return false;
+ }
+ if (!strcmp(parser_tokval(parser), "noreturn")) {
+ had_noreturn = true;
+ if (!parser_next(parser) || parser->tok != TOKEN_ATTRIBUTE_CLOSE) {
+ parseerror(parser, "`noreturn` attribute has no parameters, expected `]]`");
+ return false;
+ }
+ }
+ else if (!strcmp(parser_tokval(parser), "noref")) {
+ had_noref = true;
+ if (!parser_next(parser) || parser->tok != TOKEN_ATTRIBUTE_CLOSE) {
+ parseerror(parser, "`noref` attribute has no parameters, expected `]]`");
+ return false;
+ }
+ }
+ else
+ {
+ /* Skip tokens until we hit a ]] */
+ while (parser->tok != TOKEN_ATTRIBUTE_CLOSE) {
+ if (!parser_next(parser)) {
+ parseerror(parser, "error inside attribute");
+ return false;
+ }
+ }
+ }
+ }
+ else if (!strcmp(parser_tokval(parser), "const"))