function getExpressions(str) {
    const lines = str.split('\n');
    let nextLineToParse = 0;
    const result = [];

    for (let lineID = 0; lineID < lines.length; lineID++) {
        const linesToTest = lines.slice(nextLineToParse, lineID + 1).join('\n');
        if (canBeParsed(linesToTest)) {
            if (!isEmptyString(linesToTest)) {
                result.push({ from: nextLineToParse, to: lineID, source: linesToTest });
            }
            // Start the next parsing attempt from the line after the successfully parsed expression.
            nextLineToParse = lineID + 1;
        }
    }
    // Handle any remaining lines that couldn't be parsed as expressions.
    const linesToTest = lines.slice(nextLineToParse).join('\n');
    if (!isEmptyString(linesToTest)) {
        result.push({ from: nextLineToParse, to: lines.length - 1, source: linesToTest });
    }
    return result;
}
Extracts parsable expressions from a multiline string.

@param {string} str - The multiline string containing expressions.
@returns {Array<{from: number, to: number, source: string}>} An array of objects,
  where each object represents a parsable expression and contains:
  - from: The starting line number of the expression within the original string.
  - to: The ending line number of the expression within the original string.
  - source: The actual string content of the expression.