summaryrefslogtreecommitdiff
path: root/perly.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace common Emacs file-local variables with dir-localsDagfinn Ilmari Mannsåker2015-03-221-6/+0
| | | | | | | | | | | | | | | | An empty cpan/.dir-locals.el stops Emacs using the core defaults for code imported from CPAN. Committer's work: To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed to be incremented in many files, including throughout dist/PathTools. perldelta entry for module updates. Add two Emacs control files to MANIFEST; re-sort MANIFEST. For: RT #124119.
* perly.c: Emit nl after ‘Reading a token’Father Chrysostomos2015-01-071-1/+1
| | | | This makes the -DTp output easier to read.
* perly.c: Fix EBCDIC bugKarl Williamson2014-12-091-10/+10
| | | | | | | The code was changing the value in a structure on EBCDIC platforms. It turns out that that structure element is used later under quite limited circumstances. The changed value is actually only needed during an array look-up, so we no longer store the change.
* perly.c: Fix off-by-1 error for EBCDIC platformsKarl Williamson2014-12-031-2/+2
| | | | | | Code point 255 was being omitted in the translation. It's better to use the macro (that has it correctly) and avoid a redundant copy of the test.
* Remove or downgrade unnecessary dVAR.Jarkko Hietaniemi2014-06-251-1/+0
| | | | | | | | 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.
* Remove MAD.Jarkko Hietaniemi2014-06-131-42/+0
| | | | | | MAD = Misc Attribute Decoration; unmaintained attempt at preserving the Perl parse tree more faithfully so that automatic conversion to Perl 6 would have been easier.
* Silence several -Wunused-parameter warnings about my_perlBrian Fraser2014-06-131-0/+1
| | | | | | | | This meant sprinkling some PERL_UNUSED_CONTEXT invocations, as well as stopping some functions from getting my_perl in the first place; all of the functions in the latter category are internal (S_ prefix and s or i in embed.fnc), so this should be both safe and economical.
* subroutine signaturesZefram2014-02-011-0/+1
| | | | | | | | | | Declarative syntax to unwrap argument list into lexical variables. "sub foo ($a,$b) {...}" checks number of arguments and puts the arguments into lexical variables. Signatures are not equivalent to the existing idiom of "sub foo { my($a,$b) = @_; ... }". Signatures are only available by enabling a non-default feature, and generate warnings about being experimental. The syntactic clash with prototypes is managed by disabling the short prototype syntax when signatures are enabled.
* Remove support for "do SUBROUTINE(LIST)"Dagfinn Ilmari Mannsåker2013-12-221-3/+0
| | | | | It's been deprecated (and emitting a warning) since Perl v5.0.0, and support for it consitutes nearly 3% of the grammar.
* Remove EBCDIC remappingsKarl Williamson2013-08-291-1/+4
| | | | | | | | Now that the Unicode tables are stored in native format, we shouldn't be doing remapping. Note that this assumes that the Latin1 casing tables are stored in native order; not all of this has been done yet.
* pad.c: Use &PL_sv_no for const pad namesFather Chrysostomos2013-07-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently &PL_sv_undef as a pad name can indicate either a free slot available for use by pad_alloc or a slot used by an op target (or, under ithreads, a constant or GV). Currently pad_alloc distinguishes between free slots and unnamed slots based on whether the value in the pad has PADMY or PADTMP set. If neither is set, then the slot is free. If either is set, the slot is in use. This makes it rather difficult to distinguish between constants stored in the pad (under ithreads) and targets. The latter need to be copied when referenced, to give the impression that a new scalar is being returned by an operator each time. (So \"$a" has to return a refer- ence to a new scalar each time, but \1 should return the same one.) Also, constants are shared between recursion levels. Currently, if the value is marked READONLY or is a shared hash key scalar, it is shared. But targets can also me shared hash keys, resulting in bugs. It also makes it impossible for the same constant to be shared by mul- tiple pad slots, as freeing one const op will turn off the PADTMP flag while the other slot still uses it, making the latter appear to be free. Hence a lot of copying occurs under ithreads. (Actually, that may not be true any more since 3b1c21fabed, as freed const ops swipe their constants from the pad. But right now, a lot of copying does still happen.) Also, XS modules may want to create const ops that return the same mutable SV each time. That is currently not possible without various workarounds including custom ops and references. (See <https://rt.perl.org/rt3/Ticket/Display.html?id=105906#txn-1075354>.) This commit changes pad_alloc and pad_free to use &PL_sv_no for con- stants and updates other code to keep all tests passing. Subsequent commits will actually use that information to fix bugs. This will probably break PadWalker, but I think it is an acceptable trade-off. The alternative would be to make PadnamePV forever more complex than necessary, by giving it a special case for &PL_sv_no and having it return NULL. I gave PadnameLEN a special case for &PL_sv_undef, so it may appear that I have simply shifted the complexity around. But if pad names stop being SVs, then this exception will simply disappear, since the global &PL_padname_undef will have 0 in its length field.
* perly.c: Disarm the YYDEBUG defines in perly.hFather Chrysostomos2012-10-011-7/+9
| | | | | | | | See <craigberry-E9C729.16313730092012@cpc2-bmly6-0-0-cust974.2-3.cable.virginmedia.com>. Move the YYDEBUG defines in perly.c back where they were before, but undefine YYDEBUG first. That leaves bison 2.6’s YYDEBUG defines in perly.h harmless.
* Restore perly.o build with -DDEBUGGINGFather Chrysostomos2012-09-251-4/+9
|
* Prevent assertion failure with ‘no a a 3’Father Chrysostomos2012-09-141-2/+0
| | | | | | | | | | | | | | | This particular syntax error, whittled down from ‘no if $] >= 5.17.4 warnings => "deprecated"’ (which contains a type), causes the parser to try to free an op from the new sub (for the BEGIN block) after freeing the new sub. This happens on line 526 of perly.c. It should not be necessary for the parser to free the op at this point, since after an error any ops owned by incomplete subs’ slabs will be freed. I’m leaving the other three instances of op_free in perly.c in place, at least for now, since there are cases where the forced token stack prevents ops from being freed when their subs are.
* Omnibus removal of register declarationsKarl Williamson2012-08-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes most register declarations in C code (and accompanying documentation) in the Perl core. Retained are those in the ext directory, Configure, and those that are associated with assembly language. See: http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c which says, in part: There is no good example of register usage when using modern compilers (read: last 10+ years) because it almost never does any good and can do some bad. When you use register, you are telling the compiler "I know how to optimize my code better than you do" which is almost never the case. One of three things can happen when you use register: The compiler ignores it, this is most likely. In this case the only harm is that you cannot take the address of the variable in the code. The compiler honors your request and as a result the code runs slower. The compiler honors your request and the code runs faster, this is the least likely scenario. Even if one compiler produces better code when you use register, there is no reason to believe another will do the same. If you have some critical code that the compiler is not optimizing well enough your best bet is probably to use assembler for that part anyway but of course do the appropriate profiling to verify the generated code is really a problem first.
* Remove op_latefree(d)Father Chrysostomos2012-07-141-110/+1
| | | | | | | This was an early attempt to fix leaking of ops after syntax errors, disabled because it was deemed to fragile. The new slab allocator (8be227a) has solved this problem another way, so latefree(d) no longer serves any purpose.
* update the editor hints for spaces, not tabsRicardo Signes2012-05-291-2/+2
| | | | | This updates the editor hints in our files for Emacs and vim to request that tabs be inserted as spaces.
* Label UTF8 cleanupBrian Fraser2012-03-251-5/+0
| | | | | This meant changing LABEL's definition in perly.y, so most of this commit is actually from the regened files.
* Bump several file copyright datesSteffen Schwigon2012-01-191-1/+2
| | | | | | | 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]
* Fix typos (spelling errors) in Perl sources.Peter J. Acklam) (via RT2011-01-071-1/+1
| | | | | | | | | # New Ticket Created by (Peter J. Acklam) # Please include the string: [perl #81904] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81904 > Signed-off-by: Abigail <abigail@abigail.be>
* function interface to parse Perl statementZefram2010-09-061-6/+26
| | | | | | | | | | | | | yyparse() becomes reentrant. The yacc stack and related resources are allocated in yyparse(), rather than in lex_start(), and they are localised to yyparse(), preserving their values from any outer parser. yyparse() now takes a parameter which determines which production it will parse at the top level. New API function parse_fullstmt() uses this facility to parse just a single statement. The top-level single-statement production that is used for this then messes with the parser's head so that the parsing stops without seeing EOF, and any lookahead token seen after the statement is pushed back to the lexer.
* When discarding a token free the op associated with itGerard Goossen2009-12-181-0/+2
| | | | | | | | | | | | | | | | | | | | When discarding a token free the op associated with it. Fixes memory leak in comp/parser.t Gerard Goossen From 7694ec023ec8856f34964b5eeea58f1b588c89bc Mon Sep 17 00:00:00 2001 From: Gerard Goossen <gerard@ggoossen.net> Date: Fri, 18 Dec 2009 18:32:11 +0100 Subject: [PATCH 4/4] When discarding a token free the op associated with it. Status: O Content-Length: 438 Lines: 20 Fixes memory leak in comp/parser.t Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
* Fix casting warningsRafael Garcia-Suarez2009-12-161-3/+3
|
* Store the PL_compcv instead of the the PL_comppad in parser stack, and make ↵Gerard Goossen2009-12-161-14/+28
| | | | it reference counted. Properly solves [perl #66094]
* Update copyright years.Nicholas Clark2008-10-251-1/+1
| | | p4raw-id: //depot/perl@34585
* Silence Borland compiler warnings (except for warnings from zlib) here:Steve Hay2008-02-251-1/+1
| | | | | http://www.nntp.perl.org/group/perl.daily-build.reports/2008/02/msg53937.html p4raw-id: //depot/perl@33370
* [perl #43425] local $[: fix scoping during parser error handling.Dave Mitchell2007-07-161-0/+7
| | | | | | | | | 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
* Make parser_free() be called slightly later,Dave Mitchell2007-04-011-17/+3
| | | | | | i.e. at the point where lexer vars are being restored in a LEAVE, rather than at the end of yyparse() p4raw-id: //depot/perl@30822
* disable parser stack cleanup on reduce croak (too fragile)Dave Mitchell2007-01-181-1/+17
| | | p4raw-id: //depot/perl@29866
* silence a warning in perly.cDave Mitchell2007-01-071-1/+1
| | | p4raw-id: //depot/perl@29706
* Silence various VC6 warningsSteve Hay2007-01-051-1/+1
| | | p4raw-id: //depot/perl@29692
* make parser_free actually free the parser!Dave Mitchell2007-01-041-0/+3
| | | | | also remove two SAVEs left over from #29655 p4raw-id: //depot/perl@29680
* handle cloning of parsers on the save stackDave Mitchell2007-01-031-1/+1
| | | p4raw-id: //depot/perl@29678
* Update copyright years to include 2007. (Plus a couple of 2006s andNicholas Clark2007-01-021-1/+1
| | | | | earlier we missed in av.h and hv.h) p4raw-id: //depot/perl@29670
* fix -Mad build breakageDave Mitchell2007-01-021-1/+2
| | | p4raw-id: //depot/perl@29667
* move easy lexer state variables into PL_parserDave Mitchell2007-01-021-1/+1
| | | | | (where "easy" == "only appear in toke.c") p4raw-id: //depot/perl@29655
* split parser initialisation from parser executionDave Mitchell2007-01-011-21/+6
| | | p4raw-id: //depot/perl@29652
* split parser stack from parser objectDave Mitchell2007-01-011-30/+29
| | | p4raw-id: //depot/perl@29649
* smoke signs suppressionJarkko Hietaniemi2006-12-311-1/+1
| | | | | Message-ID: <4597C078.4000503@iki.fi> p4raw-id: //depot/perl@29645
* further fix for #29543: fix parser leaks caused by croakingDave Mitchell2006-12-291-16/+39
| | | p4raw-id: //depot/perl@29636
* make -Dpv print 8 parser stack items, not 9Dave Mitchell2006-12-191-1/+1
| | | p4raw-id: //depot/perl@29589
* move parser state into new parser object, PL_parserDave Mitchell2006-12-181-70/+36
| | | p4raw-id: //depot/perl@29570
* merge the four parser stacks into oneDave Mitchell2006-12-171-247/+145
| | | p4raw-id: //depot/perl@29569
* delete dead code and macros from perly.cDave Mitchell2006-12-171-129/+3
| | | p4raw-id: //depot/perl@29568
* unify stacks arithmetic in parserDave Mitchell2006-12-171-16/+12
| | | p4raw-id: //depot/perl@29567
* fix a cast warning in perly.cDave Mitchell2006-12-161-1/+1
| | | p4raw-id: //depot/perl@29560
* make -Dpv display the parser stack before reductionDave Mitchell2006-12-131-11/+1
| | | | | (rather than afterwards) p4raw-id: //depot/perl@29549
* fix parser leaks caused by croaking while shifting or reducingDave Mitchell2006-12-131-16/+102
| | | | | | | e.g. these no longer leak: eval q[my $x; local $x] while 1; eval q[$s = sub <> {}] while 1; p4raw-id: //depot/perl@29543
* remove extraneous debugging code introduced by #29504Dave Mitchell2006-12-111-34/+0
| | | p4raw-id: //depot/perl@29508
* fix eval qw(BEGIN{die}) style leaks (second attempt).Dave Mitchell2006-12-111-22/+129
| | | | | | | | | | | | 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