summaryrefslogtreecommitdiff
path: root/src/parser/input-impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/input-impl.h')
-rw-r--r--src/parser/input-impl.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/parser/input-impl.h b/src/parser/input-impl.h
index 35a39b2f3..7ee358f12 100644
--- a/src/parser/input-impl.h
+++ b/src/parser/input-impl.h
@@ -257,6 +257,16 @@ inline bool ParseInput::takeSExprStart(std::string_view expected) {
return false;
}
+inline bool ParseInput::peekSExprStart(std::string_view expected) {
+ auto original = lexer;
+ if (!takeLParen()) {
+ return false;
+ }
+ bool ret = takeKeyword(expected);
+ lexer = original;
+ return ret;
+}
+
inline Index ParseInput::getPos() {
if (auto t = peek()) {
return lexer.getIndex() - t->span.size();