Repository: playcanvas/engine
File: src/core/preprocessor.js (JavaScript)

Code before:
                    const countIdentifier = include[2]?.trim();

                    // are we inside if-blocks that are accepted
                    const keep = Preprocessor._keep(stack);

                    if (keep) {

                        // cut out the include line and replace it with the included string
                        let includeSource = includes?.get(identifier);
                        if (includeSource !== undefined) {

                            // handle second identifier specifying loop count
                            if (countIdentifier) {
                                const countString = defines.get(countIdentifier);
                                const count = parseFloat(countString);
                                if (Number.isInteger(count)) {

                                    // add the include count times
                                    let result = '';
                                    for (let i = 0; i < count; i++) {
                                        result += includeSource.replace(LOOP_INDEX, String(i));
                                    }
                                    includeSource = result;

                                } else {
                                    console.error(`include Count identifier "${countIdentifier}" not resolved while preprocessing ${Preprocessor.sourceName} on line: ${source.substring(match.index, match.index + 100)}...`, { source: originalSource });
                                    error = true;
                                }
                            }

                            // replace the include by the included string
                            source = source.substring(0, include.index - 1) + includeSource + source.substring(INCLUDE.lastIndex);

                            // process the just included test
                            KEYWORD.lastIndex = include.index - 1;
                        } else {
                            console.error(`Include "${identifier}" not resolved while preprocessing ${Preprocessor.sourceName}`, { source: originalSource });
                            error = true;
                        }
                    }

                    Debug.trace(TRACEID, `${keyword}: [${identifier}] ${keep ? '' : 'IGNORED'}`);
                    break;
                }
            }
        }

        if (error) {
            console.warn('Failed to preprocess shader: ', { source: originalSource });
            return originalSource;
        }

Review comment (suggestion):
```suggestion
                                    console.error(`Include Count identifier "${countIdentifier}" not resolved while preprocessing ${Preprocessor.sourceName} on line: ${source.substring(match.index, match.index + 100)}...`, { source: originalSource });
```

Code after:
                    const countIdentifier = include[2]?.trim();

                    // are we inside if-blocks that are accepted
                    const keep = Preprocessor._keep(stack);

                    if (keep) {

                        // cut out the include line and replace it with the included string
                        let includeSource = includes?.get(identifier);
                        if (includeSource !== undefined) {

                            // handle second identifier specifying loop count
                            if (countIdentifier) {
                                const countString = defines.get(countIdentifier);
                                const count = parseFloat(countString);
                                if (Number.isInteger(count)) {

                                    // add the include count times
                                    let result = '';
                                    for (let i = 0; i < count; i++) {
                                        result += includeSource.replace(LOOP_INDEX, String(i));
                                    }
                                    includeSource = result;

                                } else {
                                    console.error(`Include Count identifier "${countIdentifier}" not resolved while preprocessing ${Preprocessor.sourceName} on line: ${source.substring(match.index, match.index + 100)}...`, { source: originalSource });
                                    error = true;
                                }
                            }

                            // replace the include by the included string
                            source = source.substring(0, include.index - 1) + includeSource + source.substring(INCLUDE.lastIndex);

                            // process the just included test
                            KEYWORD.lastIndex = include.index - 1;
                        } else {
                            console.error(`Include "${identifier}" not resolved while preprocessing ${Preprocessor.sourceName}`, { source: originalSource });
                            error = true;
                        }
                    }

                    Debug.trace(TRACEID, `${keyword}: [${identifier}] ${keep ? '' : 'IGNORED'}`);
                    break;
                }
            }
        }

        if (error) {
            console.warn('Failed to preprocess shader: ', { source: originalSource });
            return originalSource;
        }