diff --git a/Editor/ShaderAnalyzer.cs b/Editor/ShaderAnalyzer.cs index 4213df5..6345fe7 100644 --- a/Editor/ShaderAnalyzer.cs +++ b/Editor/ShaderAnalyzer.cs @@ -1264,6 +1264,10 @@ private void SemanticParseShader() output.Insert(3, "{"); output.Insert(4, "}"); } + if (state != ParseState.ShaderLab) + { + throw new ParserException("Parse state is not ShaderLab at the end of the file."); + } foreach (var ifexPropName in parsedShader.ifexParameters) { if (parsedShader.propertyTable.TryGetValue(ifexPropName, out var prop))