aboutsummaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
Diffstat (limited to 'asm')
-rw-r--r--asm/lexer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/asm/lexer.cpp b/asm/lexer.cpp
index 2bf7169..760f8db 100644
--- a/asm/lexer.cpp
+++ b/asm/lexer.cpp
@@ -296,3 +296,13 @@ pair<token_t, lerr_t> tokenise_literal_char(string_view &source, size_t &column)
}
return make_pair(t, lerr_t::OK);
}
+
+token_t tokenise_literal_string(string_view &source, size_t &column, size_t end)
+{
+ source.remove_prefix(1);
+ token_t token{token_type_t::LITERAL_STRING, string(source.substr(1, end - 1)),
+ column};
+ source.remove_prefix(end);
+ column += end + 1;
+ return token;
+}