Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0b0ff310ee75769d5f5462a560aac7f7c44287da
      
https://github.com/WebKit/WebKit/commit/0b0ff310ee75769d5f5462a560aac7f7c44287da
  Author: Darin Adler <[email protected]>
  Date:   2025-09-27 (Sat, 27 Sep 2025)

  Changed paths:
    M Source/WebGPU/WGSL/Lexer.cpp
    M Source/WebGPU/WGSL/Lexer.h
    M Source/WebGPU/WGSL/Parser.cpp
    M Source/WebGPU/WGSL/ParserPrivate.h
    M Tools/TestWebKitAPI/Tests/WGSL/ConstLiteralTests.cpp
    M Tools/TestWebKitAPI/Tests/WGSL/LexerTests.cpp

  Log Message:
  -----------
  Simplify character handling and speed up compile of WGSL parser
https://bugs.webkit.org/show_bug.cgi?id=299674
rdar://161488196

Reviewed by Sam Weinig.

* Source/WebGPU/WGSL/Lexer.cpp:
(WGSL::Lexer<CharacterType>::makeToken): Moved this out of the header.
(WGSL::Lexer<CharacterType>::makeFloatToken): Ditto.
(WGSL::Lexer<CharacterType>::makeIntegerToken): Ditto.
(WGSL::Lexer<CharacterType>::makeIdentifierToken): Ditto.

* Source/WebGPU/WGSL/Lexer.h: Reduced includes.
Added a forward declaration for TokenType.
(WGSL::Lexer::Lexer): Take a span instead of a String.
(WGSL::Lexer::makeToken): Deleted.
(WGSL::Lexer::makeFloatToken): Deleted.
(WGSL::Lexer::makeIntegerToken): Deleted.
(WGSL::Lexer::makeIdentifierToken): Deleted.

* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::parse): Changed the template argument to be a character type
rather than a Lexer classs type. Pass a span into the Lexer constructor.

* Source/WebGPU/WGSL/ParserPrivate.h: Moved the include of "Token.h"
here from Lexer.h.

* Tools/TestWebKitAPI/Tests/WGSL/ConstLiteralTests.cpp:
(parseLCharPrimaryExpression): Pass a span instead of a String.

* Tools/TestWebKitAPI/Tests/WGSL/LexerTests.cpp:
(TestWGSLAPI::TestLexer::TestLexer): Added an include of "Token.h".

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to