public ExpressionNode evaluate()

in src/main/java/org/apache/sling/scripting/sightly/impl/compiler/optimization/SyntheticMapRemoval.java [125:142]


        public ExpressionNode evaluate(PropertyAccess propertyAccess) {
            ExpressionNode target = propertyAccess.getTarget();
            String variable = extractIdentifier(target);
            if (variable != null) {
                MapLiteral literal = tracker.get(variable);
                if (literal != null) {
                    String property = extractProperty(propertyAccess.getProperty());
                    if (property != null) {
                        ExpressionNode replacementNode = literal.getValue(property);
                        if (replacementNode == null) {
                            replacementNode = NullLiteral.INSTANCE;
                        }
                        return replacementNode;
                    }
                }
            }
            return super.evaluate(propertyAccess);
        }