1.15 support COBOL ext '', 'cbl', 'cob', 'cobol' | COBOL 拓展名支持 无拓展名、cbl、cob、cobol

This commit is contained in:
林万程
2022-04-28 00:47:45 +08:00
parent ac92738979
commit e26ff72da8
4 changed files with 11 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ public class LineExt {
return null;
}
Map<String, Map<String, List<String>>> treeMap = ConfCache.treeMap(path);
if ("cbl".equals(ext)) {
if (ext == null || "cbl".equals(ext) || "cob".equals(ext) || "cobol".equals(ext)) {
text = cblNotAndOr(text);
}
String[] words = pattern.split(text);
@@ -53,7 +53,7 @@ public class LineExt {
}
String key = matcher.group(1);
// put NOT first
text = matcher.replaceAll("$2 ( $1 = '");
text = matcher.replaceAll(" $2 ( $1 = '");
// add key after AND/OR
return AND_OR_PATTERN.matcher(text).replaceAll("$1 " + key + " = '");
}

View File

@@ -48,7 +48,10 @@ class ConfCacheGetUtils {
map.put(levelStr + "\b" + confPath, entry.getValue());
} else if (confName.endsWith((name + confMidExt))) {
map.put(levelStr + "\t" + confPath, entry.getValue());
} else if (ext != null) {
} else{
if (ext == null) {
ext = "";
}
if ((ext + confMidExt).equals(confName)) {
map.put(levelStr + "\n" + confPath, entry.getValue());
} else if (confName.endsWith((ext + confMidExt))) {