[webkit-changes] [WebKit/WebKit] 5152a8: [WGSL] Fix line number reporting in errors.

Dan Glastonbury noreply at github.com
Mon Feb 13 18:12:46 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5152a874639a50b8ecdfa25e886eb9f1b71a34d3
      https://github.com/WebKit/WebKit/commit/5152a874639a50b8ecdfa25e886eb9f1b71a34d3
  Author: Dan Glastonbury <djg at apple.com>
  Date:   2023-02-13 (Mon, 13 Feb 2023)

  Changed paths:
    M Source/WebGPU/WGSL/Lexer.h

  Log Message:
  -----------
  [WGSL] Fix line number reporting in errors.
https://bugs.webkit.org/show_bug.cgi?id=252213
rdar://problem/105423092

Reviewed by Myles C. Maxfield.

Text editors use one-based line numbering, not zero.  When setting source code
to be tokenized, set the current position to offset of 0 on line 1. This allows
a position with m_line set to 0 to represent and empty or invalid position.

* Source/WebGPU/WGSL/Lexer.h:
(WGSL::Lexer::Lexer): Start at line 1

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




More information about the webkit-changes mailing list