-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cgen] make 'not' work properly; add source line numbers to the comme…
…nts in assembly
- Loading branch information
Showing
7 changed files
with
269 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Created by Evgeny Tanhilevich on 22/04/2016. | ||
// | ||
|
||
#ifndef COOL_COMPILER_STRING_UTIL_H | ||
#define COOL_COMPILER_STRING_UTIL_H | ||
#include <algorithm> | ||
#include <functional> | ||
#include <cctype> | ||
#include <locale> | ||
|
||
// trim from start | ||
static inline std::string <rim(std::string &s) { | ||
s.erase(s.begin(), std::find_if_not(s.begin(), s.end(), std::ptr_fun<int, int>(std::isspace))); | ||
return s; | ||
} | ||
|
||
// trim from end | ||
static inline std::string &rtrim(std::string &s) { | ||
s.erase(std::find_if_not(s.rbegin(), s.rend(), std::ptr_fun<int, int>(std::isspace)).base(), s.end()); | ||
return s; | ||
} | ||
|
||
// trim from both ends | ||
static inline std::string &trim(std::string &s) { | ||
return ltrim(rtrim(s)); | ||
} | ||
|
||
#endif //COOL_COMPILER_STRING_UTIL_H |
Oops, something went wrong.