version 1.71, 2007/07/24 19:00:17 |
version 1.72, 2007/07/30 09:47:21 |
|
|
static void push_used(Var *); |
static void push_used(Var *); |
static void pop_used(Var *); |
static void pop_used(Var *); |
static char *get_expanded_value(Var *, int, SymTable *, bool, bool *); |
static char *get_expanded_value(Var *, int, SymTable *, bool, bool *); |
|
static bool parse_base_variable_name(const char **, struct Name *, SymTable *); |
|
|
|
|
|
|
|
|
} |
} |
} |
} |
|
|
bool |
static bool |
Var_ParseSkip(const char **pstr, SymTable *ctxt) |
parse_base_variable_name(const char **pstr, struct Name *name, SymTable *ctxt) |
{ |
{ |
const char *tstr; |
|
const char *str = *pstr; |
const char *str = *pstr; |
struct Name name; |
const char *tstr; |
bool result; |
|
bool has_modifier = false; |
bool has_modifier = false; |
|
|
switch(str[1]) { |
switch(str[1]) { |
case '(': |
case '(': |
case '{': |
case '{': |
/* Find eventual modifiers in the variable */ |
/* Find eventual modifiers in the variable */ |
tstr = VarName_Get(str+2, &name, ctxt, false, find_pos(str[1])); |
tstr = VarName_Get(str+2, name, ctxt, false, find_pos(str[1])); |
VarName_Free(&name); |
|
if (*tstr == ':') |
if (*tstr == ':') |
has_modifier = true; |
has_modifier = true; |
else if (*tstr != '\0') { |
else if (*tstr != '\0') { |
|
|
} |
} |
break; |
break; |
default: |
default: |
|
name->s = str+1; |
|
name->e = str+2; |
|
name->tofree = false; |
tstr = str + 2; |
tstr = str + 2; |
break; |
break; |
} |
} |
|
*pstr = tstr; |
|
return has_modifier; |
|
} |
|
|
|
bool |
|
Var_ParseSkip(const char **pstr, SymTable *ctxt) |
|
{ |
|
const char *str = *pstr; |
|
struct Name name; |
|
bool result; |
|
bool has_modifier; |
|
const char *tstr = str; |
|
|
|
has_modifier = parse_base_variable_name(&tstr, &name, ctxt); |
|
VarName_Free(&name); |
result = true; |
result = true; |
if (has_modifier) |
if (has_modifier) |
if (VarModifiers_Apply(NULL, NULL, ctxt, true, NULL, &tstr, |
if (VarModifiers_Apply(NULL, NULL, ctxt, true, NULL, &tstr, |
|
|
char *val; |
char *val; |
uint32_t k; |
uint32_t k; |
int idx; |
int idx; |
bool has_modifier = false; |
bool has_modifier; |
|
|
*freePtr = false; |
*freePtr = false; |
|
|
switch(str[1]) { |
tstr = str; |
case '(': |
|
case '{': |
has_modifier = parse_base_variable_name(&tstr, &name, ctxt); |
/* Find eventual modifiers in the variable */ |
|
tstr = VarName_Get(str+2, &name, ctxt, false, find_pos(str[1])); |
|
if (*tstr == ':') |
|
has_modifier = true; |
|
else if (*tstr != '\0') |
|
tstr++; |
|
break; |
|
default: |
|
name.s = str+1; |
|
name.e = str+2; |
|
name.tofree = false; |
|
tstr = str + 2; |
|
break; |
|
} |
|
|
|
idx = classify_var(name.s, &name.e, &k); |
idx = classify_var(name.s, &name.e, &k); |
v = find_any_var(name.s, name.e, ctxt, idx, k); |
v = find_any_var(name.s, name.e, ctxt, idx, k); |