use of org.erlide.util.erlang.OtpBindings in project erlide_eclipse by erlang.
the class PatternMatchTest method testMatch_0.
@Test
public void testMatch_0() throws Exception {
final OtpBindings b = new OtpBindings();
b.put("W", new OtpErlangAtom("a"));
final OtpBindings r = OtpErlang.match("[W, V]", "[a, b]", b);
Assert.assertNotNull(r);
Assert.assertEquals(r.get("V"), new OtpErlangAtom("b"));
}
use of org.erlide.util.erlang.OtpBindings in project erlide_eclipse by erlang.
the class PatternMatchTest method testMatch_ellipsis_4.
@Test()
public void testMatch_ellipsis_4() throws Exception {
final OtpBindings r = OtpErlang.match("[X | y]", "[x,y,z]");
Assert.assertNull(r);
}
use of org.erlide.util.erlang.OtpBindings in project erlide_eclipse by erlang.
the class PatternMatchTest method testMatch.
@Test
public void testMatch() throws Exception {
final OtpBindings r = OtpErlang.match("[W, V]", "[a, b]");
Assert.assertEquals(r.get("W"), new OtpErlangAtom("a"));
Assert.assertEquals(r.get("V"), new OtpErlangAtom("b"));
}
use of org.erlide.util.erlang.OtpBindings in project erlide_eclipse by erlang.
the class ErlideDebug method setVariableValue.
@SuppressWarnings("boxing")
public static String setVariableValue(final IOtpRpc backend, final String name, final String value, final int stackFrameNo, final OtpErlangPid meta) {
try {
final OtpErlangObject res = backend.call(ErlideDebug.ERLIDE_DEBUG, "set_variable_value", "ssix", name, value, stackFrameNo + 1, meta);
try {
final OtpBindings bind = OtpErlang.match("{eval_rsp, {'EXIT', Val}}", res);
if (bind == null) {
return null;
}
final String err = bind.getAsString("Val");
return err;
} catch (final OtpParserException e1) {
}
return null;
} catch (final RpcException e) {
ErlLogger.warn(e);
}
return "error";
}
Aggregations