MCPcopy Create free account
hub / github.com/BaseXdb/basex / inline

Method inline

basex-core/src/main/java/org/basex/query/expr/Mapping.java:111–138  ·  view source on GitHub ↗
(final InlineContext ic)

Source from the content-addressed store, hash-verified

109 }
110
111 @Override
112 public final Expr inline(final InlineContext ic) throws QueryException {
113 boolean changed = false;
114 // context inlining: only consider first expression
115 final CompileContext cc = ic.cc;
116 final int el = ic.var == null ? 1 : exprs.length;
117 final boolean items = items();
118 for(int e = 0; e < el; e++) {
119 Expr inlined;
120 try {
121 inlined = exprs[e].inline(ic);
122 } catch(final QueryException ex) {
123 // replace original expression with error
124 inlined = FnError.get(ex, exprs[e]);
125 }
126 if(inlined != null) {
127 exprs[e] = inlined;
128 changed = true;
129 } else {
130 inlined = exprs[e];
131 }
132 if(e == 0) cc.pushFocus(inlined, items);
133 else cc.updateFocus(inlined, items);
134 }
135 cc.removeFocus();
136
137 return changed ? optimize(cc) : null;
138 }
139
140 @Override
141 public final void markTailCalls(final CompileContext cc) {

Callers

nothing calls this directly

Calls 10

itemsMethod · 0.95
getMethod · 0.95
pushFocusMethod · 0.95
updateFocusMethod · 0.95
removeFocusMethod · 0.95
inlineableMethod · 0.95
inlineMethod · 0.95
inlineMethod · 0.65
optimizeMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected