Skip to content

Commit

Permalink
Fixed not importing last word.
Browse files Browse the repository at this point in the history
  • Loading branch information
litoj committed Sep 5, 2021
1 parent f9eaf4b commit 541a980
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Binary file modified Android app/app/libs/SMLib.jar
Binary file not shown.
Binary file modified Android app/app/libs/SMLib.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion Library/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/home/kepis/Documents/SchoolManager/Library/src/IOSystem/FilePath.java</file>
<file>file:/home/kepis/Documents/SchoolManager/Library/src/IOSystem/SimpleReader.java</file>
<file>file:/home/kepis/Documents/SchoolManager/Library/src/IOSystem/Formatter.java</file>
</group>
</open-files>
Expand Down
26 changes: 13 additions & 13 deletions Library/src/IOSystem/SimpleReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,12 @@ private static class SimpleChapter {
sorter:
for (int i = lines.i; i < lines.length - 1; i++) {
if (lines.str[i].length() <= 2) {//2 for occasional char codepoint-13
if (lines.str[i].length() == 0) continue;
switch (lines.str[i].charAt(0)) {
case '}':
lines.i = i;
break sorter;
case '{':
schs.add(new SimpleChapter(lines.str[(lines.i = i + 1) - 2], lines));
i = lines.i;
if (!lines.str[i].isEmpty() && lines.str[i].charAt(0) == '}') {
lines.i = i;
break sorter;
}
} else if (lines.str[i + 1].length() > 2) {//every word line has at least 3
String[] names = new String[2]; //chars - word, ';', translate
} else {//every word line has at least 3 chars - word, ';', translate
String[] names = new String[2];
String line = lines.str[i];
boolean first = true;
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -220,12 +215,17 @@ private static class SimpleChapter {
sb.append(line.charAt(j));
}
}
if (names[0] == null || sb.length() == 0) {
if (names[0] == null && sb.length() == 0) {
Formatter.defaultReacts.get(SimpleReader.class + ":fail").react(line);
throw new IllegalArgumentException();
} else if (sb.length() > 0 && lines.str[i + 1].startsWith("{")) {
lines.i = i + 2;
schs.add(new SimpleChapter(sb.toString(), lines));
i = lines.i;
} else {
names[1] = sb.toString();
sLines.add(new SimpleLine(names));
}
names[1] = sb.toString();
sLines.add(new SimpleLine(names));
}
}
this.lines = sLines.toArray(new SimpleLine[sLines.size()]);
Expand Down
Binary file modified SchoolManager.apk
Binary file not shown.

0 comments on commit 541a980

Please sign in to comment.