New calling conventions, start on print.cpp

This commit is contained in:
2021-09-07 17:37:23 -04:00
parent 924a5ec987
commit 6b2ebba84d
16 changed files with 216 additions and 104 deletions

View File

@@ -16,6 +16,25 @@
namespace util {
static bool ascii_isalpha(char c) {
return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'));
}
static bool ascii_isdigit(char c) {
return ((c >= '0') && (c <= '9'));
}
bool is_identifier(const std::string &str) {
if (str.size() == 0) return false;
char c=str[0];
if ((!ascii_isalpha(c)) && (c!='_')) return false;
for (int i = 1; i < int(str.size()); i++) {
char c = str[i];
if ((!ascii_isalpha(c)) && (!ascii_isdigit(c)) && (c!='_')) return false;
}
return true;
}
IdVector id_vector_create(int64_t id1, int64_t id2, int64_t id3, int64_t id4) {
IdVector result;
if (id1 >= 0) result.push_back(id1);