summaryrefslogtreecommitdiff
path: root/perly.h
Commit message (Collapse)AuthorAgeFilesLines
* Bump several file copyright datesSteffen Schwigon2012-01-191-3/+3
| | | | | | | Sync copyright dates with actual changes according to git history. [Plus run regen_perly.h to update the SHA-256 checksums, and regen/regcharclass.pl to update regcharclass.h]
* [perl #95546] Allow () after __FILE__, etc.Father Chrysostomos2011-08-121-131/+133
| | | | | | | | This commit makes the __FILE__, __LINE__ and __PACKAGE__ token parse the same way as nullary functions. It adds two extra rules to perly.y to allow the op to be created in toke.c, instead of directly inside the parser.
* APIify pad functionsZefram2011-07-121-1/+1
| | | | | | | Move several pad functions into the core API. Document the pad functions more consistently for perlapi. Fix the interface issues around delimitation of lexical variable names, providing _pvn, _pvs, _pv, and _sv forms of pad_add_name and pad_findmy.
* Fix a confusing comment in perly.yFather Chrysostomos2011-06-031-2/+2
| | | | There’s no arrow there.
* 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.
* Store the SHA-256 of the source in files generated by regen_perly.plNicholas Clark2011-01-231-1/+4
| | | | | | | bison isn't available everywhere, so we can't simply re-run regen_perly.pl to verify that perly.{act,h,tab} are up to date. So instead store the SHA-256 of the input files, and extend t/porting/regen.t to check that the input files haven't been changed subsequently.
* Output "read only" editor blocks from regen_perly.plNicholas Clark2011-01-231-0/+8
| | | | | | | | | Use safer_open() and read_only_bottom_close_and_rename() from regen_lib.pl Consistently use 3 argument open and lexical file handles. A side effect of this change is that the generated files are no longer made read-only on disk - if this is desirable, then probably better to change regen_lib.pl so that all generated files are made read-only.
* recursive-descent expression parsingZefram2010-12-111-152/+154
| | | | | | New API functions parse_fullexpr(), parse_listexpr(), parse_termexpr(), and parse_arithexpr(), to parse an expression at various precedence levels.
* make regen; make regen_perlyChris 'BinGOs' Williams2010-11-201-1/+1
|
* refactor GRAMPROG grammar slightlyZefram2010-11-071-1/+1
| | | | | Shift the structure of the GRAMPROG production (whole-file grammar) to more closely match that of the other top-level productions.
* function to parse unlabelled statementZefram2010-10-251-148/+150
| | | | | New API function parse_barestmt() parses a pure statement, with no label, and returns just the statement's core ops, not attaching a state op.
* permit labels to appear before declarationsZefram2010-10-231-1/+1
| | | | | | | | Include <label> in productions before <decl> and <package_block>. This means that labels can now appear at the beginning of all statement-like things. There was no technical reason for the restriction of labels to substantive statements, and that restriction in any case couldn't be applied to PLUGSTMT-based plugged-in declarations.
* function to parse Perl code blockZefram2010-10-211-148/+150
| | | | | New API function parse_block() parses a code block, including surrounding braces. The block is a lexical scope, but not inherently a dynamic scope.
* make regen; make regen_perlyTatsuhiko Miyagawa2010-10-201-1/+1
|
* [PATCH] function to parse Perl statement sequenceZefram2010-10-041-144/+146
| | | | | New API function parse_stmtseq() parses a sequence of statements, up to closing brace or EOF.
* Shorten external symbol name for VMSFlorian Ragwitz2010-09-111-1/+1
| | | | | | VMS seems to have a 31 character limitation for external symbols. To be able to fit into that, rename 'coerce_qwlist_to_paren_list' to 'munge_qwlist_to_paren_list'.
* make qw(...) first-class syntaxZefram2010-09-081-130/+132
| | | | | | | | | | This makes a qw(...) list literal a distinct token type for the parser, where previously it was munged into a "(",THING,")" sequence. The change means that qw(...) can't accidentally supply parens to parts of the grammar that want real parens. Due to many bits of code taking advantage of that by "foreach my $x qw(...) {}", this patch also includes a hack to coerce qw(...) to the old-style parenthesised THING, emitting a deprecation warning along the way.
* Regenerate headers after last patchRafael Garcia-Suarez2010-09-061-143/+147
|
* support "package Foo { ... }"Zefram2010-05-201-24/+18
| | | | | | Package block syntax limits the scope of the package declaration to the attached block. It's cleaner than requiring the declaration to come inside the block.
* Allow arbitrary whitespace between NAME and VERSION in "package NAME ↵Jesse Vincent2010-02-031-18/+24
| | | | | | VERSION;" statements Fixes [perl #72432]
* regen_perly prepping for 5.11.4Ricardo Signes2010-01-191-24/+18
|
* regen generated files changed by the previous patch - facility to plug in ↵Jesse Vincent2009-11-051-120/+124
| | | | syntax triggered by keywords
* make regen; make regen_perlyJesse Vincent2009-10-201-18/+24
|
* Add 'package NAME VERSION' syntaxDavid Golden2009-10-061-24/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for setting the $VERSION of a namespace when the namespace is declared with 'package'. It eliminates the need for 'our $VERSION = ...' and similar constructs. E.g. package Foo::Bar 1.23; # $Foo::Bar::VERSION == 1.23 There are several advantages to this: * VERSION is parsed in *exactly* the same way as 'use NAME VERSION' * $VERSION is set at compile time * Eliminates '$VERSION = ...' and 'eval $VERSION' clutter * As it requires VERSION to be a numeric literal or v-string literal, it can be statically parsed by toolchain modules without 'eval' the way MM->parse_version does for '$VERSION = ...' * Alpha versions with underscores do not need to be quoted; static parsing will preserve the underscore, but during compilation, Perl will remove underscores as it does for all numeric literals During development of this, there was discussion on #corehackers and elsewhere that this should also allow other metadata to be set such as "status" (stable/alpha) or "author/authority". On reflection, those metadata are not very well defined yet and likely should never be encoded into Perl core parsing so they can be freely changed in the future. (They could perhaps be achieved via a comment on the same line as 'package NAME VERSION'.) Version numbers, however, already have a very specific definition and use defined in the core through 'use NAME VERSION'. This patch merely provides appropriate symmetry for setting $VERSION with the exact same parsing and semantics as 'use'. It does not break old code with only 'package NAME', but code that uses 'package NAME VERSION' will need to be restricted to perl 5.11.X. This is analogous to the change to open() from two-args to three-args. Users requiring the latest Perl will benefit, and perhaps N years from now it will become standard practice when Perl 5.12 is targeted the way that 5.6 is today. The patch does not prevent 'package NAME VERSION' from being used multiple times for the same package with different version numbers, but nothing prevents $VERSION from being modified arbitrarily at runtime, either, so I see no urgen reason to add limitations or warnings so long as Perl uses a global $VERSION variable for package version numbers. I am posting this patch to the p5p list for discussion and review. If there seems to be general assent (or lack of dissent), I will go ahead and commit the patch to blead.
* make regen; make regen_perlyJesse Vincent2009-10-021-18/+24
| | | | | | | The newer bison generated perly.h with a GPL3 or later license statement rather than the previous GPL2 statement. Our use appears to be subject to the exception that's immediately below that, so this shouldn't matter.
* Make MAD understand the "..." operatorRafael Garcia-Suarez2009-08-261-24/+18
|
* Allow when to be used as a statement modifierVincent Pit2009-03-281-18/+24
|
* Add ..., !!!, and ??? operatorschromatic2008-05-181-80/+82
| | | | | Message-Id: <200805101252.11961.chromatic@wgz.org> p4raw-id: //depot/perl@33858
* Silence the g++ warnings "right-hand operand of comma has no effect"Nicholas Clark2007-04-101-1/+1
| | | p4raw-id: //depot/perl@30900
* Patch by Gerard Goossen to add madprops to "require" opcodeRafael Garcia-Suarez2007-03-151-1/+1
| | | p4raw-id: //depot/perl@30599
* Fix leaks in label strings allocation in COPsRafael Garcia-Suarez2006-12-201-1/+1
| | | p4raw-id: //depot/perl@29601
* fix eval qw(BEGIN{die}) style leaks (second attempt).Dave Mitchell2006-12-111-1/+0
| | | | | | | | | | | | Repeat of change #28319 (backed out by change #28720), this time freeing ops using the right pad. Also backs out the remempad parser addition from change #29501; instead a new auxiliary paser stack is added, which records the current value of PL_comppad for every state. p4raw-link: @29501 on //depot/perl: 2af555bf3f2b3ca8e114df3f5f680d40bd24d6bf p4raw-link: @28720 on //depot/perl: c86b7e916b443ee192c5638ad9d077ad4e244713 p4raw-link: @28319 on //depot/perl: eb7d7d25d2f780edcbedc124a5bdca0d53ad8687 p4raw-id: //depot/perl@29504
* #28315 could crash when freeing ops with different padsDave Mitchell2006-12-101-0/+1
| | | | | | Add hook to parser to record current PL_comppad, then use this when popping ops off the parser stack after parser error p4raw-id: //depot/perl@29501
* parser: expand yy_is_opval[] to include all value typesDave Mitchell2006-12-101-1/+2
| | | | | | and rename to yy_type_tab[]. Then use this table to improve stack dumping with -Dpv p4raw-id: //depot/perl@29500
* fix some casting issues with perly.y / madly.y mergerDave Mitchell2006-12-041-2/+5
| | | p4raw-id: //depot/perl@29461
* merge perly.y and madlu.yDave Mitchell2006-12-041-16/+30
| | | p4raw-id: //depot/perl@29455
* Avoid an error that VC++'s resource compiler seems to haveSteve Hay2006-07-171-2/+0
| | | | | | | | with a reference to "perly.y" in "perly.h" See the thread here for details: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-07/msg00460.html p4raw-id: //depot/perl@28593
* Add the MAD change to perly.y, which brings a new PEG token.Nicholas Clark2006-03-091-2/+7
| | | p4raw-id: //depot/perl@27437
* latest switch/say/~~Robin Houston2005-12-191-83/+89
| | | | | Message-Id: <20051217204431.GB28940@rpc142.cs.man.ac.uk> p4raw-id: //depot/perl@26400
* The new REQUIRE token introduced by change 25599 must beRafael Garcia-Suarez2005-10-131-6/+7
| | | | | | | nonassoc, just like the UNIOP token it's patterned after. (While we're at it, allow to use bison 2.1 to regenerate the parser files.) p4raw-id: //depot/perl@25746
* CORE::require was always parsed as require().Rafael Garcia-Suarez2005-09-261-45/+47
| | | | | | | | | | | That's because require() isn't overridable at tokenizer-level like other overridable built-ins, but is handled by the optree builder. So, find a way to pass the information that require() was written as CORE::require() to Perl_ck_require. This is done by adding a new token type REQUIRE and by adding OPf_SPECIAL to OP_REQUIRE when it's saw as CORE::require in the program text. This fixes bug [perl #37274] The "CORE" in CORE::require is ignored. p4raw-id: //depot/perl@25599
* Allow non-arrowed form of chained subscripts after slicesYitzchak Scott-Thoennes2005-09-131-3/+3
| | | | | | | | | | Subject: Re: [perl #37039] perlref documentation about optional -> is too vague Date: Thu, 1 Sep 2005 17:41:36 -0700 Message-ID: <20050902004136.GA2656@efn.org> Date: Mon, 5 Sep 2005 08:10:20 -0700 Message-ID: <20050905151020.GA3556@efn.org> p4raw-id: //depot/perl@25399
* while (my $x ...) { ...; redo } shouldn't undef $x.Dave Mitchell2005-05-071-3/+3
| | | | | | | In the presence of 'my' in the conditional of a while(), until(), or for(;;) loop, add an extra scope to the body so that redo doesn't undef the lexical p4raw-id: //depot/perl@24412
* [perl #34101] not() || 1 produces segmentation faultMarcus Holland-Moritz2005-02-101-4/+4
| | | | | | Fixed by making not() behave like not(0). This is also the way not() behaved before it started segfaulting in 5.6.0. p4raw-id: //depot/perl@23960
* Add comment to the top of most .c files explaining their purposeDave Mitchell2004-07-311-1/+1
| | | p4raw-id: //depot/perl@23176
* Switch from byacc to bison and simplify the perly.* regenerationDave Mitchell2004-02-141-61/+173
| | | | | process p4raw-id: //depot/perl@22302
* Defined-or patch (cleaned up)Brent Dax2002-08-051-17/+19
| | | | | | From: "Brent Dax" <brentdax@cpan.org> Message-id: <000001c234a1$d1ca72c0$6501a8c0@deepblue> p4raw-id: //depot/perl@17682
* sub : attrlistSpider Boardman1999-08-291-19/+21
| | | | | | To: Mailing list Perl5 <perl5-porters@perl.org> Message-Id: <199908290702.DAA32191@Orb.Nashua.NH.US> p4raw-id: //depot/cfgperl@4043
* allow arrow omission in $foo[10]->('foo') etc. (but not inStephen McCamant1999-07-261-18/+19
| | | | | | | foo()->()); rework grammar to remove conflicts Message-ID: <14232.54970.771570.548676@alias-2.pr.mcs.net> Subject: [PATCH _57, long] Re: optional arrow asymmetry p4raw-id: //depot/perl@3767