From 05faf77202d0f8762160f135e714961d2c456cca Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 19 Nov 2020 22:40:22 +0100 Subject: Assembler parser bugfixes (WIP) --- asm/parse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'asm/parse.cpp') diff --git a/asm/parse.cpp b/asm/parse.cpp index 3b6e6be..e62f585 100644 --- a/asm/parse.cpp +++ b/asm/parse.cpp @@ -35,7 +35,7 @@ namespace { // skip optional whitespace void parseWhitespace(const std::string& asm_code, size_t& pos) { - std::regex re_whitespace("( \\t)+", std::regex_constants::ECMAScript); + std::regex re_whitespace("[ \\t]+", std::regex_constants::ECMAScript); std::smatch match; if (std::regex_search(asm_code.cbegin() + pos, asm_code.cend(), match, re_whitespace, std::regex_constants::match_continuous)) { @@ -191,7 +191,7 @@ namespace { void parseComment(const std::string& asm_code, size_t& pos) { parseWhitespace(asm_code, pos); - std::regex re_comment("(#|//).*", std::regex_constants::ECMAScript); + std::regex re_comment("(;|//).*", std::regex_constants::ECMAScript); std::smatch match; if (std::regex_search(asm_code.cbegin() + pos, asm_code.cend(), match, re_comment, std::regex_constants::match_continuous)) { -- cgit v1.2.3