Added simple const value caching. Fix CMake to default back to debug mode

This commit is contained in:
Jonathan Turner
2009-09-07 15:48:32 +00:00
parent 4713325877
commit 7e3127549f
3 changed files with 58 additions and 22 deletions

View File

@@ -68,14 +68,17 @@ namespace chaiscript
int identifier;
const char *filename;
File_Position start, end;
bool is_cached;
Boxed_Value cached_value;
std::vector<TokenPtr> children;
TokenPtr annotation;
Token(const std::string &token_text, int id, const char *fname) : text(token_text), identifier(id), filename(fname) { }
Token(const std::string &token_text, int id, const char *fname) :
text(token_text), identifier(id), filename(fname), is_cached(false) { }
Token(const std::string &token_text, int id, const char *fname, int start_line, int start_col, int end_line, int end_col) :
text(token_text), identifier(id), filename(fname) {
text(token_text), identifier(id), filename(fname), is_cached(false) {
start.line = start_line;
start.column = start_col;