X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=expressp.c;h=79f7c7a30227b01e69d7cff5c03fab16870eefde;hb=d1090135a32de7b38b48c55d4e21f95da4c405bc;hp=4c32f0ec962be040b7f74feceea40de9132abfa1;hpb=5154191043a9b7227ef0eee1a2b40299fc188655;p=inform.git diff --git a/expressp.c b/expressp.c index 4c32f0e..79f7c7a 100644 --- a/expressp.c +++ b/expressp.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* "expressp" : The expression parser */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2016 */ +/* Copyright (c) Graham Nelson 1993 - 2018 */ /* */ /* This file is part of Inform. */ /* */ @@ -142,6 +142,14 @@ but not used as a value:", unicode); current_token.symflags = sflags[symbol]; switch(stypes[symbol]) { case ROUTINE_T: + /* Replaced functions must always be backpatched + because there could be another definition coming. */ + if (sflags[symbol] & REPLACE_SFLAG) + { current_token.marker = SYMBOL_MV; + if (module_switch) import_symbol(symbol); + v = symbol; + break; + } current_token.marker = IROUTINE_MV; break; case GLOBAL_VARIABLE_T: @@ -1881,7 +1889,8 @@ extern assembly_operand parse_expression(int context) if ((a.type == ENDEXP_TT) && (b.type == ENDEXP_TT)) { if (emitter_sp == 0) - { compiler_error("SR error: emitter stack empty"); + { error("No expression between brackets '(' and ')'"); + put_token_back(); return AO; } if (emitter_sp > 1)