diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-19 22:40:22 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-19 22:40:22 +0100 |
commit | 05faf77202d0f8762160f135e714961d2c456cca (patch) | |
tree | a91de78d058753f34fc3940ceb52098b9c374221 /asm | |
parent | 5c0611b998e039c8547cfa3841da3567e13446a8 (diff) |
Assembler parser bugfixes (WIP)
Diffstat (limited to 'asm')
-rw-r--r-- | asm/parse.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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)) { |