From 21b52b60b68758fe745683bb8797b67cd30875c9 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Wed, 27 Jan 2021 18:32:16 +0000 Subject: [PATCH] Revert "Remove support for # comments." This reverts commit 6e570a936063c751aebdae46106487385cc05661. Reason for revert: Missed Dawn tests Original change's description: > Remove support for # comments. > > This CL removes support for parsing # style comments. Only the // > comments are accepted now. > > Change-Id: I062c2a86149ecf828723c74f7168243678ee5870 > Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38823 > Commit-Queue: dan sinclair > Commit-Queue: Ben Clayton > Auto-Submit: dan sinclair > Reviewed-by: Ben Clayton TBR=dneto@google.com,dsinclair@chromium.org,bclayton@google.com Change-Id: Iaf19ab9def92ad10c27d70480d259e25f3da719d No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/39061 Reviewed-by: dan sinclair Commit-Queue: dan sinclair --- src/reader/wgsl/lexer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/reader/wgsl/lexer.cc b/src/reader/wgsl/lexer.cc index 9a2200bbb7..52a851c306 100644 --- a/src/reader/wgsl/lexer.cc +++ b/src/reader/wgsl/lexer.cc @@ -143,7 +143,8 @@ void Lexer::skip_whitespace() { } void Lexer::skip_comments() { - if (!matches(pos_, "//")) { + // TODO(bclayton): Remove support for # comments + if (!matches(pos_, "#") && !matches(pos_, "//")) { return; }