diff --git a/polymer/eduke32/source/lunatic/doc/lunacon.txt b/polymer/eduke32/source/lunatic/doc/lunacon.txt index 587c63d14..4cc0a6d94 100644 --- a/polymer/eduke32/source/lunatic/doc/lunacon.txt +++ b/polymer/eduke32/source/lunatic/doc/lunacon.txt @@ -206,7 +206,7 @@ LunaCON makes a clear distinction between ``outer'' commands that have an effect when translating a CON file (_directives_ such as `gamevar`, `definesound` or `spritenvg`) and ``inner'' commands meant to be effective at execution time of `actor`/`useractor`, `state`, `event` and `eventloadactor` -blocks. This, issuing directives inside of these will make LunaCON reject the +blocks. Thus, issuing directives inside of these will make LunaCON reject the input file due to a syntax error, as will an attempt to use run-time commands such as `sizeat` at file scope. diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index 2623673ad..6c515d690 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -503,7 +503,7 @@ local function get_cache_sap_code() end -- fwd-decls -local warnprintf, errprintf, pwarnprintf, perrprintf +local warnprintf, errprintf, pwarnprintf, perrprintf, contprintf local on = {} @@ -643,29 +643,29 @@ local function increment_numerrors() end function perrprintf(pos, fmt, ...) - printf("%s %s: error: "..fmt, g_filename, linecolstr(pos), ...) + printf("%s %s: error: "..fmt, g_filename, + pos and linecolstr(pos) or "???", ...) increment_numerrors() end function errprintf(fmt, ...) - if (g_lastkwpos) then - perrprintf(g_lastkwpos, fmt, ...) - else - printf("%s ???: error: "..fmt, g_filename, ...) - increment_numerrors() - end + perrprintf(g_lastkwpos, fmt, ...) end function pwarnprintf(pos, fmt, ...) - printf("%s %s: warning: "..fmt, g_filename, linecolstr(pos), ...) + printf("%s %s: warning: "..fmt, g_filename, + pos and linecolstr(pos) or "???", ...) end function warnprintf(fmt, ...) - if (g_lastkwpos) then - pwarnprintf(g_lastkwpos, fmt, ...) - else - printf("%s ???: warning: "..fmt, g_filename, ...) - end + pwarnprintf(g_lastkwpos, fmt, ...) +end + +-- Print a continuation line to an error or warning. +function contprintf(iserr, fmt, ...) + printf("%s %s: %s "..fmt, g_filename, + g_lastkwpos and linecolstr(g_lastkwpos) or "???", + iserr and " " or " ", ...) end local function parse_number(pos, numstr) @@ -731,6 +731,7 @@ local LABEL_PREFIX = { [2]="M", [3]="I", [5]="C" } -- _C, _M, _I in the gen'd c local g_labeldef = {} -- Lua numbers for numbers, strings for composites local g_labeltype = {} local g_labelspecial = {} -- [