A named function literal. @author BaseX Team, BSD License @author Leo Woerteler
| 21 | * @author Leo Woerteler |
| 22 | */ |
| 23 | public final class FuncLit extends Single implements Scope, XQFunctionExpr { |
| 24 | /** Variable scope. */ |
| 25 | private final VarScope vs; |
| 26 | /** Function name. */ |
| 27 | private final QNm name; |
| 28 | /** Parameters. */ |
| 29 | private final Var[] params; |
| 30 | /** Annotations. */ |
| 31 | private final AnnList anns; |
| 32 | |
| 33 | /** |
| 34 | * Constructor. |
| 35 | * @param info input info (can be {@code null}) |
| 36 | * @param expr function body |
| 37 | * @param params parameters |
| 38 | * @param anns annotations |
| 39 | * @param seqType sequence type |
| 40 | * @param name function name |
| 41 | * @param vs variable scope |
| 42 | */ |
| 43 | FuncLit(final InputInfo info, final Expr expr, final Var[] params, final AnnList anns, |
| 44 | final SeqType seqType, final QNm name, final VarScope vs) { |
| 45 | |
| 46 | super(info, expr, seqType); |
| 47 | this.name = name; |
| 48 | this.params = params; |
| 49 | this.anns = anns; |
| 50 | this.vs = vs; |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public int arity() { |
| 55 | return params.length; |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public QNm funcName() { |
| 60 | return name; |
| 61 | } |
| 62 | |
| 63 | @Override |
| 64 | public QNm paramName(final int pos) { |
| 65 | return params[pos].name; |
| 66 | } |
| 67 | |
| 68 | @Override |
| 69 | public AnnList annotations() { |
| 70 | return anns; |
| 71 | } |
| 72 | |
| 73 | @Override |
| 74 | public Expr inline(final Expr[] exprs, final CompileContext cc) { |
| 75 | return null; |
| 76 | } |
| 77 | |
| 78 | @Override |
| 79 | public boolean vacuousBody() { |
| 80 | return false; |
nothing calls this directly
no outgoing calls
no test coverage detected