public static string name(this Jint_Visitor jintVisitor, MethodCall methodCall) { var previous = jintVisitor.previous(methodCall); return(previous.notNull() ? previous.str() : null); }
public static Statement previous(this Jint_Visitor jintVisitor, Statement startStatement) { var match = jintVisitor.previous(startStatement, false); if (match.notNull() && match.size() > 0) { return(match[0]); } return(null); }
public static List <T> previous_All <T>(this Jint_Visitor jintVisitor, Statement startStatement, Type untilStatement) where T : Statement { var allPrevious = new List <T>(); var previous = jintVisitor.previous(startStatement); while (previous.notNull()) { if (untilStatement.notNull() && previous.type() == untilStatement) { break; } if (previous is T) { allPrevious.add((T)previous); } previous = jintVisitor.previous(previous); } return(allPrevious); }