This commit is contained in:
parent
3d0cdb5366
commit
506b8fd9d7
@ -106,11 +106,6 @@ hcl_cnode_t* hcl_makecnodecolonlt (hcl_t* hcl, int flags, const hcl_loc_t* loc,
|
||||
return hcl_makecnode(hcl, HCL_CNODE_COLONLT, flags, loc, tok);
|
||||
}
|
||||
|
||||
hcl_cnode_t* hcl_makecnodecolonstar (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok)
|
||||
{
|
||||
return hcl_makecnode(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)
|
||||
{
|
||||
hcl_cnode_t* c = hcl_makecnode(hcl, HCL_CNODE_CHARLIT, flags, loc, tok);
|
||||
|
@ -5282,12 +5282,13 @@ redo:
|
||||
case HCL_CNODE_COLON:
|
||||
case HCL_CNODE_COLONLT:
|
||||
case HCL_CNODE_COLONGT:
|
||||
case HCL_CNODE_COLONSTAR:
|
||||
default:
|
||||
/*
|
||||
hcl_setsynerrbfmt (hcl, HCL_SYNERR_INTERN, HCL_CNODE_GET_LOC(oprnd), HCL_CNODE_GET_TOK(oprnd), "internal error - unexpected object type %d", HCL_CNODE_GET_TYPE(oprnd));
|
||||
*/
|
||||
hcl_setsynerrbfmt (hcl, HCL_SYNERR_BANNED, HCL_CNODE_GET_LOC(oprnd), HCL_CNODE_GET_TOK(oprnd), "prohibited in this context", HCL_CNODE_GET_TYPE(oprnd));
|
||||
hcl_setsynerrbfmt (hcl, HCL_SYNERR_BANNED, HCL_CNODE_GET_LOC(oprnd), HCL_NULL,
|
||||
"'%.*js' prohibited in this context",
|
||||
HCL_CNODE_GET_TOKLEN(oprnd), HCL_CNODE_GET_TOKPTR(oprnd));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,6 @@ enum hcl_tok_type_t
|
||||
HCL_TOK_COLONEQ, /* := */
|
||||
HCL_TOK_COLONGT, /* :+ */
|
||||
HCL_TOK_COLONLT, /* :+ */
|
||||
HCL_TOK_COLONSTAR, /* :* */
|
||||
HCL_TOK_SEMICOLON, /* ; */
|
||||
HCL_TOK_COMMA, /* , */
|
||||
HCL_TOK_LPAREN, /* ( */
|
||||
@ -426,13 +425,12 @@ enum hcl_cnode_type_t
|
||||
HCL_CNODE_RETURN,
|
||||
HCL_CNODE_REVERT,
|
||||
|
||||
HCL_CNODE_ELLIPSIS,
|
||||
HCL_CNODE_TRPCOLONS,
|
||||
HCL_CNODE_ELLIPSIS, /* ... */
|
||||
HCL_CNODE_TRPCOLONS, /* ::: */
|
||||
HCL_CNODE_DBLCOLONS, /* :: */
|
||||
HCL_CNODE_COLON, /* : */
|
||||
HCL_CNODE_COLONGT, /* :> */
|
||||
HCL_CNODE_COLONLT, /* :< */
|
||||
HCL_CNODE_COLONSTAR, /* :* */
|
||||
HCL_CNODE_COLONLT /* :< */
|
||||
};
|
||||
typedef enum hcl_cnode_type_t hcl_cnode_type_t;
|
||||
|
||||
@ -458,7 +456,6 @@ typedef enum hcl_cnode_flag_t hcl_cnode_flag_t;
|
||||
#define HCL_CNODE_IS_COLON(x) ((x)->cn_type == HCL_CNODE_COLON)
|
||||
#define HCL_CNODE_IS_COLONGT(x) ((x)->cn_type == HCL_CNODE_COLONGT)
|
||||
#define HCL_CNODE_IS_COLONLT(x) ((x)->cn_type == HCL_CNODE_COLONLT)
|
||||
#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)
|
||||
@ -2012,7 +2009,6 @@ hcl_cnode_t* hcl_makecnodedblcolons (hcl_t* hcl, int flags, const hcl_loc_t* loc
|
||||
hcl_cnode_t* hcl_makecnodecolon (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok);
|
||||
hcl_cnode_t* hcl_makecnodecolongt (hcl_t* hcl, int flags, const hcl_loc_t* loc, const hcl_oocs_t* tok);
|
||||
hcl_cnode_t* hcl_makecnodecolonlt (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);
|
||||
|
@ -945,7 +945,6 @@ void hcl_dumpcnode (hcl_t* hcl, hcl_cnode_t* cnode, int newline)
|
||||
case HCL_CNODE_COLON:
|
||||
case HCL_CNODE_COLONGT:
|
||||
case HCL_CNODE_COLONLT:
|
||||
case HCL_CNODE_COLONSTAR:
|
||||
hcl_logbfmt (hcl, HCL_LOG_FATAL, " %.*js ", HCL_CNODE_GET_TOKLEN(cnode), HCL_CNODE_GET_TOKPTR(cnode));
|
||||
break;
|
||||
|
||||
|
@ -1887,10 +1887,6 @@ static int feed_process_token (hcl_t* hcl)
|
||||
frd->obj = hcl_makecnodecolonlt(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:
|
||||
{
|
||||
hcl_oow_t i;
|
||||
@ -2114,7 +2110,6 @@ static delim_token_t delim_token_tab[] =
|
||||
{ ":=", 2, HCL_TOK_COLONEQ }, /* assignment */
|
||||
{ ":>", 2, HCL_TOK_COLONGT },
|
||||
{ ":<", 2, HCL_TOK_COLONLT },
|
||||
{ ":*", 2, HCL_TOK_COLONSTAR }, /* class instantiation method */
|
||||
{ "::", 2, HCL_TOK_DBLCOLONS }, /* superclass, class variables, class methods */
|
||||
{ ":::", 3, HCL_TOK_TRPCOLONS },
|
||||
|
||||
|
@ -27,11 +27,11 @@ if (< 2 3) {} elif true else ##ERROR: syntax error - block expression expected
|
||||
|
||||
---
|
||||
|
||||
if else ##ERROR: syntax error - prohibited in this context - else
|
||||
if else ##ERROR: syntax error - 'else' prohibited in this context
|
||||
|
||||
---
|
||||
|
||||
if elif else ##ERROR: syntax error - prohibited in this context - elif
|
||||
if elif else ##ERROR: syntax error - 'elif' prohibited in this context
|
||||
|
||||
---
|
||||
|
||||
|
@ -130,7 +130,7 @@ printf "%O\n" 35rabcdefghijklzabcd ##ERROR: syntax error - invalid numeric lite
|
||||
|
||||
---
|
||||
|
||||
printf :*; ##ERROR: syntax error - prohibited in this context
|
||||
printf if; ##ERROR: syntax error - 'if' prohibited in this context
|
||||
|
||||
---
|
||||
|
||||
@ -140,7 +140,7 @@ fun :: fun1() { ##ERROR: syntax error - invalid function name '::' for 'fun'
|
||||
|
||||
---
|
||||
|
||||
fun :* fun1() { ##ERROR: syntax error - invalid function name ':*' for 'fun'
|
||||
fun fun fun1() { ##ERROR: syntax error - invalid function name 'fun' for 'fun'
|
||||
return 10;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user