mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-03-04 06:34:40 +01:00
Indexing is hard
- Add workarounds for odd out-of-bounds exceptions - Bump version to 1.0.1-beta
This commit is contained in:
parent
1c0e562b6a
commit
ef32aab272
3 changed files with 22 additions and 18 deletions
|
@ -8,6 +8,8 @@ import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import dev.engine_room.flywheel.backend.glsl.SourceFile;
|
import dev.engine_room.flywheel.backend.glsl.SourceFile;
|
||||||
import dev.engine_room.flywheel.backend.glsl.SourceLines;
|
import dev.engine_room.flywheel.backend.glsl.SourceLines;
|
||||||
import dev.engine_room.flywheel.backend.glsl.error.ConsoleColors;
|
import dev.engine_room.flywheel.backend.glsl.error.ConsoleColors;
|
||||||
|
@ -56,18 +58,22 @@ public class FailedCompilation {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Matcher matcher;
|
try {
|
||||||
|
Matcher matcher;
|
||||||
|
|
||||||
matcher = PATTERN_ONE.matcher(s);
|
matcher = PATTERN_ONE.matcher(s);
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
out.accept(interpretPattern1(matcher));
|
out.accept(interpretPattern1(matcher));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
matcher = PATTERN_TWO.matcher(s);
|
matcher = PATTERN_TWO.matcher(s);
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
out.accept(interpretPattern2(matcher));
|
out.accept(interpretPattern2(matcher));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
// noop, if parsing/span matching fails somehow lets just emit the raw error string.
|
||||||
}
|
}
|
||||||
|
|
||||||
out.accept(ErrorBuilder.create()
|
out.accept(ErrorBuilder.create()
|
||||||
|
@ -114,15 +120,10 @@ public class FailedCompilation {
|
||||||
.pointAt(span, 1);
|
.pointAt(span, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ErrorBuilder interpretWithSpan(ErrorLevel errorLevel, int fileId, int lineNo, String span, String msg) {
|
private ErrorBuilder interpretWithSpan(ErrorLevel errorLevel, int fileId, int lineNo, @Nullable String span, String msg) {
|
||||||
var sourceFile = files.get(fileId - 1);
|
var sourceFile = files.get(fileId - 1);
|
||||||
|
|
||||||
Span errorSpan;
|
Span errorSpan = sourceFile.getLineSpanMatching(lineNo, span);
|
||||||
if (span != null) {
|
|
||||||
errorSpan = sourceFile.getLineSpanMatching(lineNo, span);
|
|
||||||
} else {
|
|
||||||
errorSpan = sourceFile.getLineSpanNoWhitespace(lineNo);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ErrorBuilder.create()
|
return ErrorBuilder.create()
|
||||||
.header(errorLevel, msg)
|
.header(errorLevel, msg)
|
||||||
|
|
|
@ -374,9 +374,12 @@ public class IndirectInstancer<I extends Instance> extends AbstractInstancer<I>
|
||||||
contentsChanged.clear();
|
contentsChanged.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void parallelUpdate() {
|
public void parallelUpdate() {
|
||||||
var pages = this.pages.get();
|
var pages = this.pages.get();
|
||||||
|
|
||||||
|
mergeablePages.clear(pages.length, mergeablePages.currentCapacity() + 1);
|
||||||
|
|
||||||
int page = 0;
|
int page = 0;
|
||||||
while (mergeablePages.cardinality() > 1) {
|
while (mergeablePages.cardinality() > 1) {
|
||||||
page = mergeablePages.nextSetBit(page);
|
page = mergeablePages.nextSetBit(page);
|
||||||
|
|
|
@ -8,7 +8,7 @@ mod_homepage = https://github.com/Engine-Room/Flywheel
|
||||||
# Flywheel metadata
|
# Flywheel metadata
|
||||||
flywheel_id=flywheel
|
flywheel_id=flywheel
|
||||||
flywheel_name=Flywheel
|
flywheel_name=Flywheel
|
||||||
flywheel_version=1.0.0
|
flywheel_version=1.0.1-beta
|
||||||
flywheel_description=An overhauled entity and block entity rendering API.
|
flywheel_description=An overhauled entity and block entity rendering API.
|
||||||
# Vanillin metadata
|
# Vanillin metadata
|
||||||
vanillin_id=vanillin
|
vanillin_id=vanillin
|
||||||
|
|
Loading…
Add table
Reference in a new issue