no message

This commit is contained in:
2024-10-07 17:46:38 +03:00
parent 6537eebe09
commit e7f661f7ad
87 changed files with 279 additions and 222 deletions

View File

@@ -37,7 +37,6 @@ import java.util.*;
import java.util.concurrent.Semaphore;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Utils {
public static boolean isLinuxSystemCommand(String text) {
@@ -211,16 +210,6 @@ public class Utils {
public static String getRelativeAddress(File file, File anchestor) {
return file.getAbsolutePath().substring(anchestor.getAbsolutePath().length() + 1);
}
public static String pack(String s_in) {
return String.join(" ",
Arrays.stream(s_in.split(" ")).filter(d -> !d.isEmpty()).collect(Collectors.toCollection(Vector::new)));
}
public static String remove(String string, String... to_remove) {
String res = string;
for (String c : to_remove)
res = res.replace(c, "");
return res;
}
//для переименования/добавления новых файлов.
public static boolean validateFileShortNewName(String name, TextLog Log) {
boolean res = true;
@@ -556,7 +545,7 @@ public class Utils {
try {
for (String line : FileUtils.readLines(test, Charset.defaultCharset())) {
// #pragma dvm array distribute[block][block], не важно
String packedLine = remove(pack(line).toLowerCase(), "\n", "\r", "\t");
String packedLine = CommonUtils.removeCharacters(CommonUtils.removeRedundantSpaces(line).toLowerCase(), "\n", "\r", "\t");
if (packedLine.startsWith(prefix)) {
packedLine = packedLine.substring(prefix.length());
boolean bracketOpen = false;
@@ -942,8 +931,8 @@ public class Utils {
line2 = line2.toUpperCase();
}
if (!Global.db.settings.get(SettingName.SpacesOn).toBoolean()) {
line1 = remove(line1, " ", "\t");
line2 = remove(line2, " ", "\t");
line1 = CommonUtils.removeCharacters(line1, " ", "\t");
line2 = CommonUtils.removeCharacters(line2, " ", "\t");
}
return line1.equals(line2);
}

View File

@@ -1,5 +1,5 @@
package Common_old.Utils.Validators;
import Common_old.Utils.Utils;
import Common.Utils.CommonUtils;
import GlobalData.Compiler.Compiler;
import GlobalData.CompilerEnvironment.CompilerEnvironment;
import GlobalData.CompilerOption.CompilerOption;
@@ -75,7 +75,7 @@ public class DVMHelpParser {
state = HelpParserState.Search;
for (String line_ : lines) {
line = line_; //нужна для окружения. там пробелы нужно считать сразу.
t_line = Utils.remove(line_.trim(), "\r");
t_line = CommonUtils.removeCharacters(line_.trim(), "\r");
switch (state) {
case Search:
switch (t_line) {