From af3fa90e8bb41c306c5fe2d2cf105db6bbabd1d9 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Tue, 19 Oct 2021 10:53:45 -0700 Subject: Feat: word operators and more robust crashing Added the length and concatenate operators. Slightly improved the robustness on syntax errors. --- sys/cmd/rc/parse.h | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'sys/cmd/rc/parse.h') diff --git a/sys/cmd/rc/parse.h b/sys/cmd/rc/parse.h index 8fc661f..85be043 100644 --- a/sys/cmd/rc/parse.h +++ b/sys/cmd/rc/parse.h @@ -55,14 +55,18 @@ extern int yydebug; YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ Tword = 258, /* Tword */ - Tif = 259, /* Tif */ - Telse = 260, /* Telse */ - Tbang = 261, /* Tbang */ - Targs = 262, /* Targs */ - Tbasic = 263, /* Tbasic */ - Tparen = 264, /* Tparen */ - Tblock = 265, /* Tblock */ - Twhile = 266 /* Twhile */ + Twords = 259, /* Twords */ + Tif = 260, /* Tif */ + Telse = 261, /* Telse */ + Tbang = 262, /* Tbang */ + Targs = 263, /* Targs */ + Tindex = 264, /* Tindex */ + Tbasic = 265, /* Tbasic */ + Tparen = 266, /* Tparen */ + Tblock = 267, /* Tblock */ + Twhile = 268, /* Twhile */ + Tcount = 269, /* Tcount */ + Tflat = 270 /* Tflat */ }; typedef enum yytokentype yytoken_kind_t; #endif @@ -72,14 +76,18 @@ extern int yydebug; #define YYerror 256 #define YYUNDEF 257 #define Tword 258 -#define Tif 259 -#define Telse 260 -#define Tbang 261 -#define Targs 262 -#define Tbasic 263 -#define Tparen 264 -#define Tblock 265 -#define Twhile 266 +#define Twords 259 +#define Tif 260 +#define Telse 261 +#define Tbang 262 +#define Targs 263 +#define Tindex 264 +#define Tbasic 265 +#define Tparen 266 +#define Tblock 267 +#define Twhile 268 +#define Tcount 269 +#define Tflat 270 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED @@ -89,7 +97,7 @@ union YYSTYPE struct Tree *tree; -#line 93 "sys/cmd/rc/parse.h" +#line 101 "sys/cmd/rc/parse.h" }; typedef union YYSTYPE YYSTYPE; -- cgit v1.2.1