import java.util.*;
import java.util.zip.*;
import java.util.List;
import java.util.regex.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import java.util.function.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.table.*;
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.management.*;
import java.security.*;
import java.security.spec.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.awt.geom.*;
import javax.imageio.*;
import java.math.*;
import java.time.Duration;
import java.lang.invoke.VarHandle;
import java.lang.invoke.MethodHandles;
import static x30_pkg.x30_util.DynamicObject;
import org.apache.bcel.classfile.ClassParser;
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.Const;
import org.apache.bcel.generic.*;
import java.lang.reflect.Type;
import java.util.jar.*;
import java.text.*;
import java.awt.geom.*;
import java.text.NumberFormat;
import java.nio.charset.Charset;
import java.util.TimeZone;
import java.nio.file.Path;
import java.text.SimpleDateFormat;
public class main {
static public void test_leftArrowScript_var() {
assertEqualsVerbose("hello", leftArrowVerbose("\r\n var bla: S <- \"hello\"; bla\r\n "));
}
static public A assertEqualsVerbose(Object x, A y) {
assertEqualsVerbose((String) null, x, y);
return y;
}
static public A assertEqualsVerbose(String msg, Object x, A y) {
if (!eq(x, y)) {
throw fail((nempty(msg) ? msg + ": " : "") + "expected: " + x + ", got: " + y);
} else
print("OK" + (empty(msg) ? "" : " " + msg) + ": " + (x));
return y;
}
static public void assertEqualsVerbose(Scorer scorer, Object x, Object y) {
assertEqualsVerbose(scorer, "", x, y);
}
static public void assertEqualsVerbose(Scorer scorer, String msg, Object x, Object y) {
if (scorer == null) {
assertEqualsVerbose(x, y);
return;
}
if (!eq(x, y)) {
print(appendColonIfNempty(msg) + y + " != " + x);
scorer.add(false);
} else {
print("OK: " + appendColonIfNempty(msg) + x);
scorer.add(true);
}
}
static public Object leftArrowVerbose(LASClassLoader lasClassLoader, String script) {
GazelleV_LeftArrowScriptParser parser = new GazelleV_LeftArrowScriptParser();
parser.lasClassLoader(lasClassLoader);
return leftArrowVerbose(parser, script);
}
static public Object leftArrowVerbose(String script) {
return leftArrowVerbose(new GazelleV_LeftArrowScriptParser(), script);
}
static public Object leftArrowVerbose(GazelleV_LeftArrowScriptParser parser, String script) {
if (parser.lasClassLoader() != null)
parser.lasClassLoader().rememberClassBytes(true);
enableScaffolding(parser);
parser.allowTheWorld();
var parsedScript = parser.parse(script);
parser.printFunctionDefs(parsedScript);
print(parsedScript);
print("leftArrowVerbose:\n" + GazelleV_LeftArrowScript.indentedScriptStruct(parsedScript));
FlexibleVarContext ctx = new FlexibleVarContext();
var result = parsedScript.get(ctx);
ctx.printMe();
return result;
}
static public boolean eq(Object a, Object b) {
return a == b || a != null && b != null && a.equals(b);
}
static public boolean eq(Symbol a, String b) {
return eq(str(a), b);
}
static public RuntimeException fail() {
throw new RuntimeException("fail");
}
static public RuntimeException fail(Throwable e) {
throw asRuntimeException(e);
}
static public RuntimeException fail(Object msg) {
throw new RuntimeException(String.valueOf(msg));
}
static public RuntimeException fail(Object... objects) {
throw new Fail(objects);
}
static public RuntimeException fail(String msg) {
throw new RuntimeException(msg == null ? "" : msg);
}
static public RuntimeException fail(String msg, Throwable innerException) {
throw new RuntimeException(msg, innerException);
}
static public boolean nempty(Collection c) {
return !empty(c);
}
static public boolean nempty(CharSequence s) {
return !empty(s);
}
static public boolean nempty(Object[] o) {
return !empty(o);
}
static public boolean nempty(byte[] o) {
return !empty(o);
}
static public boolean nempty(int[] o) {
return !empty(o);
}
static public boolean nempty(BitSet bs) {
return !empty(bs);
}
static public boolean nempty(Map m) {
return !empty(m);
}
static public boolean nempty(Iterator i) {
return i != null && i.hasNext();
}
static public boolean nempty(IMultiMap mm) {
return mm != null && mm.size() != 0;
}
static public boolean nempty(Object o) {
return !empty(o);
}
static public boolean nempty(IntRange r) {
return !empty(r);
}
static public boolean nempty(Rect r) {
return r != null && r.w != 0 && r.h != 0;
}
static public boolean nempty(MultiSet ms) {
return ms != null && !ms.isEmpty();
}
static volatile public StringBuffer local_log = new StringBuffer();
static public boolean printAlsoToSystemOut = true;
static volatile public Appendable print_log = local_log;
static volatile public int print_log_max = 1024 * 1024;
static volatile public int local_log_max = 100 * 1024;
static public boolean print_silent = false;
static public Object print_byThread_lock = new Object();
static volatile public ThreadLocal