summaryrefslogtreecommitdiff
path: root/keywords.h
Commit message (Collapse)AuthorAgeFilesLines
* Initial attack at basic 'class' featurePaul "LeoNerd" Evans2023-02-101-254/+258
| | | | | | | | | | | | | Adds a new experimental warning, feature, keywords and enough parsing to implement basic classes with an empty `new` constructor method. Inject a $self lexical into method bodies; populate it with the object instance, suitably shifted Creates a new OP_METHSTART opcode to perform method setup Define an aux flag to remark which stashes are classes Basic implementation of fields. Basic anonymous methods.
* Define 'finally' keywordPaul "LeoNerd" Evans2022-01-201-192/+193
|
* Create `defer` syntax and `OP_PUSHDEFER` opcodePaul "LeoNerd" Evans2021-08-251-217/+218
| | | | | | | | | | | | | | | 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.
* Initial attempt at feature 'try'Paul "LeoNerd" Evans2021-02-041-233/+235
| | | | | | | | | * Add feature, experimental warning, keyword * Basic parsing * Basic implementation as optree fragment See also https://github.com/Perl/perl5/issues/18504
* style: Detabify regen files.Michael G. Schwern2021-01-171-1/+1
| | | | | | | | | | | They generate C files. Bump feature.pm and warnings.pm versions to satisfy cmpVERSION.pl. I can't get it to easily ignore whitespace, `git diff --name-only` does not respect the -w flag. regen_perly.pl is left alone. That would require rebuilding perly.* which is beyond a simple indentation change.
* Add the `isa` operatorPaul "LeoNerd" Evans2019-12-091-146/+147
| | | | | | | | | | | | | | | | | | Adds a new infix operator named `isa`, with the semantics that $x isa SomeClass is true if and only if `$x` is a blessed object reference that is either `SomeClass` directly, or includes the class somewhere in its @ISA hierarchy. It is false without warning or error for non-references or non-blessed references. This operator respects `->isa` method overloading, and is intended to replace boilerplate code such as use Scalar::Util 'blessed'; blessed($x) and $x->isa("SomeClass")
* revert smartmatch to 5.27.6 behaviourZefram2017-12-291-233/+234
| | | | | | | | | | | | | The pumpking has determined that the CPAN breakage caused by changing smartmatch [perl #132594] is too great for the smartmatch changes to stay in for 5.28. This reverts most of the merge in commit da4e040f42421764ef069371d77c008e6b801f45. All core behaviour and documentation is reverted. The removal of use of smartmatch from a couple of tests (that aren't testing smartmatch) remains. Customisation of a couple of CPAN modules to make them portable across smartmatch types remains. A small bugfix in scope.c also remains.
* add "whereis"Zefram2017-12-061-7/+8
| | | | | "whereis" is like "whereso" except that it performs an implicit smartmatch.
* change "when" keyword to "whereso"Zefram2017-12-051-2/+2
|
* remove useless "break" mechanismZefram2017-11-291-233/+232
|
* remove useless "default" mechanismZefram2017-11-281-216/+215
|
* Regen from the "special" regen scriptsAaron Crane2016-11-111-1/+1
| | | | | | A few regen scripts aren't run by "make regen", either because they depend on an external tool, or they must be run by the Perl just built. So they must be run manually.
* Deparse.pm lives in lib/B now, not dist/B-DeparseLukas Mai2016-01-081-1/+1
|
* Remove or downgrade unnecessary dVAR.Jarkko Hietaniemi2014-06-251-1/+1
| | | | | | | | You need to configure with g++ *and* -Accflags=-DPERL_GLOBAL_STRUCT or -Accflags=-DPERL_GLOBAL_STRUCT_PRIVATE to see any difference. (g++ does not do the "post-annotation" form of "unused".) The version code has some of these issues, reported upstream.
* Stop lexical CORE sub from interfering with CORE::Father Chrysostomos2013-11-081-247/+246
| | | | | | | | | | | | | | | | | | | | The way CORE:: was handled in the lexer was convoluted. CORE was treated initially as a keyword, with exceptions in the lexer to make it behave correctly. If it turned out not to be followed by ::, then the lexer would fall back to treating it as a bareword or sub name. Before even checking for a keyword, the lexer looks for :: and goes to the bareword/sub code. But it made a special exception there for CORE::. In the end, treating CORE as a keyword recognized by the keyword() function requires more special cases than simply special-casing CORE:: in toke.c. This fixes the lexical CORE sub bug, while reducing the total num- ber of lines.
* Implement the fc keyword and the \F string escape.Brian Fraser2012-01-291-192/+193
| | | | | | | | | | | | | | | | | | | | | | Along with the simple_casefolding and full_casefolding features. fc() stands for foldcase, a sort of pseudo case (like lowercase), which is used to implement Unicode casefolding. It maps a string to a form where all case differences are erased, so it's a locale-independent way of checking if two strings are the same, regardless of case. This functionality was, and still is, available through the regular expression engine -- /i matches would use casefolding internally. The fc keyword merely exposes this for easier access. Previously, one could attempt to case-insensitively test two strings for equality by doing lc($a) eq lc($b) But that might get you wrong results, for example in the case of \x{DF}, LATIN SMALL LETTER SHARP S.
* Use new feature-testing macrosFather Chrysostomos2011-12-241-1/+1
| | | | | | | Instead of using FEATURE_IS_ENABLED("say"), etc., now use FEATURE_SAY_IS_ENABLED instead. These new macros, in feature.h, also check feature bundle hints in PL_hints, so we can start using those hints. Two commits ago, feature.pm started setting them.
* [perl #80628] __SUB__Father Chrysostomos2011-11-221-249/+250
| | | | | After much alternation, altercation and alteration, __SUB__ is finally here.
* Add evalbytes functionFather Chrysostomos2011-11-061-196/+197
| | | | | | | | | | | This function evaluates its argument as a byte string, regardless of the internal encoding. It croaks if the string contains characters outside the byte range. Hence evalbytes(" use utf8; '\xc4\x80' ") will return "\x{100}", even if the original string had the UTF8 flag on, and evalbytes(" '\xc4\x80' ") will return "\xc4\x80". This has the side effect of fixing the deparsing of CORE::break under ‘use feature’ when there is an override.
* Simplify the CORE::__FOO__ op-generation codeFather Chrysostomos2011-08-241-1/+1
| | | | | | | It just happens that the (caller)[...] offsets for file and line are the same as the keyword numbers. KEY___PACKAGE__ is 3 and (caller)[0] returns the package, so keyword_number % 3 can be used for the offset instead of an unwieldy switch block.
* Forgot to run keywords.plFather Chrysostomos2011-06-171-1/+1
| | | | I didn’t realise adding a comment would require this.
* Add an optional third argument to open_new(), to invoke read_only_top() with.Nicholas Clark2011-05-191-1/+1
| | | | Merge together many calls to open_new() and read_only_top().
* Rename safer_open() to open_new(), and eliminate the first parameter.Nicholas Clark2011-05-191-1/+1
| | | | Update the SHA256s where necessary in the generated files.
* Merge perl_keyword.pl into regen/keywords.pl, to generate keywords.[ch]Nicholas Clark2011-01-241-1/+3
| | | | | | | | | | Prepend + or - in front of all the keyword names in __DATA__ to mark weak and strong keywords, needed for keyword.c As keywords.c needs Devel::Tokenizer::C 0.05, not a core module (and not a common module either) we can no longer run it as part of regen.pl. So store the sha256 of the source in the generated files, and use this in to check that they are not stale (in t/porting/regen.t)
* Move all the generated file header printing into read_only_top()Nicholas Clark2011-01-231-3/+4
| | | | | | | | | Previously all the scripts in regen/ had code to generate header comments (buffer-read-only, "do not edit this file", and optionally regeneration script, regeneration data, copyright years and filename). This change results in some minor reformatting of header blocks, and standardises the copyright line as "Larry Wall and others".
* keywords.pl -> regen/keywords.plFather Chrysostomos2010-10-131-2/+2
|
* Remove the 'err' keywordRafael Garcia-Suarez2007-09-071-197/+196
| | | p4raw-id: //depot/perl@31812
* Regenerate all filesRafael Garcia-Suarez2007-01-101-1/+1
| | | p4raw-id: //depot/perl@29747
* stab at UNITCHECK blocksAlexander Gough2006-10-191-245/+246
| | | | | Message-ID: <20061019120412.GA12290@the.earth.li> p4raw-id: //depot/perl@29053
* Introduce a new keyword, state, for state variables.Rafael Garcia-Suarez2006-05-031-42/+43
| | | p4raw-id: //depot/perl@28086
* Update the copyright years in the generated files, and nostdio.hNicholas Clark2006-01-081-2/+2
| | | p4raw-id: //depot/perl@26736
* latest switch/say/~~Robin Houston2005-12-191-226/+231
| | | | | Message-Id: <20051217204431.GB28940@rpc142.cs.man.ac.uk> p4raw-id: //depot/perl@26400
* Include vim/emacs modelines in generated files to open themRafael Garcia-Suarez2005-05-111-1/+4
| | | | | | in read-only mode. Make vi modelines compatible with non-vim vi versions. p4raw-id: //depot/perl@24445
* Fix up Larry's copyright statements to my best knowledge.Jarkko Hietaniemi2003-04-161-1/+2
| | | | | | | (Lots of Perl 5 source code archaeology was involved.) Larry didn't make strangled noises when I showed him the patch, either :-) p4raw-id: //depot/perl@19242
* Reverse copyright update (#18801) for files not changed in 2003.Hugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18807
* Update all copyrights to 2003, from JarkkoHugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18801
* Defined-or patch (cleaned up)Brent Dax2002-08-051-192/+193
| | | | | | From: "Brent Dax" <brentdax@cpan.org> Message-id: <000001c234a1$d1ca72c0$6501a8c0@deepblue> p4raw-id: //depot/perl@17682
* typoHugo van der Sanden2002-08-051-1/+1
| | | p4raw-id: //depot/perl@17681
* warn that keywords.h is generatedHugo van der Sanden2002-08-051-0/+3
| | | p4raw-id: //depot/perl@17680
* Sprinkle some copyrights (use the oldest timestamp toJarkko Hietaniemi2002-01-241-0/+9
| | | | | | be found in the repository, which is most often not right, but at least consistent) p4raw-id: //depot/perl@14400
* Re: [PATCH 2 pl2pm.PL]Joe Smith2001-09-141-96/+95
| | | | | | | Message-Id: <3BA1AE1C.64313CEE@inwap.com> Eradicate qu. p4raw-id: //depot/perl@12016
* Remove EQ keywordMike Guy2001-05-231-242/+236
| | | | | Message-Id: <E152Vhp-00072x-00@virgo.cus.cam.ac.uk> p4raw-id: //depot/perl@10185
* Missing from #8439.Jarkko Hietaniemi2001-01-151-95/+96
| | | p4raw-id: //depot/perl@8443
* s/STOP/CHECK/ blocksGurusamy Sarathy2000-01-261-1/+1
| | | p4raw-id: //depot/perl@4905
* implement STOP blocks and fix compiler to use them (minimallyGurusamy Sarathy1999-11-041-233/+234
| | | | | tested) p4raw-id: //depot/perl@4515
* Re: [PATCH 5.005_61] "our" declarationsLarry Wall1999-09-251-108/+109
| | | | | Message-Id: <199909250459.VAA27506@kiev.wall.org> p4raw-id: //depot/perl@4227
* added patch, tweaked PERL_OBJECT thingsGraham Barr1998-07-131-96/+97
| | | | | | Message-Id: <19980712195747.C493@pobox.com> Subject: [ PATCH perl5.004_72] patch to add qr// p4raw-id: //depot/perl@1461
* Run embed.pl and keywords.pl to complete RESTART -> INIT changeMalcolm Beattie1997-09-031-4/+4
| | | p4raw-id: //depot/perl@54
* Introduce pp_lock.Malcolm Beattie1997-07-051-127/+128
| | | p4raw-id: //depot/perl@35
* Integrate thrperl 5.003->5.004.Malcolm Beattie1997-05-261-245/+247
|\ | | | | p4raw-id: //depot/perl@24