updated the tuple handling slightly
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
hyung-hwan 2024-07-15 01:09:19 +09:00
parent 57d9668110
commit 8c5affe9a5
2 changed files with 6 additions and 5 deletions

View File

@ -905,10 +905,13 @@ static HCL_INLINE int can_binop_list (hcl_t* hcl)
HCL_ASSERT (hcl, hcl->c->r.st != HCL_NULL); HCL_ASSERT (hcl, hcl->c->r.st != HCL_NULL);
rstl = hcl->c->r.st; rstl = hcl->c->r.st;
cc = (hcl_concode_t)LIST_FLAG_GET_CONCODE(rstl->flagv);
if (rstl->count <= 0) if (rstl->count <= 0 || cc == HCL_CONCODE_TUPLE)
{ {
/* allowed but it must be treated like a normal identifier */ /* allowed but it must be treated like a normal identifier.
* in case of the tuple, chain_to_list() rejects binop symbols.
* so let this routine to allow it as a normal indentifier. */
return 1; return 1;
} }
@ -917,8 +920,6 @@ static HCL_INLINE int can_binop_list (hcl_t* hcl)
/* repeated delimiters - e.g (a ++ ++ ...) (a : := ... ) */ /* repeated delimiters - e.g (a ++ ++ ...) (a : := ... ) */
if (rstl->flagv & (COMMAED | COLONED | COLONEQED | BINOPED)) return 0; if (rstl->flagv & (COMMAED | COLONED | COLONEQED | BINOPED)) return 0;
cc = (hcl_concode_t)LIST_FLAG_GET_CONCODE(rstl->flagv);
/* assignment only in XLIST */ /* assignment only in XLIST */
if (cc != HCL_CONCODE_XLIST) return 0; if (cc != HCL_CONCODE_XLIST) return 0;

View File

@ -44,7 +44,7 @@ class A [ [ [a] ] ] { ##ERROR: syntax error - not variable name
} }
--- ---
class A [ a + ] { ##ERROR: syntax error - prohibited binary operator - + class A [ a + ] { ##ERROR: syntax error - invalid name - not symbol in tuple - +
} }
--- ---