Skip to content

Commit

Permalink
Provide access to the parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Feb 1, 2025
1 parent ed63414 commit 3a943bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/taumc/glsl/ShaderParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class ShaderParser {
@Desugar
public record ParsedShader(GLSLPreParser.Translation_unitContext pre, GLSLParser.Translation_unitContext full) {}
public record ParsedShader(GLSLPreParser preParser, GLSLParser parser, GLSLPreParser.Translation_unitContext pre, GLSLParser.Translation_unitContext full) {}

private static void configureNoError(Parser parser) {
parser.setErrorHandler(new BailErrorStrategy());
Expand All @@ -36,7 +36,7 @@ private static ParsedShader tryParse(GLSLLexer lexer, GLSLPreParser preParser, G
lexer.reset();
parser.reset();
var full = parser.translation_unit();
return new ParsedShader(pre, full);
return new ParsedShader(preParser, parser, pre, full);
}

public static ParsedShader parseShader(String shader) {
Expand Down

0 comments on commit 3a943bb

Please sign in to comment.