Пример #1
0
 private Expr SaveOrAppend(IToken file, JPathParser.ExprContext input, bool append)
 {
     return(new FuncAppExpr(
                func: new FuncObj(append ? LibraryFunctions.AppendFunction : LibraryFunctions.SaveFunction),
                args: new Expr[]
     {
         new StrLit(ExtractStringFromStringLiteralToken(file)),
         input.Accept(this)
     }));
 }
Пример #2
0
 private static Possible <Expr> TryConvertInternal(JPathParser.ExprContext expr)
 {
     try
     {
         return(expr.Accept(new AstConverter()));
     }
     catch (Exception e)
     {
         return(new Failure <string>(e.ToString()));
     }
 }