129 def parse_to_be_like(self, line_one_indexed: int) -> ToBeLiteral:
130 line_content = self._content_slice.unixLine(line_one_indexed)
131 dot_fun_open_paren = None
132
133 for to_be_like in TO_BE_LIKES:
134 idx = line_content.indexOf(to_be_like)
135 if idx != -1:
136 dot_fun_open_paren = to_be_like
137 break
138 if dot_fun_open_paren is None:
139 raise AssertionError(
140 f"Expected to find inline assertion on line {line_one_indexed}, but there was only `{line_content}`"
141 )
142
143 dot_function_call_in_place = line_content.indexOf(dot_fun_open_paren)
144 dot_function_call = dot_function_call_in_place + line_content.startIndex
145 arg_start = dot_function_call + len(dot_fun_open_paren)
146
147 if self._content_slice.__len__() == arg_start:
148 raise AssertionError(
149 f"Appears to be an unclosed function call `{dot_fun_open_paren}` "
150 f"on line {line_one_indexed}"
151 )
152 while self._content_slice[arg_start].isspace():
153 arg_start += 1
154 if self._content_slice.__len__() == arg_start:
155 raise AssertionError(
156 f"Appears to be an unclosed function call `{dot_fun_open_paren}` "
157 f"on line {line_one_indexed}"
158 )
159
160 if self._content_slice[arg_start] == '"':
161 (end_paren, end_arg) = self._parse_string(
162 line_one_indexed, arg_start, dot_fun_open_paren
163 )
164 else:
165 (end_paren, end_arg) = self._parse_code(
166 line_one_indexed, arg_start, dot_fun_open_paren
167 )
168 return self.ToBeLiteral(
169 self,
170 dot_fun_open_paren.replace("_TODO", ""),
171 self._content_slice.subSequence(dot_function_call, end_paren + 1),
172 self._content_slice.subSequence(arg_start, end_arg),
173 self.__language,
174 self.__escape_leading_whitespace,
175 )
176