Skip to content

Commit ef1131c

Browse files
authored
Merge pull request #2350 from fayer3/const-float-parsing
fix const float parsing
2 parents 00d26a3 + 5d0cc61 commit ef1131c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/net/irisshaders/iris/shaderpack/parsing/ParsedString.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,18 @@ public String takeNumber() {
104104
if (!Character.isDigit(text.charAt(position)) && !Character.isDigit(text.charAt(position + 1))) {
105105
break;
106106
}
107+
} else if (!Character.isDigit(text.charAt(position))) {
108+
break;
107109
}
108110

109111
position++;
110112
}
111113

114+
// take any f float suffixes, if we have a number
115+
if (position > 0 && position + 1 < text.length() && (text.charAt(position) == 'f' || text.charAt(position) == 'F')) {
116+
position++;
117+
}
118+
112119
try {
113120
Float.parseFloat(text.substring(0, position));
114121
} catch (Exception e) {

0 commit comments

Comments
 (0)