Package erjang.m.ets

Examples of erjang.m.ets.EMatchSpec$MatchVariable


   

  @BIF
  static public EObject match_spec_test(EObject term, EObject matchSpec, EObject how)
  {
    EMatchSpec spec;
    ESeq seq;
    if ((matchSpec instanceof EMatchSpec)) {
      spec = (EMatchSpec) matchSpec;
    } else if ((seq=matchSpec.testSeq()) != null) {
      try {
        spec = EMatchSpec.compile(seq);
      } catch (ErlangError e) {
        if (e.reason() == ERT.am_badarg) {
          throw ERT.badarg(term, matchSpec, how);
        } else {
          throw e;
        }
      }
    } else {
      throw ERT.badarg(term, matchSpec, how);
    }
   
    EObject res = spec.match(term);
    if (res == null) {
      return ETuple.make(ERT.am_ok, ERT.FALSE, ERT.NIL, ERT.NIL);
    } else {
      return ETuple.make(ERT.am_ok, ERT.TRUE, ERT.NIL, ERT.NIL);
    }
View Full Code Here

TOP

Related Classes of erjang.m.ets.EMatchSpec$MatchVariable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.