mirror of
https://github.com/hazemKrimi/jack-vm-translator.git
synced 2026-05-01 18:00:27 +00:00
Implement branching
This commit is contained in:
@@ -5,6 +5,23 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
inline void ltrim(string &str) {
|
||||
str.erase(str.begin(), find_if(str.begin(), str.end(), [](unsigned char ch) {
|
||||
return !isspace(ch);
|
||||
}));
|
||||
}
|
||||
|
||||
inline void rtrim(string &str) {
|
||||
str.erase(find_if(str.rbegin(), str.rend(), [](unsigned char ch) {
|
||||
return !isspace(ch);
|
||||
}).base(), str.end());
|
||||
}
|
||||
|
||||
inline void trim(string &str) {
|
||||
rtrim(str);
|
||||
ltrim(str);
|
||||
}
|
||||
|
||||
string generateRandomLabel() {
|
||||
random_device rd;
|
||||
mt19937 gen(rd());
|
||||
|
||||
Reference in New Issue
Block a user