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

Fix log, capitalize constant, simplify lambda, and add a launch config #181

Merged
merged 9 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
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
26 changes: 26 additions & 0 deletions ML verify debug.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
<intAttribute key="M2_COLORS" value="0"/>
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
<stringAttribute key="M2_GOALS" value="-Dmaven.surefire.debug -Dparallel=none verify"/>
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
<booleanAttribute key="M2_OFFLINE" value="false"/>
<stringAttribute key="M2_PROFILES" value=""/>
<listAttribute key="M2_PROPERTIES">
<listEntry value="forkCount=0"/>
</listAttribute>
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
<intAttribute key="M2_THREADS" value="1"/>
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<stringAttribute key="M2_USER_SETTINGS" value=""/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:ml}"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,16 @@ public CAstNode visitImportFrom(ImportFrom importFrom) throws Exception {
Optional<String> s =
importFrom.getInternalModuleNames().stream()
.map(Name::getInternalId)
.reduce(
(a, b) -> {
return a + "/" + b;
});
.reduce((a, b) -> a + "/" + b);

if (s.isPresent()) {
String moduleName = s.get();
LOGGER.finer("Module name from " + importFrom + " is: " + moduleName + ".");

if (!isLocalModule(moduleName)) {
LOGGER.finer("Module: " + moduleName + ".py" + " isn't local.");
LOGGER.finer("Module: " + moduleName + " isn't local.");
moduleName = s.get() + "/__init__";
} else LOGGER.finer("Module: " + moduleName + ".py" + " is local.");
} else LOGGER.finer("Module: " + moduleName + " is local.");

LOGGER.finer("Module name from " + importFrom + " is: " + moduleName + ".");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

public class PythonCAstToIRTranslator extends AstTranslator {

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

private final Map<CAstType, TypeName> walaTypeNames = HashMapFactory.make();
private final Set<Pair<Scope, String>> globalDeclSet = new HashSet<>();
Expand Down Expand Up @@ -696,7 +696,7 @@ protected void doCall(
((CAstControlFlowRecorder) context.getControlFlow()).map(call, call);

if (context.getControlFlow().getTargetLabels(call).isEmpty()) {
logger.fine(() -> "no exceptions for " + CAstPrinter.print(call));
LOGGER.fine(() -> "no exceptions for " + CAstPrinter.print(call));
context.cfg().addPreEdgeToExit(call, true);
} else {
context
Expand Down
Loading