Skip to content

Commit

Permalink
shader parser throws parse error if it doesn't end in shaderlab state
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkc0d3r committed Jun 17, 2024
1 parent a4a3236 commit dfecec9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Editor/ShaderAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit dfecec9

Please sign in to comment.