@@ -223,31 +223,54 @@ namespace FPL {
223
223
exit (1 );
224
224
}
225
225
226
+
227
+ std::string finalValue;
226
228
auto wantCheckValue = CheckerValue ();
227
- if (!wantCheckValue.has_value ()) {
228
- std::cerr << " Vous devez mettre une valeur que vous souhaitez verifier !" << std::endl;
229
- exit (1 );
229
+ std::optional<Token> wantCheckIdf;
230
+
231
+ if (wantCheckValue.has_value ()) {
232
+ finalValue = wantCheckValue->StatementName ;
233
+ } else {
234
+ wantCheckIdf = CheckerIdentifiant ();
235
+ if (wantCheckIdf.has_value ()) {
236
+ if (fonction.has_value () && isArgument (fonction->FonctionName , wantCheckIdf->mText )) {
237
+ finalValue = mArguments [fonction->FonctionName ][wantCheckIdf->mText ].ArgValue ;
238
+ } else if (isVariable (wantCheckIdf->mText )) {
239
+ finalValue = mVariables [wantCheckIdf->mText ].VariableValue ;
240
+ }
241
+ } else {
242
+ std::cerr << " Vous devez mettre une valeur que vous souhaitez verifier !" << std::endl;
243
+ exit (1 );
244
+ }
230
245
}
246
+ contentValues.push_back (finalValue);
247
+
231
248
232
249
if (CheckerOperateur (" ," ).has_value ()) {
233
- auto wantCheckValue2 = CheckerValue ();
234
- if (wantCheckValue2.has_value ()) {
235
- morethanoneValue = true ;
236
- contentValues.push_back (wantCheckValue2->StatementName );
237
- contentValues.push_back (wantCheckValue->StatementName );
238
-
239
- while (!CheckerOperateur (" :" ).has_value ()) {
240
- auto nextValue = CheckerValue ();
241
- if (!nextValue.has_value ()) {
250
+ while (!CheckerOperateur (" :" ).has_value ()) {
251
+ std::string value;
252
+ auto nextValue = CheckerValue ();
253
+ std::optional<Token> nextValueIdf;
254
+ if (nextValue.has_value ()) {
255
+ value = nextValue->StatementName ;
256
+ } else {
257
+ nextValueIdf = CheckerIdentifiant ();
258
+ if (nextValueIdf.has_value ()) {
259
+ if (fonction.has_value () && isArgument (fonction->FonctionName , nextValueIdf->mText )) {
260
+ value = mArguments [fonction->FonctionName ][nextValueIdf->mText ].ArgValue ;
261
+ } else if (isVariable (nextValueIdf->mText )) {
262
+ value = mVariables [nextValueIdf->mText ].VariableValue ;
263
+ }
264
+ } else {
242
265
std::cerr << " Vous devez mettre une valeur que vous souhaitez verifier !" << std::endl;
243
266
exit (1 );
244
267
}
268
+ }
245
269
246
- contentValues.push_back (nextValue-> StatementName );
270
+ contentValues.push_back (value );
247
271
248
- if (!CheckerOperateur (" ," ).has_value ()) {
249
- break ;
250
- }
272
+ if (!CheckerOperateur (" ," ).has_value ()) {
273
+ break ;
251
274
}
252
275
}
253
276
}
@@ -294,37 +317,19 @@ namespace FPL {
294
317
295
318
if (fonction.has_value () && isArgument (fonction->FonctionName , PossibleVar->mText )) {
296
319
auto argument = mArguments [fonction->FonctionName ][PossibleVar->mText ];
297
- if (!morethanoneValue) {
298
- if (argument.ArgValue == wantCheckValue->StatementName ) {
299
- parse (tokens, f);
300
- mCurrentToken = oldCurrentToken;
301
- didNotExecuteTheCodeWithif = true ;
302
- needToIgnore = true ;
303
- }
304
- } else {
305
- if (ValueInSTRvector (contentValues, argument.ArgValue )) {
306
- parse (tokens, f);
307
- mCurrentToken = oldCurrentToken;
308
- didNotExecuteTheCodeWithif = true ;
309
- needToIgnore = true ;
310
- }
320
+ if (ValueInSTRvector (contentValues, argument.ArgValue )) {
321
+ parse (tokens, f);
322
+ mCurrentToken = oldCurrentToken;
323
+ didNotExecuteTheCodeWithif = true ;
324
+ needToIgnore = true ;
311
325
}
312
326
} else if (isVariable (PossibleVar->mText )) {
313
327
auto variable = mVariables [PossibleVar->mText ];
314
- if (!morethanoneValue) {
315
- if (variable.VariableValue == wantCheckValue->StatementName ) {
316
- parse (tokens, f);
317
- mCurrentToken = oldCurrentToken;
318
- didNotExecuteTheCodeWithif = true ;
319
- needToIgnore = true ;
320
- }
321
- } else {
322
- if (ValueInSTRvector (contentValues, variable.VariableValue )) {
323
- parse (tokens, f);
324
- mCurrentToken = oldCurrentToken;
325
- didNotExecuteTheCodeWithif = true ;
326
- needToIgnore = true ;
327
- }
328
+ if (ValueInSTRvector (contentValues, variable.VariableValue )) {
329
+ parse (tokens, f);
330
+ mCurrentToken = oldCurrentToken;
331
+ didNotExecuteTheCodeWithif = true ;
332
+ needToIgnore = true ;
328
333
}
329
334
}
330
335
0 commit comments