[webkit-reviews] review granted: [Bug 237629] [WGSL] Implement enough of the Parser for the simplest shaders : [Attachment 454175] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 8 21:41:50 PST 2022


Myles C. Maxfield <mmaxfield at apple.com> has granted Robin Morisset
<rmorisset at apple.com>'s request for review:
Bug 237629: [WGSL] Implement enough of the Parser for the simplest shaders
https://bugs.webkit.org/show_bug.cgi?id=237629

Attachment 454175: Patch

https://bugs.webkit.org/attachment.cgi?id=454175&action=review




--- Comment #2 from Myles C. Maxfield <mmaxfield at apple.com> ---
Comment on attachment 454175
  --> https://bugs.webkit.org/attachment.cgi?id=454175
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454175&action=review

> Source/WebGPU/WGSL/CompilationMessage.h:57
> +using Warning = CompilationMessage;
> +using Error = CompilationMessage;

Cute.

> Source/WebGPU/WGSL/Parser.cpp:45
> +#define START_PARSE() \

Is this style of using #defines copied from anywhere?

> Source/WebGPU/WGSL/Parser.cpp:168
> +Expected<AST::ShaderModule, Error> parse(const String& wgsl)
> +{
> +    Lexer lexer(wgsl);
> +    Parser parser(lexer);
> +    
> +    return parser.parseShader();
> +}

Did you consider generating this code from a grammar file?

> Source/WebGPU/WGSL/Parser.cpp:511
> +    START_PARSE();

Is there a way to guarantee that parsing functions always start with a
START_PARSE() macro?


More information about the webkit-reviews mailing list