diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2022-06-08 12:35:25 +0100 |
---|---|---|
committer | Paul Evans <leonerd@leonerd.org.uk> | 2022-06-13 22:07:14 +0100 |
commit | 0065df430e3145136f9718fe1a6ba3810ef9bc91 (patch) | |
tree | 025c26e7d4780f8daf0a0dce3a29a15253fb13d1 /perly.h | |
parent | fecef29147d516d89233c43e3a9c9800e6c7f9f4 (diff) | |
download | perl-0065df430e3145136f9718fe1a6ba3810ef9bc91.tar.gz |
A better error message for `try {} catch {}` missing its (VAR)
As suggested in https://github.com/Perl/perl5/issues/19811, this now
outputs the message:
$ ./perl -Mexperimental=try
try { A() }
catch { B() }
catch block requires a (VAR) at - line 2, near "catch {"
Execution of - aborted due to compilation errors.
Diffstat (limited to 'perly.h')
-rw-r--r-- | perly.h | 247 |
1 files changed, 121 insertions, 126 deletions
@@ -4,14 +4,14 @@ Any changes made here will be lost! */ -#define PERL_BISON_VERSION 30006 +#define PERL_BISON_VERSION 30003 #ifdef PERL_CORE -/* A Bison parser, made by GNU Bison 3.6.4. */ +/* A Bison parser, made by GNU Bison 3.3. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -40,9 +40,8 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ /* Debug traces. */ #ifndef YYDEBUG @@ -52,129 +51,124 @@ extern int yydebug; #endif -/* Token kinds. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - GRAMPROG = 258, /* GRAMPROG */ - GRAMEXPR = 259, /* GRAMEXPR */ - GRAMBLOCK = 260, /* GRAMBLOCK */ - GRAMBARESTMT = 261, /* GRAMBARESTMT */ - GRAMFULLSTMT = 262, /* GRAMFULLSTMT */ - GRAMSTMTSEQ = 263, /* GRAMSTMTSEQ */ - GRAMSUBSIGNATURE = 264, /* GRAMSUBSIGNATURE */ - PERLY_AMPERSAND = 265, /* PERLY_AMPERSAND */ - PERLY_BRACE_OPEN = 266, /* PERLY_BRACE_OPEN */ - PERLY_BRACE_CLOSE = 267, /* PERLY_BRACE_CLOSE */ - PERLY_BRACKET_OPEN = 268, /* PERLY_BRACKET_OPEN */ - PERLY_BRACKET_CLOSE = 269, /* PERLY_BRACKET_CLOSE */ - PERLY_COMMA = 270, /* PERLY_COMMA */ - PERLY_DOLLAR = 271, /* PERLY_DOLLAR */ - PERLY_DOT = 272, /* PERLY_DOT */ - PERLY_EQUAL_SIGN = 273, /* PERLY_EQUAL_SIGN */ - PERLY_MINUS = 274, /* PERLY_MINUS */ - PERLY_PERCENT_SIGN = 275, /* PERLY_PERCENT_SIGN */ - PERLY_PLUS = 276, /* PERLY_PLUS */ - PERLY_SEMICOLON = 277, /* PERLY_SEMICOLON */ - PERLY_SLASH = 278, /* PERLY_SLASH */ - PERLY_SNAIL = 279, /* PERLY_SNAIL */ - PERLY_STAR = 280, /* PERLY_STAR */ - BAREWORD = 281, /* BAREWORD */ - METHOD = 282, /* METHOD */ - FUNCMETH = 283, /* FUNCMETH */ - THING = 284, /* THING */ - PMFUNC = 285, /* PMFUNC */ - PRIVATEREF = 286, /* PRIVATEREF */ - QWLIST = 287, /* QWLIST */ - FUNC0OP = 288, /* FUNC0OP */ - FUNC0SUB = 289, /* FUNC0SUB */ - UNIOPSUB = 290, /* UNIOPSUB */ - LSTOPSUB = 291, /* LSTOPSUB */ - PLUGEXPR = 292, /* PLUGEXPR */ - PLUGSTMT = 293, /* PLUGSTMT */ - LABEL = 294, /* LABEL */ - FORMAT = 295, /* FORMAT */ - SUB = 296, /* SUB */ - SIGSUB = 297, /* SIGSUB */ - ANONSUB = 298, /* ANONSUB */ - ANON_SIGSUB = 299, /* ANON_SIGSUB */ - PACKAGE = 300, /* PACKAGE */ - USE = 301, /* USE */ - WHILE = 302, /* WHILE */ - UNTIL = 303, /* UNTIL */ - IF = 304, /* IF */ - UNLESS = 305, /* UNLESS */ - ELSE = 306, /* ELSE */ - ELSIF = 307, /* ELSIF */ - CONTINUE = 308, /* CONTINUE */ - FOR = 309, /* FOR */ - GIVEN = 310, /* GIVEN */ - WHEN = 311, /* WHEN */ - DEFAULT = 312, /* DEFAULT */ - TRY = 313, /* TRY */ - CATCH = 314, /* CATCH */ - FINALLY = 315, /* FINALLY */ - LOOPEX = 316, /* LOOPEX */ - DOTDOT = 317, /* DOTDOT */ - YADAYADA = 318, /* YADAYADA */ - FUNC0 = 319, /* FUNC0 */ - FUNC1 = 320, /* FUNC1 */ - FUNC = 321, /* FUNC */ - UNIOP = 322, /* UNIOP */ - LSTOP = 323, /* LSTOP */ - MULOP = 324, /* MULOP */ - ADDOP = 325, /* ADDOP */ - DOLSHARP = 326, /* DOLSHARP */ - DO = 327, /* DO */ - HASHBRACK = 328, /* HASHBRACK */ - NOAMP = 329, /* NOAMP */ - LOCAL = 330, /* LOCAL */ - MY = 331, /* MY */ - REQUIRE = 332, /* REQUIRE */ - COLONATTR = 333, /* COLONATTR */ - FORMLBRACK = 334, /* FORMLBRACK */ - FORMRBRACK = 335, /* FORMRBRACK */ - SUBLEXSTART = 336, /* SUBLEXSTART */ - SUBLEXEND = 337, /* SUBLEXEND */ - DEFER = 338, /* DEFER */ - PREC_LOW = 339, /* PREC_LOW */ - OROP = 340, /* OROP */ - ANDOP = 341, /* ANDOP */ - NOTOP = 342, /* NOTOP */ - ASSIGNOP = 343, /* ASSIGNOP */ - PERLY_QUESTION_MARK = 344, /* PERLY_QUESTION_MARK */ - PERLY_COLON = 345, /* PERLY_COLON */ - OROR = 346, /* OROR */ - DORDOR = 347, /* DORDOR */ - ANDAND = 348, /* ANDAND */ - BITOROP = 349, /* BITOROP */ - BITANDOP = 350, /* BITANDOP */ - CHEQOP = 351, /* CHEQOP */ - NCEQOP = 352, /* NCEQOP */ - CHRELOP = 353, /* CHRELOP */ - NCRELOP = 354, /* NCRELOP */ - SHIFTOP = 355, /* SHIFTOP */ - MATCHOP = 356, /* MATCHOP */ - PERLY_EXCLAMATION_MARK = 357, /* PERLY_EXCLAMATION_MARK */ - PERLY_TILDE = 358, /* PERLY_TILDE */ - UMINUS = 359, /* UMINUS */ - REFGEN = 360, /* REFGEN */ - POWOP = 361, /* POWOP */ - PREINC = 362, /* PREINC */ - PREDEC = 363, /* PREDEC */ - POSTINC = 364, /* POSTINC */ - POSTDEC = 365, /* POSTDEC */ - POSTJOIN = 366, /* POSTJOIN */ - ARROW = 367, /* ARROW */ - PERLY_PAREN_CLOSE = 368, /* PERLY_PAREN_CLOSE */ - PERLY_PAREN_OPEN = 369 /* PERLY_PAREN_OPEN */ + GRAMPROG = 258, + GRAMEXPR = 259, + GRAMBLOCK = 260, + GRAMBARESTMT = 261, + GRAMFULLSTMT = 262, + GRAMSTMTSEQ = 263, + GRAMSUBSIGNATURE = 264, + PERLY_AMPERSAND = 265, + PERLY_BRACE_OPEN = 266, + PERLY_BRACE_CLOSE = 267, + PERLY_BRACKET_OPEN = 268, + PERLY_BRACKET_CLOSE = 269, + PERLY_COMMA = 270, + PERLY_DOLLAR = 271, + PERLY_DOT = 272, + PERLY_EQUAL_SIGN = 273, + PERLY_MINUS = 274, + PERLY_PERCENT_SIGN = 275, + PERLY_PLUS = 276, + PERLY_SEMICOLON = 277, + PERLY_SLASH = 278, + PERLY_SNAIL = 279, + PERLY_STAR = 280, + BAREWORD = 281, + METHOD = 282, + FUNCMETH = 283, + THING = 284, + PMFUNC = 285, + PRIVATEREF = 286, + QWLIST = 287, + FUNC0OP = 288, + FUNC0SUB = 289, + UNIOPSUB = 290, + LSTOPSUB = 291, + PLUGEXPR = 292, + PLUGSTMT = 293, + LABEL = 294, + FORMAT = 295, + SUB = 296, + SIGSUB = 297, + ANONSUB = 298, + ANON_SIGSUB = 299, + PACKAGE = 300, + USE = 301, + WHILE = 302, + UNTIL = 303, + IF = 304, + UNLESS = 305, + ELSE = 306, + ELSIF = 307, + CONTINUE = 308, + FOR = 309, + GIVEN = 310, + WHEN = 311, + DEFAULT = 312, + TRY = 313, + CATCH = 314, + FINALLY = 315, + LOOPEX = 316, + DOTDOT = 317, + YADAYADA = 318, + FUNC0 = 319, + FUNC1 = 320, + FUNC = 321, + UNIOP = 322, + LSTOP = 323, + MULOP = 324, + ADDOP = 325, + DOLSHARP = 326, + DO = 327, + HASHBRACK = 328, + NOAMP = 329, + LOCAL = 330, + MY = 331, + REQUIRE = 332, + COLONATTR = 333, + FORMLBRACK = 334, + FORMRBRACK = 335, + SUBLEXSTART = 336, + SUBLEXEND = 337, + DEFER = 338, + PREC_LOW = 339, + OROP = 340, + ANDOP = 341, + NOTOP = 342, + ASSIGNOP = 343, + PERLY_QUESTION_MARK = 344, + PERLY_COLON = 345, + OROR = 346, + DORDOR = 347, + ANDAND = 348, + BITOROP = 349, + BITANDOP = 350, + CHEQOP = 351, + NCEQOP = 352, + CHRELOP = 353, + NCRELOP = 354, + SHIFTOP = 355, + MATCHOP = 356, + PERLY_EXCLAMATION_MARK = 357, + PERLY_TILDE = 358, + UMINUS = 359, + REFGEN = 360, + POWOP = 361, + PREINC = 362, + PREDEC = 363, + POSTINC = 364, + POSTDEC = 365, + POSTJOIN = 366, + ARROW = 367, + PERLY_PAREN_CLOSE = 368, + PERLY_PAREN_OPEN = 369 }; - typedef enum yytokentype yytoken_kind_t; #endif /* Value type. */ @@ -203,6 +197,7 @@ S_is_opval_token(int type) { #endif /* PERL_IN_TOKE_C */ #endif /* PERL_CORE */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + union YYSTYPE { @@ -212,8 +207,8 @@ union YYSTYPE OP *opval; GV *gvval; - }; + typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -225,6 +220,6 @@ int yyparse (void); /* Generated from: - * 0caf1eb1cc4750131dc71e3a22ead383ed9a123dec61ccd23408ff13441fafde perly.y + * f6f4ca1df1f28e285f644b160b176887b111ca03c1fd20e3b4868c27a2c93623 perly.y * acf1cbfd2545faeaaa58b1cf0cf9d7f98b5be0752eb7a54528ef904a9e2e1ca7 regen_perly.pl * ex: set ro: */ |