/** */ public void unsetVariable( String name ) { super.unsetVariable( name ); externalMap.remove( name ); }
/** */ public void unsetVariable( String name ) { super.unsetVariable( name ); externalMap.remove( name ); }
@Override public Object remove(Object key) { final Object result = get(key); nameSpace.unsetVariable((String)key); return result; }
protected void unset(Scope scope, String name) { if (scope != null) { final NameSpace bshns = prepareNS(scope); //note: we have to create NameSpace (with prepareNS) //to have the correct chain if (bshns != _bshns) { bshns.unsetVariable(name); return; } } unset(name); }
super.unsetVariable( name );
super.unsetVariable( name );
/** Unassign the variable name. Name should evaluate to a variable. */ public void unset( String name ) throws EvalError { /* We jump through some hoops here to handle arbitrary cases like unset("bsh.foo"); */ CallStack callstack = new CallStack(); try { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS( callstack, this ); if ( lhs.type != LHS.VARIABLE ) throw new EvalError("Can't unset, not a variable: "+name, SimpleNode.JAVACODE, new CallStack()); lhs.nameSpace.unsetVariable( name ); } catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack(), e); } }
/** Unassign the variable name. Name should evaluate to a variable. */ public void unset( String name ) throws EvalError { /* We jump through some hoops here to handle arbitrary cases like unset("bsh.foo"); */ CallStack callstack = new CallStack(); try { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS( new BshEvaluatingVisitor(callstack, this) ); if ( lhs.type != LHS.VARIABLE ) throw new EvalError("Can't unset, not a variable: "+name, SimpleNode.JAVACODE, new CallStack() ); //lhs.assign( null, false ); lhs.nameSpace.unsetVariable( name ); } catch ( UtilEvalError e ) { throw new EvalError( e.getMessage(), SimpleNode.JAVACODE, new CallStack() ); } }