Converts A && A.B into A?.B (#54342)

Implements the ?. operator, replacing code like A && A.B with A?.B

BYOND Ref:
When reading A?.B, it's equivalent to A && A.B except that A is only evaluated once, even if it's a complex expression like a proc call.
This commit is contained in:
ZeWaka
2020-10-13 12:43:53 -07:00
committed by GitHub
parent a92fcb5295
commit 9629feed35
214 changed files with 377 additions and 377 deletions
+3 -3
View File
@@ -18,14 +18,14 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
//if we got to here without silently ending, the byond bug has been fixed.
log_world("The bug with recursion runtimes has been fixed. Please remove the snowflake check from world/Error in [__FILE__]:[__LINE__]")
return //this will never happen.
else if(copytext(E.name, 1, 18) == "Out of resources!")//18 == length() of that string + 1
log_world("BYOND out of memory. Restarting")
log_game("BYOND out of memory. Restarting")
TgsEndProcess()
Reboot(reason = 1)
return ..()
if (islist(stack_trace_storage))
for (var/line in splittext(E.desc, "\n"))
if (text2ascii(line) != 32)
@@ -59,7 +59,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
var/configured_error_cooldown
var/configured_error_limit
var/configured_error_silence_time
if(config && config.entries)
if(config?.entries)
configured_error_cooldown = CONFIG_GET(number/error_cooldown)
configured_error_limit = CONFIG_GET(number/error_limit)
configured_error_silence_time = CONFIG_GET(number/error_silence_time)