This commit is contained in:
parent
88e8471014
commit
4c1a50df83
@ -4214,8 +4214,8 @@ static int compile_cons_xlist_expression (hcl_t* hcl, hcl_cnode_t* obj, int nret
|
|||||||
}
|
}
|
||||||
else if (HCL_CNODE_IS_SYMBOL(car) || HCL_CNODE_IS_DSYMBOL(car) ||
|
else if (HCL_CNODE_IS_SYMBOL(car) || HCL_CNODE_IS_DSYMBOL(car) ||
|
||||||
HCL_CNODE_IS_CONS_CONCODED(car, HCL_CONCODE_XLIST) ||
|
HCL_CNODE_IS_CONS_CONCODED(car, HCL_CONCODE_XLIST) ||
|
||||||
HCL_CNODE_IS_CONS_CONCODED(car, HCL_CONCODE_MLIST) /* ||
|
HCL_CNODE_IS_CONS_CONCODED(car, HCL_CONCODE_MLIST) ||
|
||||||
HCL_CNODE_IS_CONS_CONCODED(car, HCL_CONCODE_ALIST)*/) /* NOTE: ALIST is only used in read.c and the reader transforms it to the set expression */
|
HCL_CNODE_IS_CONS_CONCODED(car, HCL_CONCODE_ALIST))
|
||||||
{
|
{
|
||||||
/* normal function call
|
/* normal function call
|
||||||
* (<operator> <operand1> ...) */
|
* (<operator> <operand1> ...) */
|
||||||
|
13
lib/print.c
13
lib/print.c
@ -829,11 +829,24 @@ void hcl_dumpcnode (hcl_t* hcl, hcl_cnode_t* cnode, int newline)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HCL_CNODE_CONS:
|
case HCL_CNODE_CONS:
|
||||||
|
{
|
||||||
|
hcl_concode_t cc;
|
||||||
|
|
||||||
hcl_logbfmt (hcl, HCL_LOG_FATAL, " (");
|
hcl_logbfmt (hcl, HCL_LOG_FATAL, " (");
|
||||||
hcl_dumpcnode (hcl, HCL_CNODE_CONS_CAR(cnode), 0);
|
hcl_dumpcnode (hcl, HCL_CNODE_CONS_CAR(cnode), 0);
|
||||||
|
|
||||||
|
cc = HCL_CNODE_CONS_CONCODE(cnode);
|
||||||
|
switch (cc)
|
||||||
|
{
|
||||||
|
case HCL_CONCODE_ALIST:
|
||||||
|
hcl_logbfmt (hcl, HCL_LOG_FATAL, " := ");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
hcl_dumpcnode (hcl, HCL_CNODE_CONS_CDR(cnode),0);
|
hcl_dumpcnode (hcl, HCL_CNODE_CONS_CDR(cnode),0);
|
||||||
hcl_logbfmt (hcl, HCL_LOG_FATAL, ") ");
|
hcl_logbfmt (hcl, HCL_LOG_FATAL, ") ");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case HCL_CNODE_ELIST:
|
case HCL_CNODE_ELIST:
|
||||||
hcl_logbfmt (hcl, HCL_LOG_FATAL, " () ", HCL_CNODE_GET_TOKLEN(cnode), HCL_CNODE_GET_TOKPTR(cnode));
|
hcl_logbfmt (hcl, HCL_LOG_FATAL, " () ", HCL_CNODE_GET_TOKLEN(cnode), HCL_CNODE_GET_TOKPTR(cnode));
|
||||||
|
20
t/var-02.hcl
20
t/var-02.hcl
@ -14,11 +14,25 @@ if (eqv? j 20) {
|
|||||||
q := (x 30);
|
q := (x 30);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (/= a 900) { print "ERROR: a is not 900\n" } \
|
if (/= a 900) { printf "ERROR: a is not 900\n" } \
|
||||||
else { printf "OK: %d\n" a };
|
else { printf "OK: %d\n" a };
|
||||||
|
|
||||||
if (/= b 60) { print "ERROR: b is not 60\n" } \
|
if (/= b 60) { printf "ERROR: b is not 60\n" } \
|
||||||
else { printf "OK: %d\n" b };
|
else { printf "OK: %d\n" b };
|
||||||
|
|
||||||
if (/= c 840) { print "ERROR: c is not 840\n" } \
|
if (/= c 840) { printf "ERROR: c is not 840\n" } \
|
||||||
else { printf "OK: %d\n" c };
|
else { printf "OK: %d\n" c };
|
||||||
|
|
||||||
|
[aa,bb,cc] := ((xx := x) 10)
|
||||||
|
|
||||||
|
if (/= aa 100) { printf "ERROR: aa is not 100\n" } \
|
||||||
|
else { printf "OK: %d\n" aa };
|
||||||
|
|
||||||
|
if (/= bb 20) { printf "ERROR: bb is not 20\n" } \
|
||||||
|
else { printf "OK: %d\n" bb };
|
||||||
|
|
||||||
|
if (/= cc 80) { printf "ERROR: cc is not 80\n" } \
|
||||||
|
else { printf "OK: %d\n" cc };
|
||||||
|
|
||||||
|
if (nqv? xx x) { printf "ERROR: xx is not equal to x\n"} \
|
||||||
|
else { printf "OK: xx and x are equal\n" }
|
||||||
|
Loading…
Reference in New Issue
Block a user