Re: [perl #33892] Add Interix support
[p5sagit/p5-mst-13.2.git] / perly.y
diff --git a/perly.y b/perly.y
index f4a8344..11c1bd3 100644 (file)
--- a/perly.y
+++ b/perly.y
  * All that is gold does not glitter, not all those who wander are lost.'
  */
 
+/* This file holds the grammar for the Perl language. If edited, you need
+ * to run regen_perly.pl, which re-creates the files perly.h, perly.tab
+ * and perly.act which are derived from this.
+ *
+ * The main job of of this grammar is to call the various newFOO()
+ * functions in op.c to build a syntax tree of OP structs.
+ * It relies on the lexer in toke.c to do the tokenizing.
+ */
+
 /*  Make the parser re-entrant. */
 
 %pure_parser
@@ -648,7 +657,7 @@ term        :       termbinop
                        { $$ = newUNOP(OP_NOT, 0, scalar($2)); }
        |       UNIOP                                /* Unary op, $_ implied */
                        { $$ = newOP($1, 0); }
-       |       UNIOP block                          /* eval { foo }, I *think* */
+       |       UNIOP block                          /* eval { foo } */
                        { $$ = newUNOP($1, 0, $2); }
        |       UNIOP term                           /* Unary op */
                        { $$ = newUNOP($1, 0, $2); }
@@ -666,10 +675,8 @@ term       :       termbinop
                        { $$ = newOP($1, OPf_SPECIAL); }
        |       FUNC1 '(' expr ')'                   /* not($foo) */
                        { $$ = newUNOP($1, 0, $3); }
-       |       PMFUNC '(' term ')'                  /* split (/foo/) */
-                       { $$ = pmruntime($1, $3, Nullop); }
-       |       PMFUNC '(' term ',' term ')'         /* split (/foo/,$bar) */
-                       { $$ = pmruntime($1, $3, $5); }
+       |       PMFUNC '(' argexpr ')'           /* m//, s///, tr/// */
+                       { $$ = pmruntime($1, $3, 1); }
        |       WORD
        |       listop
        ;