11 #ifndef AISC_LOCATION_H
26 bool allow_missing_ref;
31 char *eval_math(
char *expr,
char op_char);
32 char *evalPart(
int start,
int end,
int& result_len);
36 char *evalBehind(
int offset) {
38 char *toEval = strstr(ebuffer+offset,
"$(");
39 return (!toEval || evalRest(toEval-ebuffer)) ? ebuffer :
NULp;
43 char *report_result(
char *
s,
bool& failed) {
45 failed = errors_after != errors_before;
61 allow_missing_ref(allow_missing_ref_),
63 errors_before(
Location::get_error_count())
67 ebuffer = (
char*)malloc(bufsize);
69 memcpy(ebuffer, str, used+1);
77 return report_result(evalBehind(0), failed);
84 char *varDecl = strstr(ebuffer,
"$(");
86 res = evalBehind((varDecl+2)-ebuffer);
89 print_error(&loc,
"Expected identifier, i.e. '$(ident)'");
91 return report_result(res, failed);
98 #error aisc_eval.h included twice
static HelixNrInfo * start
static int get_error_count()
#define print_error(code_or_loc, err)
char * evalVarDecl(bool &failed)
char * evaluate(bool &failed)
Expression(const Data &data_, const Location &loc_, const char *str, bool allow_missing_ref_)
#define aisc_assert(cond)
GB_write_int const char s