summaryrefslogtreecommitdiff
path: root/perly.act
Commit message (Collapse)AuthorAgeFilesLines
* make qw(...) first-class syntaxZefram2010-09-081-292/+320
| | | | | | | | | | 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-394/+422
|
* remove dead listexprcom production from grammarZefram2010-08-311-35/+21
| | | | | The third production of <listexprcom>, "expr ','", could never be invoked, because <expr> can already end with arbitrarily many commas.
* fix MAD handling of package block syntaxZefram2010-05-231-185/+184
| | | | | | There was a broken TOKEN_GETMAD attempting to handle the label preceding a package-block statement, where no label is actually possible. The correct behaviour for no label is a no-op, so just remove the TOKEN_GETMAD.
* fix SEGV with eval("package Foo {")Zefram2010-05-201-124/+134
| | | | | | OPs relating to the package name and version were subject to double freeing during error recovery from an incomplete package block. Fixed by using the op_latefree mechanism to shift the op free time.
* support "package Foo { ... }"Zefram2010-05-201-357/+388
| | | | | | 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-3/+0
| | | | | | VERSION;" statements Fixes [perl #72432]
* regen_perly prepping for 5.11.4Ricardo Signes2010-01-191-0/+3
|
* [perl #22977] Bug in format/writeZefram2009-12-151-140/+146
|
* make regen_perly following 5ca68648d92617d8.Nicholas Clark2009-12-011-3/+3
|
* Add length and flags arguments to Perl_allocmy().Nicholas Clark2009-11-091-1/+1
| | | | | | Currently no flags bits are used, and the length is cross-checked against strlen() on the pointer, but the intent is to re-work the entire pad API to be UTF-8 aware, from the current situation of char * pointers only.
* regen generated files changed by the previous patch - facility to plug in ↵Jesse Vincent2009-11-051-368/+373
| | | | syntax triggered by keywords
* make regen; make regen_perlyJesse Vincent2009-10-201-3/+0
|
* Restore MAD handling of package statementsRafael Garcia-Suarez2009-10-081-125/+132
| | | | | Since the version seems unused by MAD in "use", do the same for "package"...
* Add 'package NAME VERSION' syntaxDavid Golden2009-10-061-129/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+0
| | | | | | | 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.
* Fix building MAD with C++ - a MAD_PV of "" is illegal, as it will be free()d.Nicholas Clark2009-09-241-1/+1
|
* Make MAD understand the "..." operatorRafael Garcia-Suarez2009-08-261-23/+27
|
* Allow when to be used as a statement modifierVincent Pit2009-03-281-363/+365
|
* Add ..., !!!, and ??? operatorschromatic2008-05-181-44/+52
| | | | | Message-Id: <200805101252.11961.chromatic@wgz.org> p4raw-id: //depot/perl@33858
* Fix the line-number-in-elsif longstanding bug.Rafael Garcia-Suarez2008-04-181-1/+1
| | | | | | | | | | This patch does two things : - newSTATEOP now nullifies the state op it just created if OPf_SPECIAL is passed to it in flags - the parser now inserts a nullified stateop in the expression block of an elsif p4raw-id: //depot/perl@33710
* Eliminate use of Nullop in the core code. Dual life uses remain.Nicholas Clark2008-02-101-32/+32
| | | p4raw-id: //depot/perl@33269
* Remove remaining C<Nullch>s and C<Nullsv>sNicholas Clark2007-10-061-3/+3
| | | p4raw-id: //depot/perl@32054
* [perl #43425] local $[: fix scoping during parser error handling.Dave Mitchell2007-07-161-359/+355
| | | | | | | | | Change 22306# inadvertently made 'local $[' statement-scoped rather than block-scoped; so revert that change and add a different fix. The problem was to ensure that the savestack got popped correctly while popping errored tokens. We how record the current value of PL_savestack_ix with each pushed parser state. p4raw-id: //depot/perl@31615
* fix some (mostly MAD) compiler warningsDave Mitchell2007-05-131-150/+152
| | | p4raw-id: //depot/perl@31209
* Give the 'local' declarator a new key, such that 'local our'Gerard Goossen2007-05-121-1/+1
| | | | | | | | declaration don't have multiple 'd' keys. Subject: [PATCH] mad: different key for the locale declarator Message-Id: <20070508171125.GI17043@ostwald> p4raw-id: //depot/perl@31208
* move PL_in_my and PL_in_my_stash into the PL_parser structDave Mitchell2007-05-121-1/+1
| | | p4raw-id: //depot/perl@31203
* move PL_rsfp_filters into the parser structDave Mitchell2007-05-121-120/+121
| | | p4raw-id: //depot/perl@31200
* move PL_expect and PL_copline into the PL_parser structureDave Mitchell2007-05-041-21/+21
| | | p4raw-id: //depot/perl@31134
* Silence the g++ warnings "right-hand operand of comma has no effect"Nicholas Clark2007-04-101-6/+6
| | | p4raw-id: //depot/perl@30900
* fix MAD compilation of C-style for loopGerard Goossen2007-03-221-1/+1
| | | | | | Subject: [PATCH] MAD C-style for loop Message-Id: <20070321181852.GD31539@ostwald> p4raw-id: //depot/perl@30676
* Patch by Gerard Goossen to add madprops to "require" opcodeRafael Garcia-Suarez2007-03-151-34/+38
| | | p4raw-id: //depot/perl@30599
* Fix leaks in label strings allocation in COPsRafael Garcia-Suarez2006-12-201-160/+158
| | | p4raw-id: //depot/perl@29601
* merge the four parser stacks into oneDave Mitchell2006-12-171-468/+468
| | | p4raw-id: //depot/perl@29569
* misc MAD coredump fixes and parser leak fixesDave Mitchell2006-12-131-202/+201
| | | | | | | | | - fix MAD coredump in tr/// - fix mad coredump in multi-line string literals - kill some MAD uninit value warnings - don't allow assignment to $n in perly.y - make op_dump handle op_latefree flags p4raw-id: //depot/perl@29548
* fixup some ival/opval type changes from perly.y/madly.y mergerDave Mitchell2006-12-131-138/+142
| | | p4raw-id: //depot/perl@29542
* fix eval qw(BEGIN{die}) style leaks (second attempt).Dave Mitchell2006-12-111-356/+351
| | | | | | | | | | | | 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-351/+356
| | | | | | 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-194/+194
| | | | | | 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-462/+462
| | | p4raw-id: //depot/perl@29461
* merge perly.y and madlu.yDave Mitchell2006-12-041-499/+992
| | | p4raw-id: //depot/perl@29455
* Parsing fix: it wasn't possible to call a function with a (_) prototypeRafael Garcia-Suarez2006-11-131-47/+52
| | | | | | (that is, a function mimicing an unary op) without parentheses. Bug reported by Ævar Arnfjörð Bjarmason. p4raw-id: //depot/perl@29258
* stab at UNITCHECK blocksAlexander Gough2006-10-191-130/+131
| | | | | Message-ID: <20061019120412.GA12290@the.earth.li> p4raw-id: //depot/perl@29053
* stop eval "sub{" leakingDave Mitchell2006-05-261-146/+155
| | | p4raw-id: //depot/perl@28314
* Add the MAD change to perly.y, which brings a new PEG token.Nicholas Clark2006-03-091-191/+191
| | | p4raw-id: //depot/perl@27437
* latest switch/say/~~Robin Houston2005-12-191-366/+401
| | | | | 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-185/+186
| | | | | | | 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
* Fix the overriding of CORE::do, just like change 25599Rafael Garcia-Suarez2005-09-271-1/+1
| | | | | was fixing the overriding of CORE::require p4raw-id: //depot/perl@25616
* CORE::require was always parsed as require().Rafael Garcia-Suarez2005-09-261-52/+62
| | | | | | | | | | | 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
* Remove the last STRLEN n_a;s that my compiler can reach.Nicholas Clark2005-09-211-1/+1
| | | p4raw-id: //depot/perl@25530