diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/ProgramParser.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/ProgramParser.java index 1145997729..43cec38698 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/ProgramParser.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/ProgramParser.java @@ -61,6 +61,9 @@ public Program parse(String raw, String path, String format, String cflags) thro case "ll" -> { return new ParserLlvm().parse(CharStreams.fromString(raw)); } + case "spv.dis" -> { + return new ParserSpirv().parse(CharStreams.fromString(raw)); + } case "litmus" -> { return getConcreteLitmusParser(raw.toUpperCase()).parse(CharStreams.fromString(raw)); } diff --git a/ui/src/main/java/com/dat3m/ui/editor/Editor.java b/ui/src/main/java/com/dat3m/ui/editor/Editor.java index 671342e838..8df2bcaef9 100644 --- a/ui/src/main/java/com/dat3m/ui/editor/Editor.java +++ b/ui/src/main/java/com/dat3m/ui/editor/Editor.java @@ -100,7 +100,7 @@ public void actionPerformed(ActionEvent event) { if (chooser.showOpenDialog(null) == APPROVE_OPTION) { String path = chooser.getSelectedFile().getPath(); loadedPath = path.substring(0, path.lastIndexOf('/') + 1); - String format = path.substring(path.lastIndexOf('.') + 1).trim(); + String format = path.endsWith("spv.dis") ? "spv.dis" : path.substring(path.indexOf('.') + 1).trim(); if (allowedFormats.contains(format)) { loadedFormat = format; notifyListeners(); diff --git a/ui/src/main/java/com/dat3m/ui/editor/EditorsPane.java b/ui/src/main/java/com/dat3m/ui/editor/EditorsPane.java index 1601801b04..46f71ee839 100644 --- a/ui/src/main/java/com/dat3m/ui/editor/EditorsPane.java +++ b/ui/src/main/java/com/dat3m/ui/editor/EditorsPane.java @@ -10,7 +10,7 @@ public class EditorsPane { private final ImmutableMap editors = ImmutableMap.of( - EditorCode.PROGRAM, new Editor(EditorCode.PROGRAM, new RSyntaxTextArea(), "litmus", "c", "ll"), + EditorCode.PROGRAM, new Editor(EditorCode.PROGRAM, new RSyntaxTextArea(), "litmus", "c", "ll", "spv.dis"), EditorCode.TARGET_MM, new Editor(EditorCode.TARGET_MM, new RSyntaxTextArea(), "cat") );