• Home
  • Raw
  • Download

Lines Matching refs:argv

50     std::unique_ptr<Value> v(expr->fn(expr->name.c_str(), state, expr->argv));  in Evaluate()
64 return expr->fn(expr->name.c_str(), state, expr->argv); in EvaluateValue()
78 Value* ConcatFn(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) { in ConcatFn() argument
79 if (argv.empty()) { in ConcatFn()
83 for (size_t i = 0; i < argv.size(); ++i) { in ConcatFn()
85 if (!Evaluate(state, argv[i], &str)) { in ConcatFn()
94 Value* IfElseFn(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) { in IfElseFn() argument
95 if (argv.size() != 2 && argv.size() != 3) { in IfElseFn()
101 if (!Evaluate(state, argv[0], &cond)) { in IfElseFn()
106 return EvaluateValue(state, argv[1]); in IfElseFn()
107 } else if (argv.size() == 3) { in IfElseFn()
108 return EvaluateValue(state, argv[2]); in IfElseFn()
114 Value* AbortFn(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) { in AbortFn() argument
116 if (!argv.empty() && Evaluate(state, argv[0], &msg)) { in AbortFn()
124 Value* AssertFn(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) { in AssertFn() argument
125 for (size_t i = 0; i < argv.size(); ++i) { in AssertFn()
127 if (!Evaluate(state, argv[i], &result)) { in AssertFn()
131 int len = argv[i]->end - argv[i]->start; in AssertFn()
132 state->errmsg = "assert failed: " + state->script.substr(argv[i]->start, len); in AssertFn()
139 Value* SleepFn(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) { in SleepFn() argument
141 if (!Evaluate(state, argv[0], &val)) { in SleepFn()
154 Value* StdoutFn(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) { in StdoutFn() argument
155 for (size_t i = 0; i < argv.size(); ++i) { in StdoutFn()
157 if (!Evaluate(state, argv[i], &v)) { in StdoutFn()
166 const std::vector<std::unique_ptr<Expr>>& argv) { in LogicalAndFn() argument
168 if (!Evaluate(state, argv[0], &left)) { in LogicalAndFn()
172 return EvaluateValue(state, argv[1]); in LogicalAndFn()
179 const std::vector<std::unique_ptr<Expr>>& argv) { in LogicalOrFn() argument
181 if (!Evaluate(state, argv[0], &left)) { in LogicalOrFn()
185 return EvaluateValue(state, argv[1]); in LogicalOrFn()
192 const std::vector<std::unique_ptr<Expr>>& argv) { in LogicalNotFn() argument
194 if (!Evaluate(state, argv[0], &val)) { in LogicalNotFn()
202 const std::vector<std::unique_ptr<Expr>>& argv) { in SubstringFn() argument
204 if (!Evaluate(state, argv[0], &needle)) { in SubstringFn()
209 if (!Evaluate(state, argv[1], &haystack)) { in SubstringFn()
217 Value* EqualityFn(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) { in EqualityFn() argument
219 if (!Evaluate(state, argv[0], &left)) { in EqualityFn()
223 if (!Evaluate(state, argv[1], &right)) { in EqualityFn()
232 const std::vector<std::unique_ptr<Expr>>& argv) { in InequalityFn() argument
234 if (!Evaluate(state, argv[0], &left)) { in InequalityFn()
238 if (!Evaluate(state, argv[1], &right)) { in InequalityFn()
246 Value* SequenceFn(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) { in SequenceFn() argument
247 std::unique_ptr<Value> left(EvaluateValue(state, argv[0])); in SequenceFn()
251 return EvaluateValue(state, argv[1]); in SequenceFn()
255 const std::vector<std::unique_ptr<Expr>>& argv) { in LessThanIntFn() argument
256 if (argv.size() != 2) { in LessThanIntFn()
262 if (!ReadArgs(state, argv, &args)) { in LessThanIntFn()
283 const std::vector<std::unique_ptr<Expr>>& argv) { in GreaterThanIntFn() argument
284 if (argv.size() != 2) { in GreaterThanIntFn()
290 if (!ReadArgs(state, argv, &args)) { in GreaterThanIntFn()
310 Value* Literal(const char* name, State* state, const std::vector<std::unique_ptr<Expr>>& argv) { in Literal() argument
352 bool ReadArgs(State* state, const std::vector<std::unique_ptr<Expr>>& argv, in ReadArgs() argument
354 return ReadArgs(state, argv, args, 0, argv.size()); in ReadArgs()
357 bool ReadArgs(State* state, const std::vector<std::unique_ptr<Expr>>& argv, in ReadArgs() argument
362 if (start + len > argv.size()) { in ReadArgs()
367 if (!Evaluate(state, argv[i], &var)) { in ReadArgs()
378 bool ReadValueArgs(State* state, const std::vector<std::unique_ptr<Expr>>& argv, in ReadValueArgs() argument
380 return ReadValueArgs(state, argv, args, 0, argv.size()); in ReadValueArgs()
383 bool ReadValueArgs(State* state, const std::vector<std::unique_ptr<Expr>>& argv, in ReadValueArgs() argument
388 if (len == 0 || start + len > argv.size()) { in ReadValueArgs()
392 std::unique_ptr<Value> v(EvaluateValue(state, argv[i])); in ReadValueArgs()