Skip to content

Commit 728fb21

Browse files
authored
better argument names for StringContains (#2806)
1 parent 88e2f5a commit 728fb21

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/libasr/ASR.asdl

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ expr
136136
| StringItem(expr arg, expr idx, ttype type, expr? value)
137137
| StringSection(expr arg, expr? start, expr? end, expr? step, ttype type, expr? value)
138138
| StringCompare(expr left, cmpop op, expr right, ttype type, expr? value)
139-
| StringContains(expr left, expr right, ttype type, expr? value)
139+
| StringContains(expr substr, expr str, ttype type, expr? value)
140140
| StringOrd(expr arg, ttype type, expr? value)
141141
| StringChr(expr arg, ttype type, expr? value)
142142
| StringFormat(expr fmt, expr* args, string_format_kind kind, ttype type, expr? value)

src/libasr/codegen/asr_to_c_cpp.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1246,9 +1246,9 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) {
12461246

12471247
void visit_StringContains(const ASR::StringContains_t &x) {
12481248
CHECK_FAST_C_CPP(compiler_options, x)
1249-
self().visit_expr(*x.m_left);
1249+
self().visit_expr(*x.m_substr);
12501250
std::string substr = src;
1251-
self().visit_expr(*x.m_right);
1251+
self().visit_expr(*x.m_str);
12521252
std::string str = src;
12531253
src = "_lfortran_str_contains(" + str + ", " + substr + ")";
12541254
}

src/libasr/codegen/asr_to_llvm.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -6455,10 +6455,10 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
64556455
return;
64566456
}
64576457

6458-
this->visit_expr_wrapper(x.m_left, true);
6458+
this->visit_expr_wrapper(x.m_substr, true);
64596459
llvm::Value *substr = tmp;
64606460

6461-
this->visit_expr_wrapper(x.m_right, true);
6461+
this->visit_expr_wrapper(x.m_str, true);
64626462
llvm::Value *right = tmp;
64636463

64646464
tmp = lfortran_str_contains(right, substr);

0 commit comments

Comments
 (0)