summaryrefslogtreecommitdiff
path: root/src/wasm/wat-lexer.cpp
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-05-27 13:56:04 -0700
committerGitHub <noreply@github.com>2022-05-27 13:56:04 -0700
commit6b12e320b4546ed18382fa1b191246daa1c3249d (patch)
tree2acc65bc5c1c0fce09b45353dbc87856bc140faf /src/wasm/wat-lexer.cpp
parent404bd2cc11cbc85c79b33a75142dbcf16d530a1b (diff)
downloadbinaryen-6b12e320b4546ed18382fa1b191246daa1c3249d.tar.gz
binaryen-6b12e320b4546ed18382fa1b191246daa1c3249d.tar.bz2
binaryen-6b12e320b4546ed18382fa1b191246daa1c3249d.zip
[Parser][NFC] Remove extraneous braces from std::optional returns (#4696)
Diffstat (limited to 'src/wasm/wat-lexer.cpp')
-rw-r--r--src/wasm/wat-lexer.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/wasm/wat-lexer.cpp b/src/wasm/wat-lexer.cpp
index 450d94a19..401ea6b7a 100644
--- a/src/wasm/wat-lexer.cpp
+++ b/src/wasm/wat-lexer.cpp
@@ -102,22 +102,22 @@ enum OverflowBehavior { DisallowOverflow, IgnoreOverflow };
std::optional<int> getDigit(char c) {
if ('0' <= c && c <= '9') {
- return {c - '0'};
+ return c - '0';
}
- return std::nullopt;
+ return {};
}
std::optional<int> getHexDigit(char c) {
if ('0' <= c && c <= '9') {
- return {c - '0'};
+ return c - '0';
}
if ('A' <= c && c <= 'F') {
- return {10 + c - 'A'};
+ return 10 + c - 'A';
}
if ('a' <= c && c <= 'f') {
- return {10 + c - 'a'};
+ return 10 + c - 'a';
}
- return std::nullopt;
+ return {};
}
// The result of lexing an integer token fragment.
@@ -170,7 +170,7 @@ public:
}
}
}
- return {LexIntResult{*basic, negative ? -n : n, signedness}};
+ return LexIntResult{*basic, negative ? -n : n, signedness};
}
void takeSign() {
@@ -285,9 +285,9 @@ public:
std::optional<LexStrResult> lexed() {
if (auto basic = LexCtx::lexed()) {
if (escapeBuilder) {
- return {LexStrResult{*basic, {escapeBuilder->str()}}};
+ return LexStrResult{*basic, {escapeBuilder->str()}};
} else {
- return {LexStrResult{*basic, {}}};
+ return LexStrResult{*basic, {}};
}
}
return {};