@@ -168,7 +168,7 @@ namespace {
168
168
for (auto & arg: flag.GetArgs ()) {
169
169
args.push_back (arg);
170
170
}
171
- if (!ApplyFlag (pos, flag.GetName (), args, ctx, 0 )) {
171
+ if (!ApplyFlag (pos, flag.GetName (), args, ctx)) {
172
172
return false ;
173
173
}
174
174
}
@@ -260,23 +260,15 @@ namespace {
260
260
for (size_t i = 3 ; i < node->ChildrenSize (); ++i) {
261
261
if (node->Child (i)->IsCallable (" EvaluateAtom" )) {
262
262
hasPendingEvaluations = true ;
263
- break ;
263
+ return res ;
264
264
}
265
265
if (!EnsureAtom (*node->Child (i), ctx)) {
266
266
return {};
267
267
}
268
268
args.push_back (node->Child (i)->Content ());
269
269
}
270
270
271
- if (hasPendingEvaluations) {
272
- if (!ValidateEvaluation (command, *node, ctx)) {
273
- return {};
274
- }
275
-
276
- return res;
277
- }
278
-
279
- if (!ApplyFlag (ctx.GetPosition (node->Child (2 )->Pos ()), command, args, ctx, node->UniqueId ())) {
271
+ if (!ApplyFlag (ctx.GetPosition (node->Child (2 )->Pos ()), command, args, ctx)) {
280
272
return {};
281
273
}
282
274
@@ -468,30 +460,7 @@ namespace {
468
460
return true ;
469
461
}
470
462
471
- bool ValidateEvaluation (const TStringBuf name, const TExprNode& node, TExprContext& ctx) {
472
- if (name == " AddFileByUrl" || name == " AddFolderByUrl" ) {
473
- if (node.ChildrenSize () < 4 ) {
474
- ctx.AddError (TIssue (ctx.GetPosition (node.Pos ()), TStringBuilder () << " Expected at least 4 arguments, but got " << node.ChildrenSize ()));
475
- return false ;
476
- }
477
-
478
- if (node.Child (3 )->IsCallable (" EvaluateAtom" )) {
479
- return true ;
480
- }
481
-
482
- if (!PendingEvaluationFiles.insert ({TString (node.Child (3 )->Content ()), node.UniqueId ()}).second ) {
483
- ctx.AddError (TIssue (ctx.GetPosition (node.Pos ()), TStringBuilder () << " Detected evaluation cycle for file: " << node.Child (3 )->Content ()));
484
- return false ;
485
- }
486
-
487
- return true ;
488
- } else {
489
- return true ;
490
- }
491
- }
492
-
493
- bool ApplyFlag (const TPosition& pos, const TStringBuf name, const TVector<TStringBuf>& args, TExprContext& ctx,
494
- ui64 nodeUniqueId) {
463
+ bool ApplyFlag (const TPosition& pos, const TStringBuf name, const TVector<TStringBuf>& args, TExprContext& ctx) {
495
464
if (!IsSettingAllowed (pos, name, ctx)) {
496
465
return false ;
497
466
}
@@ -505,15 +474,15 @@ namespace {
505
474
return false ;
506
475
}
507
476
} else if (name == " AddFileByUrl" ) {
508
- if (!AddFileByUrl (pos, args, ctx, nodeUniqueId )) {
477
+ if (!AddFileByUrl (pos, args, ctx)) {
509
478
return false ;
510
479
}
511
480
} else if (name == " SetFileOption" ) {
512
481
if (!SetFileOption (pos, args, ctx)) {
513
482
return false ;
514
483
}
515
484
} else if (name == " AddFolderByUrl" ) {
516
- if (!AddFolderByUrl (pos, args, ctx, nodeUniqueId )) {
485
+ if (!AddFolderByUrl (pos, args, ctx)) {
517
486
return false ;
518
487
}
519
488
} else if (name == " SetPackageVersion" ) {
@@ -1026,13 +995,12 @@ namespace {
1026
995
return true ;
1027
996
}
1028
997
1029
- bool AddFileByUrl (const TPosition& pos, const TVector<TStringBuf>& args, TExprContext& ctx, ui64 nodeUniqueId ) {
998
+ bool AddFileByUrl (const TPosition& pos, const TVector<TStringBuf>& args, TExprContext& ctx) {
1030
999
if (args.size () < 2 || args.size () > 3 ) {
1031
1000
ctx.AddError (TIssue (pos, TStringBuilder () << " Expected 2 or 3 arguments, but got " << args.size ()));
1032
1001
return false ;
1033
1002
}
1034
1003
1035
- PendingEvaluationFiles.erase ({TString (args[0 ]),nodeUniqueId});
1036
1004
TStringBuf token = args.size () == 3 ? args[2 ] : TStringBuf ();
1037
1005
if (token) {
1038
1006
if (auto cred = Types.Credentials ->FindCredential (token)) {
@@ -1146,13 +1114,12 @@ namespace {
1146
1114
return url;
1147
1115
}
1148
1116
1149
- bool AddFolderByUrl (const TPosition& pos, const TVector<TStringBuf>& args, TExprContext& ctx, ui64 nodeUniqueId ) {
1117
+ bool AddFolderByUrl (const TPosition& pos, const TVector<TStringBuf>& args, TExprContext& ctx) {
1150
1118
if (args.size () < 2 || args.size () > 3 ) {
1151
1119
ctx.AddError (TIssue (pos, TStringBuilder () << " Expected 2 or 3 arguments, but got " << args.size ()));
1152
1120
return false ;
1153
1121
}
1154
1122
1155
- PendingEvaluationFiles.erase ({TString (args[0 ]),nodeUniqueId});
1156
1123
TStringBuf token = args.size () == 3 ? args[2 ] : TStringBuf ();
1157
1124
if (token) {
1158
1125
if (auto cred = Types.Credentials ->FindCredential (token)) {
@@ -1249,7 +1216,6 @@ namespace {
1249
1216
TString Username;
1250
1217
const TAllowSettingPolicy Policy;
1251
1218
TOperationStatistics Statistics;
1252
- THashSet<std::pair<TString, ui64>> PendingEvaluationFiles;
1253
1219
};
1254
1220
}
1255
1221
0 commit comments