(Namespace n, Symbol sym)
| 8008 | |
| 8009 | |
| 8010 | static public Object maybeResolveIn(Namespace n, Symbol sym) { |
| 8011 | //note - ns-qualified vars must already exist |
| 8012 | if(sym.ns != null) |
| 8013 | { |
| 8014 | Namespace ns = namespaceFor(n, sym); |
| 8015 | if(ns == null) |
| 8016 | return HostExpr.maybeArrayClass(sym); |
| 8017 | Var v = ns.findInternedVar(Symbol.intern(sym.name)); |
| 8018 | if(v == null) |
| 8019 | return null; |
| 8020 | return v; |
| 8021 | } |
| 8022 | else if(sym.name.indexOf('.') > 0 && !sym.name.endsWith(".") |
| 8023 | || sym.name.charAt(0) == '[') |
| 8024 | { |
| 8025 | try { |
| 8026 | return RT.classForName(sym.name); |
| 8027 | } catch (Exception e) { |
| 8028 | if (e instanceof ClassNotFoundException) |
| 8029 | return null; |
| 8030 | else |
| 8031 | return Util.sneakyThrow(e); |
| 8032 | } |
| 8033 | } |
| 8034 | else if(sym.equals(NS)) |
| 8035 | return RT.NS_VAR; |
| 8036 | else if(sym.equals(IN_NS)) |
| 8037 | return RT.IN_NS_VAR; |
| 8038 | else |
| 8039 | { |
| 8040 | Object o = n.getMapping(sym); |
| 8041 | return o; |
| 8042 | } |
| 8043 | } |
| 8044 | |
| 8045 | |
| 8046 | static Var lookupVar(Symbol sym, boolean internNew, boolean registerMacro) { |
no test coverage detected