sclass LASCompileResult { settable S script; settable GazelleV_LeftArrowScriptParser parser; settable Throwable compileError; /*settable broken*/ GazelleV_LeftArrowScript.Script parsedScript; RunResultWithTimestamps compileLog; toString { if (compileError != null) ret errorToString(); if (parsedScript == null) ret "Not compiled yet"; ret "Compiled OK" + (compileLog == null ? "" : " in " + n2(max(1, compileLog.duration().toMillis())) + " ms"; } bool hasError() { ret compileError != null; } S errorToString() { ret exceptionToStringShorter_dontDropOuterExceptions(compileError); } bool runnable() { ret parsedScript != null; } void compile() { compileLog = runResultWithTimestamps_dontPrintStackTrace(-> { if (parser == null) parser = makeParser(); ret parsedScript = parser.parse(script); }); if (compileLog.isError()) { var e = compileLog.getError(); compileError(e); } } GazelleV_LeftArrowScript.Script parsedScript aka get() { ret parsedScript; } GazelleV_LeftArrowScript.Script parsedScriptMandatory() { if (compileError != null) fail(compileError); ret parsedScript; } swappable GazelleV_LeftArrowScriptParser makeParser() { null; } LineAndColumn errorLineAndCol() { ret parseLineAndColumn(str(compileError)); } Timestamp compilationStart() { ret compileLog?.started; } }