Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue module parsing despite Jython parsing errors #206

Merged
merged 4 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import static com.ibm.wala.cast.python.util.Util.DYNAMIC_ANNOTATION_KEY;
import static com.ibm.wala.cast.python.util.Util.STATIC_METHOD_ANNOTATION_NAME;
import static com.ibm.wala.cast.python.util.Util.getNameStream;
import static java.util.logging.Logger.getLogger;

import com.ibm.wala.cast.ir.translator.AbstractClassEntity;
import com.ibm.wala.cast.ir.translator.AbstractCodeEntity;
Expand Down Expand Up @@ -60,6 +61,7 @@
import java.util.LinkedList;
import java.util.Map;
import java.util.function.Supplier;
import java.util.logging.Logger;
import org.python.antlr.PythonTree;
import org.python.antlr.ast.Assert;
import org.python.antlr.ast.Assign;
Expand Down Expand Up @@ -141,6 +143,8 @@

public abstract class PythonParser<T> extends AbstractParser<T> implements TranslatorToCAst {

private static final Logger LOGGER = getLogger(PythonParser.class.getName());

private static boolean COMPREHENSION_IR = true;

private CAstType codeBody =
Expand Down Expand Up @@ -2376,7 +2380,9 @@ public String getMsg() {
}
});
});
throw new TranslatorToCAst.Error(warnings);

// Log the parsing errors (best-effort).
warnings.forEach(w -> LOGGER.warning(() -> "Encountered parsing problem: " + w));
}

try {
Expand Down
Loading