summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/convert/MatchesReader.java
diff options
context:
space:
mode:
authorGravatar jeff2015-03-10 00:55:03 -0400
committerGravatar jeff2015-03-10 00:55:03 -0400
commit430df87ba5d855ca29bc53a5765a2862d2209098 (patch)
treeee427f009da8b29e7a66a4b4ce882120f9bb2cbf /src/cuchaz/enigma/convert/MatchesReader.java
parentfield matcher is starting to be useful (diff)
downloadenigma-fork-430df87ba5d855ca29bc53a5765a2862d2209098.tar.gz
enigma-fork-430df87ba5d855ca29bc53a5765a2862d2209098.tar.xz
enigma-fork-430df87ba5d855ca29bc53a5765a2862d2209098.zip
tweaks and improvements to field matching gui
Diffstat (limited to 'src/cuchaz/enigma/convert/MatchesReader.java')
-rw-r--r--src/cuchaz/enigma/convert/MatchesReader.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/cuchaz/enigma/convert/MatchesReader.java b/src/cuchaz/enigma/convert/MatchesReader.java
index 1dd042d..921ab1d 100644
--- a/src/cuchaz/enigma/convert/MatchesReader.java
+++ b/src/cuchaz/enigma/convert/MatchesReader.java
@@ -58,15 +58,19 @@ public class MatchesReader {
58 } 58 }
59 59
60 private static void readFieldMatch(FieldMatches matches, String line) { 60 private static void readFieldMatch(FieldMatches matches, String line) {
61 String[] parts = line.split(":", 2); 61 if (line.startsWith("!")) {
62 FieldEntry source = readField(parts[0]); 62 matches.addUnmatchableSourceField(readField(line.substring(1)));
63 FieldEntry dest = readField(parts[1]); 63 } else {
64 if (source != null && dest != null) { 64 String[] parts = line.split(":", 2);
65 matches.addMatch(source, dest); 65 FieldEntry source = readField(parts[0]);
66 } else if (source != null) { 66 FieldEntry dest = readField(parts[1]);
67 matches.addUnmatchedSourceField(source); 67 if (source != null && dest != null) {
68 } else if (dest != null) { 68 matches.addMatch(source, dest);
69 matches.addUnmatchedDestField(dest); 69 } else if (source != null) {
70 matches.addUnmatchedSourceField(source);
71 } else if (dest != null) {
72 matches.addUnmatchedDestField(dest);
73 }
70 } 74 }
71 } 75 }
72 76