Small fixes to the grammer, ASTTransformation and CGenerator. Should now be ready to begin implementation of multiple files, conditional inclusion, and code passthrough.

This commit is contained in:
Nathan Braswell
2013-12-19 10:39:36 -06:00
parent f273deaedc
commit 6ad406e42d
7 changed files with 28 additions and 13 deletions

View File

@@ -31,3 +31,12 @@ std::string replaceExEscape(std::string first, std::string search, std::string r
}
return first;
}
//String slicing is crazy useful. substr isn't bad, but slicing with negative indicies is wonderful
std::string strSlice(std::string str, int begin, int end) {
if (begin < 0)
begin += str.length()+1;
if (end < 0)
end += str.length()+1;
return str.substr(begin, end-begin);
}