[webkit-changes] [WebKit/WebKit] b4db70: [WGSL] Implement unary minus expression.

Dan Glastonbury noreply at github.com
Mon Sep 5 22:07:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b4db7009562fdcdcaa4a79d4b36e48fa05b01023
      https://github.com/WebKit/WebKit/commit/b4db7009562fdcdcaa4a79d4b36e48fa05b01023
  Author: Dan Glastonbury <djg at apple.com>
  Date:   2022-09-05 (Mon, 05 Sep 2022)

  Changed paths:
    M Source/WebGPU/WGSL/AST/Expression.h
    A Source/WebGPU/WGSL/AST/Expressions/UnaryExpression.h
    M Source/WebGPU/WGSL/Parser.cpp
    M Source/WebGPU/WGSLUnitTests/WGSLParserTests.mm
    M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj

  Log Message:
  -----------
  [WGSL] Implement unary minus expression.
https://bugs.webkit.org/show_bug.cgi?id=244788
rdar://99557228

Reviewed by Myles Maxfield.

* Source/WebGPU/WGSL/AST/Expression.h:
(WGSL::AST::Expression::isUnaryExpression const):
Add UnaryExpression kind and predicate.
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseUnaryExpression):
If a prefix minus token is found, create a UnaryExpression representing the
negation of the expression.
* Source/WebGPU/WGSLUnitTests/WGSLParserTests.mm:
(-[WGSLParserTests testParsingUnaryExpression]):
Test parsing of an expression containing a unary minus.
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:
Add 'UnaryExpression.h'

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




More information about the webkit-changes mailing list