static bool parser_close_call(parser_t *parser, shunt *sy)
{
+ if (!parser->function)
+ {
+ parseerror(parser, "cannot call functions from global scope");
+ return false;
+ }
+
/* was a function call */
ast_expression *fun;
ast_value *funval = nullptr;
{ "noreturn", AST_FLAG_NORETURN },
{ "inline", AST_FLAG_INLINE },
{ "eraseable", AST_FLAG_ERASEABLE },
+ { "noerase", AST_FLAG_NOERASE },
{ "accumulate", AST_FLAG_ACCUMULATE },
{ "last", AST_FLAG_FINAL_DECL }
};
if (i != GMQCC_ARRAY_COUNT(attributes))
goto leave;
-
if (!strcmp(parser_tokval(parser), "noref")) {
had_noref = true;
if (!parser_next(parser) || parser->tok != TOKEN_ATTRIBUTE_CLOSE) {
* store the vstring back to var for alias and
* deprecation messages.
*/
- if (var->m_flags & AST_FLAG_DEPRECATED ||
- var->m_flags & AST_FLAG_ALIAS)
+ if (var->m_flags & AST_FLAG_DEPRECATED || var->m_flags & AST_FLAG_ALIAS)
var->m_desc = vstring;
if (parser_find_global(parser, var->m_name) && var->m_flags & AST_FLAG_ALIAS) {