commit 340ee97d153ffa8f69fc2598f111213074fa7689 from: Omar Polo date: Sun Aug 08 12:10:27 2021 UTC add special `vargs' keyword commit - 3756a3dfdf91085fe9a25ae02c36d5d1e57f0d47 commit + 340ee97d153ffa8f69fc2598f111213074fa7689 blob - 83368aa9f3d72c311e6cfd8123de38ac0860e872 blob + 938b5810a480c9d41ae47bb3279d495c591e586c --- np.y +++ np.y @@ -96,12 +96,13 @@ typedef struct { %token SHOULD_FAIL STR %token TESTING %token U8 U16 U32 +%token VARGS %token STRING SYMBOL %token NUMBER %type cast cexpr check expr faccess funcall -%type literal sfail var varref +%type literal sfail var varref vargs %type procname @@ -164,8 +165,10 @@ literal : STRING { $$ = op_lit_str($1); } cexpr : literal | varref | funcall | faccess ; check : cexpr '=' '=' cexpr { $$ = op_cmp_eq($1, $4); } ; -expr : literal | funcall | varref | check | cast | faccess ; +expr : literal | funcall | varref | check | cast | faccess | vargs ; +vargs : VARGS { $$ = op_vargs(); } ; + cast : expr ':' U8 { $$ = op_cast($1, V_U8); } | expr ':' U16 { $$ = op_cast($1, V_U16); } | expr ':' U32 { $$ = op_cast($1, V_U32); } @@ -316,6 +319,7 @@ lookup(char *s) {"u16", U16}, {"u32", U32}, {"u8", U8}, + {"vargs", VARGS}, }; const struct keywords *p;