[webkit-changes] [WebKit/WebKit] 46e1b8: [WGSL] Expand accepted syntax in for loops

Tadeu Zagallo noreply at github.com
Fri May 26 04:45:24 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 46e1b8e9331986ad0ab166060c88fddbfec1ce1c
      https://github.com/WebKit/WebKit/commit/46e1b8e9331986ad0ab166060c88fddbfec1ce1c
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-05-26 (Fri, 26 May 2023)

  Changed paths:
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/Parser.cpp
    M Source/WebGPU/WGSL/ParserPrivate.h
    M Source/WebGPU/WGSL/TypeCheck.cpp
    M Source/WebGPU/WGSL/tests/invalid/for.wgsl
    M Source/WebGPU/WGSL/tests/valid/for.wgsl

  Log Message:
  -----------
  [WGSL] Expand accepted syntax in for loops
https://bugs.webkit.org/show_bug.cgi?id=257320
rdar://109827463

Reviewed by Mike Wyrzykowski.

Accept a "variable-updating-statement" in for-init and for-update, as per the
reference grammar. After this patch, the last missing piece of syntax for
for-loops is accepting calls in for-init and for-update, but that requires
refactoring how we parse function calls first.

* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseStatement):
(WGSL::Parser<Lexer>::parseForStatement):
(WGSL::Parser<Lexer>::parseVariableUpdatingStatement):
* Source/WebGPU/WGSL/ParserPrivate.h:
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/invalid/for.wgsl:
* Source/WebGPU/WGSL/tests/valid/for.wgsl:

Canonical link: https://commits.webkit.org/264577@main




More information about the webkit-changes mailing list