Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/minify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ export class GlslMinify {

/** Token type of the immediately preceding token */
let prevType = TokenType.ttNone;
let prevPrevType = TokenType.ttNone;

let match: string[];
while ((match = tokenRegex.exec(content))) {
Expand Down Expand Up @@ -763,7 +764,7 @@ export class GlslMinify {

case TokenType.ttNumeric: {
// Special case for numerics: we can omit a zero following a dot (e.g. "1." is the same as "1.0") in GLSL
if (token === '0' && prevType === TokenType.ttDot) {
if (token === "0" && prevType === TokenType.ttDot && prevPrevType === TokenType.ttNumeric) {
break;
}

Expand Down Expand Up @@ -897,6 +898,7 @@ export class GlslMinify {
}

// Advance to the next token
prevPrevType = prevType;
prevType = type;
}

Expand Down