summaryrefslogtreecommitdiff
path: root/src/parser/input-impl.h
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-12-12 20:28:40 -0800
committerGitHub <noreply@github.com>2023-12-12 20:28:40 -0800
commit9e636855b582d1499a87fb73f55d85102ce95a58 (patch)
tree4b646f743e3fc645cd37d06d9f37f65d9e4840c1 /src/parser/input-impl.h
parent8e9199274e4dbd93b1ca65d9c053c4610599e69f (diff)
downloadbinaryen-9e636855b582d1499a87fb73f55d85102ce95a58.tar.gz
binaryen-9e636855b582d1499a87fb73f55d85102ce95a58.tar.bz2
binaryen-9e636855b582d1499a87fb73f55d85102ce95a58.zip
[Parser] Parse the remaining array operations (#6158)
Parse `array.new_elem`, `array.init_data`, and `array.init_elem`. Accidentally also includes: * [Parser] Parse string types and operations (#6161)
Diffstat (limited to 'src/parser/input-impl.h')
-rw-r--r--src/parser/input-impl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser/input-impl.h b/src/parser/input-impl.h
index 7ee358f12..0f8fc2e86 100644
--- a/src/parser/input-impl.h
+++ b/src/parser/input-impl.h
@@ -226,11 +226,11 @@ inline std::optional<float> ParseInput::takeF32() {
return std::nullopt;
}
-inline std::optional<std::string_view> ParseInput::takeString() {
+inline std::optional<std::string> ParseInput::takeString() {
if (auto t = peek()) {
if (auto s = t->getString()) {
++lexer;
- return s;
+ return std::string(*s);
}
}
return {};