shortened ::* to :*
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-02-03 18:50:10 +09:00
parent 9aa1bde1a1
commit c2928615a4
12 changed files with 39 additions and 23 deletions

View File

@ -86,9 +86,14 @@ hcl_cnode_t* hcl_makecnodetrpcolons (hcl_t* hcl, int flags, const hcl_loc_t* loc
return make_cnode(hcl, HCL_CNODE_TRPCOLONS, flags, loc, tok);
}
hcl_cnode_t* hcl_makecnodedcstar (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok)
hcl_cnode_t* hcl_makecnodecolonplus (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok)
{
return make_cnode(hcl, HCL_CNODE_DCSTAR, flags, loc, tok);
return make_cnode(hcl, HCL_CNODE_COLONPLUS, flags, loc, tok);
}
hcl_cnode_t* hcl_makecnodecolonstar (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok)
{
return make_cnode(hcl, HCL_CNODE_COLONSTAR, flags, loc, tok);
}
hcl_cnode_t* hcl_makecnodecharlit (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok, hcl_ooch_t v)

View File

@ -2745,10 +2745,11 @@ static int compile_lambda (hcl_t* hcl, hcl_cnode_t* src, int defun)
defun_name = HCL_CNODE_CONS_CAR(obj);
if (is_in_class_init_scope(hcl))
{
if ((HCL_CNODE_IS_TRPCOLONS(defun_name) || HCL_CNODE_IS_DCSTAR(defun_name)))
if ((HCL_CNODE_IS_TRPCOLONS(defun_name) || HCL_CNODE_IS_COLONSTAR(defun_name)))
{
/* class method - (defun ::: xxxx () ...) inside class definition */
/* class instantiation method - (defun ::* xxxx () ...) inside class definition */
/* class method - (defun:+ xxxx() ...) inside class definition */
/* class instantiation method - (defun:* xxxx() ...) inside class definition */
obj = HCL_CNODE_CONS_CDR(obj);
if (!obj)
{

View File

@ -187,8 +187,9 @@ enum hcl_tok_type_t
HCL_TOK_COLON, /* : */
HCL_TOK_DBLCOLONS, /* :: */
HCL_TOK_TRPCOLONS, /* ::: */
HCL_TOK_DCSTAR, /* ::* */
HCL_TOK_COLONEQ, /* := */
HCL_TOK_COLONPLUS, /* :+ */
HCL_TOK_COLONSTAR, /* :* */
HCL_TOK_SEMICOLON, /* ; */
HCL_TOK_COMMA, /* , */
HCL_TOK_LPAREN, /* ( */
@ -256,7 +257,8 @@ enum hcl_cnode_type_t
HCL_CNODE_SUPER,
HCL_CNODE_ELLIPSIS,
HCL_CNODE_TRPCOLONS,
HCL_CNODE_DCSTAR,
HCL_CNODE_COLONPLUS, /* :+ */
HCL_CNODE_COLONSTAR, /* :* */
HCL_CNODE_CONS,
HCL_CNODE_ELIST, /* empty list */
@ -279,7 +281,8 @@ typedef enum hcl_cnode_flagt hcl_cnode_flag_t;
#define HCL_CNODE_IS_ELLIPSIS(x) ((x)->cn_type == HCL_CNODE_ELLIPSIS)
#define HCL_CNODE_IS_TRPCOLONS(x) ((x)->cn_type == HCL_CNODE_TRPCOLONS)
#define HCL_CNODE_IS_DCSTAR(x) ((x)->cn_type == HCL_CNODE_DCSTAR)
#define HCL_CNODE_IS_COLONPLUS(x) ((x)->cn_type == HCL_CNODE_COLONPLUS)
#define HCL_CNODE_IS_COLONSTAR(x) ((x)->cn_type == HCL_CNODE_COLONSTAR)
#define HCL_CNODE_IS_SYMBOL(x) ((x)->cn_type == HCL_CNODE_SYMBOL)
#define HCL_CNODE_IS_SYMBOL_PLAIN(x) ((x)->cn_type == HCL_CNODE_SYMBOL && (x)->u.symbol.syncode == 0)
@ -1777,7 +1780,8 @@ hcl_cnode_t* hcl_makecnodeself (hcl_t* hcl, int flags, const hcl_loc_t* loc, con
hcl_cnode_t* hcl_makecnodesuper (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok);
hcl_cnode_t* hcl_makecnodeellipsis (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok);
hcl_cnode_t* hcl_makecnodetrpcolons (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok);
hcl_cnode_t* hcl_makecnodedcstar (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok);
hcl_cnode_t* hcl_makecnodecolonplus (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok);
hcl_cnode_t* hcl_makecnodecolonstar (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok);
hcl_cnode_t* hcl_makecnodecharlit (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok, hcl_ooch_t v);
hcl_cnode_t* hcl_makecnodebchrlit (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok, hcl_oob_t v);
hcl_cnode_t* hcl_makecnodesymbol (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok);

View File

@ -817,7 +817,8 @@ void hcl_dumpcnode (hcl_t* hcl, hcl_cnode_t* cnode, int newline)
case HCL_CNODE_SUPER:
case HCL_CNODE_ELLIPSIS:
case HCL_CNODE_TRPCOLONS:
case HCL_CNODE_DCSTAR:
case HCL_CNODE_COLONSTAR:
case HCL_CNODE_COLONPLUS:
hcl_logbfmt (hcl, HCL_LOG_FATAL, " %.*js ", HCL_CNODE_GET_TOKLEN(cnode), HCL_CNODE_GET_TOKPTR(cnode));
break;

View File

@ -1432,8 +1432,12 @@ static int feed_process_token (hcl_t* hcl)
frd->obj = hcl_makecnodetrpcolons(hcl, 0, TOKEN_LOC(hcl), TOKEN_NAME(hcl));
goto auto_xlist;
case HCL_TOK_DCSTAR:
frd->obj = hcl_makecnodedcstar(hcl, 0, TOKEN_LOC(hcl), TOKEN_NAME(hcl));
case HCL_TOK_COLONPLUS:
frd->obj = hcl_makecnodecolonplus(hcl, 0, TOKEN_LOC(hcl), TOKEN_NAME(hcl));
goto auto_xlist;
case HCL_TOK_COLONSTAR:
frd->obj = hcl_makecnodecolonstar(hcl, 0, TOKEN_LOC(hcl), TOKEN_NAME(hcl));
goto auto_xlist;
case HCL_TOK_SMPTRLIT:
@ -1652,8 +1656,9 @@ static delim_token_t delim_token_tab[] =
{ ":", 1, HCL_TOK_COLON }, /* key-value separator in dictionary */
{ ":=", 2, HCL_TOK_COLONEQ }, /* assignment */
{ ":+", 2, HCL_TOK_COLONPLUS },
{ ":*", 2, HCL_TOK_COLONSTAR }, /* class instantiation method */
{ "::", 2, HCL_TOK_DBLCOLONS },
{ "::*", 3, HCL_TOK_DCSTAR }, /* class instantiation method */
{ ":::", 3, HCL_TOK_TRPCOLONS }, /* superclass, class variables, class methods */
{ ";", 1, HCL_TOK_SEMICOLON }