summaryrefslogtreecommitdiff
path: root/op.c
Commit message (Collapse)AuthorAgeFilesLines
* implement OP_IS_NUMCOMPARE like other OP_IS macrosJim Cromie2011-09-091-8/+0
| | | | | | | other macros are written by regen/opcode.pl into opnames.h Generate OP_IS_NUMCOMPARE the same way, and get a micro-optimization. Adds a new 'S<' operand type for the numeric comparison ops. Needs make regen.
* remove index offsetting ($[)Zefram2011-09-091-48/+1
| | | | | | $[ remains as a variable. It no longer has compile-time magic. At runtime, it always reads as zero, accepts a write of zero, but dies on writing any other value.
* remove unused variables and assignmentsRobin Barker2011-09-081-2/+1
| | | | | | and silences some compiler warnings. I do not understand the code in toke.c but the change aligns the code with other uses of FUN0OP, it has no warnings and does not break any test.
* S_op_integerize() needs a dVAR, else -DPERL_GLOBAL_STRUCT doesn't build.Nicholas Clark2011-09-061-0/+1
|
* Move non-constant folding parts of fold_constants into a separate functions.Gerard Goossen2011-09-051-22/+42
| | | | | | | | | | The non-constant folding parts of fold_constants are moved into separate functions. op_integerize handles converting ops to integer (and special case of OP_NEGATE), op_std_init handling some standard functionality (forced scalar context and allocating the TARGET). Both functions are called where fold_constants is called (but we might want to make that a bit some selective and use op_std_init in other places).
* Use OPpDEREF for lvalue sub, such that the flags contains the deref type, ↵Gerard Goossen2011-09-011-1/+3
| | | | | | | instead of deriving it from the opchain. Also contains a test where using the opchain to determine the deref type fails.
* &CORE::substr()Father Chrysostomos2011-08-271-1/+5
| | | | | | | | | | | | | | | | | | This commit makes &CORE::substr callable through references and via &ampersand syntax. It’s a bit awkward, as we need a substr op that is flagged as hav- ing 4 arguments *and* possibly returning an lvalue. The code in op_lvalue_flags wasn’t really set up for that, so I needed to flag the op with OPpMAYBE_LVSUB in coresub_op before it gets passed to op_lvalue_flags. It turned out that only that was necessary, as op_lvalue_flags does an op_private == 4 check (rather than (op_private & 7) == 4 or some such) when checking for the 4-arg case and croak- ing. When the op arrives in op_lvalue_flags, it’s already flagged OPpMAYBE_LVSUB|4 which != 4. pp_substr is also modified to check for nulls and, if necessary, adjust its count of how many arguments were actually passed.)
* &CORE::select()Father Chrysostomos2011-08-271-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit allows CORE::select to be called through references and via &ampersand syntax. This is a tricky case, as the select keyword represents two distinct operators. ck_select replaces the OP_SELECT with an OP_SSELECT if there is more that one argument. So what we do here is create an if(@_>1)/else block with the usual op-with-coreargs-child inside each branch. The op tree looks like this: $ ./perl -Ilib -mO=Concise,CORE::select -e 'BEGIN{\&CORE::select} ' CORE::select: 8 <1> leavesub[1 ref] K/REFC,1 ->(end) - <1> null K/1 ->8 5 <|> cond_expr(other->6) K/1 ->9 4 <2> gt sK/2 ->5 2 <1> rv2av[t4] sK/1 ->3 1 <#> gv[*_] s ->2 3 <$> const[IV 1] s ->4 7 <@> sselect[t2] K ->8 - <0> ex-pushmark s ->6 6 <$> coreargs(IV 218) ->7 a <@> select[t1] sK/1 ->8 - <0> ex-pushmark s ->9 9 <$> coreargs(IV 219) s/DREF1 ->a -e syntax OK There was no need to modify pp_select to handle a null when there is no argument, as it can already handle it.
* &CORE::foo() for (sys)read and recvFather Chrysostomos2011-08-261-0/+2
| | | | | | | | | | | | | | These are grouped together because they all have \$ in their prototypes. This commit allows the subs in the CORE package under those names to be called through references and via &ampersand syntax. The coreargs op in the subroutine is marked with the OPpSCALARMOD flag. (scalar_mod_type in op.c returns true for these three ops, indicating that the OA_SCALARREF parameter is \$, not \[$@%(&)*].) pp_coreargs uses that flag to decide what arguments to reject.
* &CORE::foo() for @ and $@ prototypes, except unlinkFather Chrysostomos2011-08-251-0/+7
| | | | | | | | | | | | | | This commit allows the CORE subroutines for functions with @ and $@ prototypes to be called through references and via amper- sand syntax. unlink is not included in this commit, as it requires special casing due to its use of implicit $_. Since these functions require a pushmark, and since it has to come between two things that pp_coreargs does, it’s easiest to flag the coreargs op (with the OPpCOREARGS_PUSHMARK flag added in the previous commit) and call pp_pushmark directly from pp_coreargs.
* &CORE::caller()Father Chrysostomos2011-08-251-1/+4
| | | | | | | | | | | | | | This commit allows &CORE::caller to be called through references and via ampersand syntax. pp_caller is modified to take into account two things: 1) pp_coreargs pushes a null on to the stack, since it has no other way to tell caller whether it has an argument. 2) The value coming from pp_coreargs (when not null) is off by one. The OPpOFFYBONE flag was added in commit 93f0bc4935 for this purpose. pp_coreargs is also modified, since it assumed till now that an optional first argument was an implicit $_.
* &CORE::binmode()Father Chrysostomos2011-08-251-1/+10
| | | | | | | | This commit allows &CORE::binmode to be called through references and via ampersand syntax. Usually, an op that has optional arguments has the number of arguments indicated with flags on the op itself:
* Allow ampersand calls for CORE subs with $*$$**$ protosFather Chrysostomos2011-08-251-2/+10
| | | | | | | | | | | | | | | | | | | | This enables ampersand calls and calls through references for CORE subs that have * and $ in their prototypes and a fixed number of arguments. Usually, the *-prototyped ops have their child ops wrapped in rv2gv’s (*{}) implicitly. The rv2gv op is sometimes flagged as an autoviv- ificatory op, such as the first argument to accept() or open(). S_is_handle_constructor contains the list of ops that turn on that flag. This commit makes the coreargs op use a couple of flags to serve the same purpose. pp_coreargs itself calls S_rv2gv (split out from pp_rv2gv recently for precisely this purpose) with arguments based on its own flags. Currently the autovivified glob gets a name like main::_GEN_0 instead of main::$a. I think we can live with that.
* Enable ampersand calls to CORE subs with $$$ prototypesFather Chrysostomos2011-08-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This applies to functions that just take plain scalar arguments, all of which are mandatory. Functions that take optional arguments are not supported yet. truncate() is not supported yet, either (its $$ prototype is not entirely veracious). This commit enables those functions to be called via &CORE::foo() syn- tax or through references. You can now encrypt a string like this: "string"->CORE::crypt($salt). Each function’s op tree is like this: $ ./perl -Ilib -MO=Concise,CORE::atan2 -e 'BEGIN{\&CORE::atan2}' CORE::atan2: 3 <1> leavesub[1 ref] K/REFC,1 ->(end) 2 <@> atan2[t1] sK ->3 - <0> ex-pushmark s ->1 1 <$> coreargs(IV 100) s ->2 -e syntax OK This commit adds code to ck_fun to skip the argument check if coresubs is present. Otherwise we get a ‘Not enough arguments for atan2’ error.
* Simplify the CORE::__FOO__ op-generation codeFather Chrysostomos2011-08-241-10/+3
| | | | | | | 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.
* Move coresub op-creation from gv.c to op.cFather Chrysostomos2011-08-241-0/+38
| | | | | | | | | | | | For functions that take handles as arguments, this code will need to call static functions in op.c, like is_handle_constructor. While we could make is_handle_constructor into a non-static function and call it from gv.c, that seems backwards, as it would result in a lot of op-manipulation code in the middle of gv.c. So this commit creates a new function in op.c, called coresub_op, which is only called from gv.c, from the &CORE::sub code.
* Move making inplace sort and reverse away from the peephole optimiser to ↵Gerard Goossen2011-08-241-111/+69
| | | | | | | | scalarvoid. Why: The in place assignment is not just an optimisation but has significant different behaviour and thus doesn't belong in the peephole optimiser. Also the optree changes are unified and simpler.
* Revert "Test CORE::break’s prototype"Father Chrysostomos2011-08-241-69/+111
| | | | | | | | | This reverts commit e52d58aa5bea245b66786b4c9029e849a2be69d3. I don’t quite know how I managed it, but I really screw up this time! Two completely unrelated commits ended up getting merged into one, so, to avoid confusion down the road, I’m reverting it, only to reapply it shortly....
* Test CORE::break’s prototypeFather Chrysostomos2011-08-241-111/+69
|
* [perl #97088] Prevent double get-magic in various casesGerard Goossen2011-08-241-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch prevents get-magic from executing twice during autovivifi- cation when the op doing the autovivification is not directly nested inside the dereferencing op. This can happen in cases like this: ${ (), $a } = 1; Previously (as of 5.13.something), the outer op was marked with the OPpDEREFed flag, which indicated that get-magic had already been called by the vivifying op (calling get-magic during vivification is inevitable): $ perl5.14.0 -MO=Concise -e '${ $a } = 1' 8 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 2 -e:1) v:{ ->3 7 <2> sassign vKS/2 ->8 3 <$> const[IV 1] s ->4 6 <1> rv2sv sKRM*/DREFed,1 ->7 <-- right here - <@> scope sK ->6 - <0> ex-nextstate v ->4 5 <1> rv2sv sKM/DREFSV,1 ->6 4 <#> gv[*a] s ->5 -e syntax OK But in the ${()...} example above, there is a list op in the way that prevents the flag from being set inside the peephole optimizer. It’s not even possible to set it correctly in all cases, as in this exam- ple, which would need it both set and not set depending on which branch of the ternary operator is executed: ${ $x ? delete $a[0] : $a[0] } = 1 Instead of setting the OPpDEREFed flag, we now make a non-magic copy of the SV in vivify_ref (the first time get-magic is executed).
* Make unlink with implicit $_ work once moreFather Chrysostomos2011-08-211-1/+1
| | | | | | | | | | | I broke this with commit ea5703f4. unlink is the only op that has the OA_DEFGV flag and no scalar or file arguments. Commit ea5703f4 changed the OA_DEFGV logic in ck_fun to generate a new $_ op for the first optional parameter, instead of just the first parameter, to avoid special-casing unpack. But lists are not marked with OA_OPTIONAL. So this commit changes it to check for list parame- ters as well.
* Refactor unpack’s newDEFSVOP logic; correct prototypeFather Chrysostomos2011-08-211-21/+13
| | | | | | | | | | | | | | | | | unpack is the only op that takes an implicit $_ for its second argu- ment. (For others it’s the first.) Instead of special-casing unpack with its own ck_ routine, we can sim- ply modify the logic in ck_fun to apply OA_DEFGV to the first optional argument, not just the first argument. Currently OA_DEFGV is not set in PL_opargs[OP_UNPACK], which means the automatically-generated prototype is ($;$), instead of ($_). This commit sets the flag on the op, changes it to use ck_fun directly, and updates ck_fun and the prototype-generation code accord- ingly. I couldn’t put this in multiple commits, as the changes are interdependent.
* [perl #96126] Allocate CvFILE more simplyFather Chrysostomos2011-08-171-40/+6
| | | | | | | | | | | | | | | | | | | See the thread starting at: http://www.nntp.perl.org/group/perl.perl5.porters/2011/07/msg175161.html Instead of assuming that only Perl subs have mallocked CvFILEs and only under threads, resulting in various hackery to borrow parts of the SvPVX buffer where that assumption proves wrong, we can simply add another flag (DYNFILE) to indicate whether CvFILE is mallocked, instead of trying to use the ISXSUB flag for two purposes. This simplifies the code greatly, eliminating bug #96126 in the pro- cess (which had to do with sv_dup not knowing about the hackery that this commit removes). I removed that comment from cv_ckproto_len about CONSTSUBs doubling up the buffer field, as it is no longer relevant. But I still left the code as it is, since it’s better to do an explicit length check.
* [perl #97076] Fix mad+threads bareword strict exemptionFather Chrysostomos2011-08-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported in the ticket this was broken by: commit eb796c7f1a47acbd996034731639c1bb76e31a19 Author: Gerard Goossen <gerard@ggoossen.net> Date: Tue Aug 9 20:35:06 2011 +0200 Move bareword checking from the peephole optimizer to finalize_optree. Fixes [perl #95998] The bareword checking is moved from the peephole optimizer to finalize_optree. newRANGE needs additional bareword checking because the constants may be optimized away by 'gen_constant_list'. The OPpCONST_STRICT flag is removed after giving an error about a bareword to prevent giving multiple errors about the same bareword. In some cases, like pipe(foo,bar), the bareword was subject to strict 'subs' even though it was meant to be exempt. A backtrace revealed that it happened in S_finalize_op when called recursively from this block: #if defined(PERL_MAD) && defined(USE_ITHREADS) { /* Make sure mad ops are also thread-safe */ MADPROP *mp = o->op_madprop; while (mp) { if (mp->mad_type == MAD_OP && mp->mad_vlen) { OP *prop_op = (OP *) mp->mad_val; /* We only need "Relocate sv to the pad for thread safety.", but this easiest way to make sure it traverses everything */ finalize_op(prop_op); } mp = mp->mad_next; } } #endif That comment about only needing to relocate the sv to the pad is telling. If that’s the only reason for the recursive call, then we don’t want that recursive call doing strict checking. So this commit simply turns off the strict flag, which should be safe, since S_no_bareword_allowed does the same thing itself.
* Remove OPpENTERSUB_NOMOD.Gerard Goossen2011-08-151-3/+0
| | | | | | OPpENTERSUB_NOMOD was always set in combination with OPf_WANT_VOID which is now used to not propagate the lvalue context, making OPpENTERSUB_NOMOD redundant.
* Propagate lvalue context only to children of list ops which are not in void ↵Gerard Goossen2011-08-151-1/+6
| | | | | | | | | | | context. Children list ops might be in void context because the list is in scalar context. A test that discarded elements in a list are not assigned lvalue context is added. Children of a list op might also be in void context because they are special entersub ops for attributes. This patch makes the OPpENTERSUB_NOMOD flag redundant.
* Give not and getprotobynumber listop prototypesFather Chrysostomos2011-08-151-0/+1
| | | | | They parse as list operators, but their prototypes imply unop precedence.
* Move checking of CV to GV assigned (OPpASSIGN_CV_TO_GV) from the peephole ↵Gerard Goossen2011-08-151-45/+41
| | | | optimizer to scalarvoid
* Make lock(&foo) syntax nominally lock the subroutineFather Chrysostomos2011-08-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 5.10, lock(&foo) was an error for non-lvalue subs. For lvalue subs, it passed &foo to the lockhook and return \&foo. In 5.12, lock(&foo) was still an error for non-lvalue subs. For lvalue subs, it would pass &foo to the lockhook and then either trip an assertion (-DDEBUGGING) or return &foo, resulting in inter- esting bugs. Commit f4df43b5e changed lock(&lvalue_sub) to call the sub and lock its return value. As Reini Urban pointed out in <CAHiT=DE5cVZbuCR3kb=Q5oCa18vo3jr5jZKmURHYha2PwF4pEQ@mail.gmail.com>, locking a subroutine does have its uses. Since lock(&foo) has never really worked anyway, we can still change this. So, for lvalue subs, this reverts back to the 5.10 behaviour. For non-lvalue subs, it now behaves the same way, the lvalue flag making no difference. Note that it still causes an error at run-time, if threads::shared is loaded, as its lockhook is conservative in what it accepts. But this change allows for future extensibility, unlike f4df43b5e. A note about the implementation: There are two pieces of code (at least) in op.c that convert an entersub op into an rv2cv, one in S_doref and the other in Perl_op_lvalue_flags. Originally (before f4df43b5e) it was S_doref that took care of that for OP_LOCK. But Perl_op_lvalue_flags is called first, so it would assume it was an assignment to a sub call and croak if there was no lvalue sub in the symbol table. This commit adds back the special case for OP_LOCK, but in Perl_op_lvalue_flags, not S_doref.
* Update core_prototype’s docsFather Chrysostomos2011-08-141-4/+2
|
* Move pp_-specific code out of core_prototypeFather Chrysostomos2011-08-141-10/+2
| | | | | | | | | | | | | | Commit b8c38f0a2a65 refactored pp_prototype by moving much of its code to a new function in op.c, called core_prototype. This served two purposes: (1) to allow the code to be simplified, which required the use of static functions in op.c, and (2) to allow the &CORE::subs feature to share the same code. But some code was moved to core_prototype which, in hindsight, did not need to be moved, such as the ‘Can’t find an opnumber’ message. This commit moves that code back to pp_prototype, resulting in a sim- pler (and possibly faster, at least for &CORE::subs) core_prototype.
* Change core_prototype to take a keyword numFather Chrysostomos2011-08-141-2/+1
| | | | | | | | | | | | | This refactoring requires the caller to provide the keyword number to core_prototype. Consequently, it speeds up the code in gv.c:gv_fetchpvn_flags by allowing it to avoid an extra call to keyword(). This takes the place of the len parameter, which is no longer used. It used to be used only as an argument to keyword(). Since the code that uses strEQ is only reached if the keyword has already been veri- fied by keyword(), the name simply cannot have embedded nulls, so len is not necessary.
* Add inlinable &CORE::functionsFather Chrysostomos2011-08-141-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit allows this to work: BEGIN { *entangle = \&CORE::tie }; entangle $foo, $package; And the entangle call gets inlined as a tie op, the resulting op tree being indistinguishable. These subs are not yet callable via &foo syntax or through a refer- ence. That will come later, except for some functions, like sort(), which will probably never support it. Almost all overridable functions are supported. These few are not: - infix operators - not and getprotobynumber (can’t get the precedence right yet; prototype problem) - dump Subsequent commits (hopefully!) will deal with those. How this works: gv_fetchpvn_flags is extended with hooks to create subs inside the CORE package. Those subs are XSUBs (whose C function dies with an error, for now at least) with a call checker that blows away the entersub op and replaces it with whatever op the sub represents. This is slightly inefficient right now, as gv_fetchpvn_flags calls keyword(), only to have core_prototype call it again. That will be fixed in a future refactoring.
* Make core_prototype provide the op number as wellFather Chrysostomos2011-08-141-11/+16
| | | | | | | Since it has to calculate it, it might as well provide it, so callers do not have to go through that while(i < MAXO) loop yet again. (The &CORE::foo feature will use this.)
* Remove select’s prototypeFather Chrysostomos2011-08-141-1/+1
| | | | | | | | | select has a prototype of (;*), which is incorrect, as it implied that it has high precedence. It also fails to account for the four-argu- ment form. While removing all incorrect prototypes is counterproduc- tive, I think this one is wrong enough it deserves to go. (And the precedence problem is a good argument against it, as there is cur- rently no other way to set precedence.)
* Change (l)stat’s prototype from * to ;*Father Chrysostomos2011-08-121-1/+3
| | | | | | | | | | | | | | Since the argument is optional, we need a semicolon. This commit accomplishes that by setting the OA_OPTIONAL flag for the appropriate entries in PL_opargs. This should not affect anything else, as ck_ftst (the check routine for [l]stat) doesn’t even look at PL_opargs. It also has to tweak the prototype-generation logic slightly, because PL_opargs also has OA_DEFGV set. I think this is insignificant enough not to warrant a delta entry.
* Revert "[perl #95550] Remove prototypes from (l)stat"Father Chrysostomos2011-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out this problem is more knotty than I initially realised. stat had a prototype of (*), even though it could be called with no arguments. Since the (*) prototype does not parse its argument the same way that stat parses *its* argument, I thought that changing (*) to (;*) would be no better, since it’s still not correct. So I simply set the prototype to undef. My thinking was faulty, for two reasons: • The prototype serves to indicate the precedence, not just the types of arguments. An undefined prototype on an overridable prefix func- tion implies that it takes a list. So this causes problems for the imminent &CORE::subs feature, as there is not yet a clean mechanism for CVs to parse their arguments. • The (*) prototype character does not parse the same way as *any* built-in function with that character in its prototype. So stat is no worse than any other built-in. It doesn’t make sense to remove the prototype from stat without removing it from about 40 other built-in functions; and that’s where pedantry conflicts with usefulness. This commit restores the (*) prototype to stat and lstat. The next commit will give it a (;*) prototype, as that matches it more closely. It’s not perfect, but it’s no worse that other built-ins with a * in their prototypes.
* Move bareword checking from the peephole optimizer to finalize_optree. Fixes ↵Gerard Goossen2011-08-111-6/+11
| | | | | | | | | | [perl #95998] The bareword checking is moved from the peephole optimizer to finalize_optree. newRANGE needs additional bareword checking because the constants may be optimized away by 'gen_constant_list'. The OPpCONST_STRICT flag is removed after giving an error about a bareword to prevent giving multiple errors about the same bareword.
* Move context propagation and finalize_optree from do_eval to newPROGGerard Goossen2011-08-111-0/+14
| | | | | | | | Aborting after errors found by finalize_optree in do_eval wasn't done properly and would cause memory problems. This patch moves the context propagation and finalize_optree to newPROG such that the normal error handling is done. The eval context blk_gimme is used to communicate the context.
* Make prototype("CORE::CORE") die once more.Father Chrysostomos2011-08-081-2/+2
| | | | | | | | | | Commit b8c38f0a2a65 accidentally made prototype("CORE::CORE") return undef instead of dying. This is the only case that reached the line with the ‘Should not happen...’ comment. This commit changes it to be handled earlier and also adds an asser- tion to make sure that unreachable code really is unreachable (which it should be now, I think, I hope...).
* Only warn about "Statement unlikely to be reached" after an exec if exec is ↵Gerard Goossen2011-08-081-4/+5
| | | | | | | | | a statement. Moving the OP_EXEC check to finalize_optree changed that it would also warn if 'exec' is part of an expression. This patch changes the behaviour to only warn if 'exec' is the whole statement, which appears to be the behaviour before moving the check to finalize_optree.
* Change aassign_common_vars to check using the optree without using the ↵Gerard Goossen2011-08-081-4/+8
| | | | | | | linked list. Besides no longer depending on the op chain this also solves a bug where the common vars where not detected because of logical operators.
* Move aassign common var detection to a separate function.Gerard Goossen2011-08-081-56/+68
|
* Remove comment from ck_glob that is no longer relevantFather Chrysostomos2011-08-061-1/+0
| | | | This code was made more failsafe by commit 4984aa345.
* Remove Perl_modFather Chrysostomos2011-08-021-8/+0
| | | | | | | After mod was renamed to op_lvalue, this stub was added temporarily to provide a smoother transition for the compilers. The compiler maintainer is happy with its extirpation at this stage. See ticket #78908.
* Call finalize_optree on optree generated by newFORM.Gerard Goossen2011-07-311-0/+1
| | | | | | finalize_optree should be called on all optrees, thus also on optrees generated by newFORM. I don't really understand why this doesn't cause any problems.
* Add finalize_optree function which can take over all the compile time ↵Gerard Goossen2011-07-281-214/+243
| | | | | | | | | | | | checking/finalization now being done by the peephole optimizer. This function takes the optree after it is finished building. It takes over some of the checking and final conversions which are currently being done by the peephole optimizer. Add the moment this is an unnecessary extra step after the peephole optimizer, but with a separate code generation step, the current peephole optimizer can't exists and this function will take over all its essential compile time functions.
* [perl #95550] Remove prototypes from (l)statFather Chrysostomos2011-07-261-2/+2
| | | | | These prototypes are not correct, and the parsing rules cannot be repre- sented by a prototype.
* core_prototype: Remove special cases for lock and tieFather Chrysostomos2011-07-261-6/+11
| | | | | | | | core_prototype now calls scalar_mod_type in the OA_SCALARREF case. For core functions, the only thing distinguishing the \$ and \[$@%*] cases during parsing is the call to scalar_mod_type in op_lvalue_flags. So calling this same function here just works.
* core_prototype: Eliminate the special mkdir caseFather Chrysostomos2011-07-261-5/+3
| | | | | | | | | | | The prototype-generation code just needed a little tweaking for this to work. It assumed that ‘;’ should not be emitted if PL_opargs[opnum] & OA_DEFGV, which is not necessarily the case. It only applies at the beginning of the prototype, hence the n check (where n is the character position in the protoytpe). It also changed the last $ to _ in the OA_DEFGV case, instead of the first. _ only comes at the beginning of a prototype (at least for core functions; ck_fun, incidentally, enforces this), but not necessarily at the end.