summaryrefslogtreecommitdiff
path: root/perly.h
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2021-07-27 14:55:14 +0100
committerPaul Evans <leonerd@leonerd.org.uk>2021-08-25 13:52:09 +0100
commitf79e2ff95fbb22eaf18e130c7cba8a9d40be3d75 (patch)
tree18bedb48e757671114f8f63c8691677a06b62a1b /perly.h
parent4b21956ed64a9303ab72a46be1cd68c22bff2560 (diff)
downloadperl-f79e2ff95fbb22eaf18e130c7cba8a9d40be3d75.tar.gz
Create `defer` syntax and `OP_PUSHDEFER` opcode
Adds syntax `defer { BLOCK }` to create a deferred block; code that is deferred until the scope exits. This syntax is guarded by use feature 'defer'; Adds a new opcode, `OP_PUSHDEFER`, which is a LOGOP whose `op_other` field gives the start of an optree to be deferred until scope exit. That op pointer will be stored on the save stack and invoked as part of scope unwind. Included is support for `B::Deparse` to deparse the optree back into syntax.
Diffstat (limited to 'perly.h')
-rw-r--r--perly.h65
1 files changed, 33 insertions, 32 deletions
diff --git a/perly.h b/perly.h
index e7917e4c40..4dcd5eea05 100644
--- a/perly.h
+++ b/perly.h
@@ -135,37 +135,38 @@ extern int yydebug;
FORMRBRACK = 334,
SUBLEXSTART = 335,
SUBLEXEND = 336,
- PREC_LOW = 337,
- OROP = 338,
- ANDOP = 339,
- NOTOP = 340,
- ASSIGNOP = 341,
- PERLY_QUESTION_MARK = 342,
- PERLY_COLON = 343,
- OROR = 344,
- DORDOR = 345,
- ANDAND = 346,
- BITOROP = 347,
- BITANDOP = 348,
- CHEQOP = 349,
- NCEQOP = 350,
- CHRELOP = 351,
- NCRELOP = 352,
- SHIFTOP = 353,
- MATCHOP = 354,
- PERLY_EXCLAMATION_MARK = 355,
- PERLY_TILDE = 356,
- UMINUS = 357,
- REFGEN = 358,
- POWOP = 359,
- PREINC = 360,
- PREDEC = 361,
- POSTINC = 362,
- POSTDEC = 363,
- POSTJOIN = 364,
- ARROW = 365,
- PERLY_PAREN_CLOSE = 366,
- PERLY_PAREN_OPEN = 367
+ DEFER = 337,
+ PREC_LOW = 338,
+ OROP = 339,
+ ANDOP = 340,
+ NOTOP = 341,
+ ASSIGNOP = 342,
+ PERLY_QUESTION_MARK = 343,
+ PERLY_COLON = 344,
+ OROR = 345,
+ DORDOR = 346,
+ ANDAND = 347,
+ BITOROP = 348,
+ BITANDOP = 349,
+ CHEQOP = 350,
+ NCEQOP = 351,
+ CHRELOP = 352,
+ NCRELOP = 353,
+ SHIFTOP = 354,
+ MATCHOP = 355,
+ PERLY_EXCLAMATION_MARK = 356,
+ PERLY_TILDE = 357,
+ UMINUS = 358,
+ REFGEN = 359,
+ POWOP = 360,
+ PREINC = 361,
+ PREDEC = 362,
+ POSTINC = 363,
+ POSTDEC = 364,
+ POSTJOIN = 365,
+ ARROW = 366,
+ PERLY_PAREN_CLOSE = 367,
+ PERLY_PAREN_OPEN = 368
};
#endif
@@ -218,6 +219,6 @@ int yyparse (void);
/* Generated from:
- * 427b422b0ce1154d834dc461973a3254729575694f98ab600032f67ccab7b9e5 perly.y
+ * 3759c9ee4ef2ae2879c32641e36adc50c85c0dc40dd6283752cdcac7e736fa5f perly.y
* acf1cbfd2545faeaaa58b1cf0cf9d7f98b5be0752eb7a54528ef904a9e2e1ca7 regen_perly.pl
* ex: set ro: */