Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: master
...
compare: manual_args
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 11, 2012
@Whiteknight Whiteknight Add in a :manual_args flag to PIR, for testing de203dd
Commits on May 04, 2012
@Whiteknight Whiteknight Merge from master. Fix a conflict in IMCC with handling of automagic …
…'self'. Add some comments too, to explain the code after the merge
d7856f8
View
1  compilers/imcc/imcc.l
@@ -314,6 +314,7 @@ SP [ ]
<emit,INITIAL>":lex" return NEED_LEX;
<emit,INITIAL>":vtable" return VTABLE_METHOD;
<emit,INITIAL>":nsentry" return NS_ENTRY;
+<emit,INITIAL>":manual_args" return MANUAL_ARGS;
":instanceof" return SUB_INSTANCE_OF;
":subid" return SUBID;
View
3  compilers/imcc/imcc.y
@@ -1061,7 +1061,7 @@ do_loadlib(ARGMOD(imc_info_t *imcc), ARGIN(const char *lib))
%token <t> PCC_BEGIN_YIELD PCC_END_YIELD INVOCANT
%token <t> MAIN LOAD INIT IMMEDIATE POSTCOMP METHOD ANON OUTER NEED_LEX
%token <t> MULTI SUBTAG VTABLE_METHOD LOADLIB SUB_INSTANCE_OF SUBID
-%token <t> NS_ENTRY
+%token <t> NS_ENTRY MANUAL_ARGS
%token <s> LABEL
%token <t> EMIT EOM
%token <s> IREG NREG SREG PREG IDENTIFIER REG MACRO ENDM
@@ -1647,6 +1647,7 @@ proto:
| vtable
| method
| ns_entry_name
+ | MANUAL_ARGS { $$ = P_MANUAL_ARGS; }
| instanceof
| subid
;
View
2,376 compilers/imcc/imclexer.c
1,198 additions, 1,178 deletions not shown
View
2,923 compilers/imcc/imcparser.c
1,491 additions, 1,432 deletions not shown
View
98 compilers/imcc/imcparser.h
@@ -9,13 +9,11 @@
*/
/* HEADERIZER HFILE: none */
/* HEADERIZER STOP */
+/* A Bison parser, made by GNU Bison 2.5. */
-/* A Bison parser, made by GNU Bison 2.4.1. */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -144,27 +142,28 @@
SUB_INSTANCE_OF = 349,
SUBID = 350,
NS_ENTRY = 351,
- LABEL = 352,
- EMIT = 353,
- EOM = 354,
- IREG = 355,
- NREG = 356,
- SREG = 357,
- PREG = 358,
- IDENTIFIER = 359,
- REG = 360,
- MACRO = 361,
- ENDM = 362,
- STRINGC = 363,
- INTC = 364,
- FLOATC = 365,
- USTRINGC = 366,
- PARROT_OP = 367,
- VAR = 368,
- LINECOMMENT = 369,
- FILECOMMENT = 370,
- DOT = 371,
- CONCAT = 372
+ MANUAL_ARGS = 352,
+ LABEL = 353,
+ EMIT = 354,
+ EOM = 355,
+ IREG = 356,
+ NREG = 357,
+ SREG = 358,
+ PREG = 359,
+ IDENTIFIER = 360,
+ REG = 361,
+ MACRO = 362,
+ ENDM = 363,
+ STRINGC = 364,
+ INTC = 365,
+ FLOATC = 366,
+ USTRINGC = 367,
+ PARROT_OP = 368,
+ VAR = 369,
+ LINECOMMENT = 370,
+ FILECOMMENT = 371,
+ DOT = 372,
+ CONCAT = 373
};
#endif
/* Tokens. */
@@ -262,27 +261,28 @@
#define SUB_INSTANCE_OF 349
#define SUBID 350
#define NS_ENTRY 351
-#define LABEL 352
-#define EMIT 353
-#define EOM 354
-#define IREG 355
-#define NREG 356
-#define SREG 357
-#define PREG 358
-#define IDENTIFIER 359
-#define REG 360
-#define MACRO 361
-#define ENDM 362
-#define STRINGC 363
-#define INTC 364
-#define FLOATC 365
-#define USTRINGC 366
-#define PARROT_OP 367
-#define VAR 368
-#define LINECOMMENT 369
-#define FILECOMMENT 370
-#define DOT 371
-#define CONCAT 372
+#define MANUAL_ARGS 352
+#define LABEL 353
+#define EMIT 354
+#define EOM 355
+#define IREG 356
+#define NREG 357
+#define SREG 358
+#define PREG 359
+#define IDENTIFIER 360
+#define REG 361
+#define MACRO 362
+#define ENDM 363
+#define STRINGC 364
+#define INTC 365
+#define FLOATC 366
+#define USTRINGC 367
+#define PARROT_OP 368
+#define VAR 369
+#define LINECOMMENT 370
+#define FILECOMMENT 371
+#define DOT 372
+#define CONCAT 373
@@ -291,7 +291,7 @@
typedef union YYSTYPE
{
-/* Line 1676 of yacc.c */
+/* Line 2068 of yacc.c */
#line 1032 "compilers/imcc/imcc.y"
IdList * idlist;
@@ -302,7 +302,7 @@ typedef union YYSTYPE
-/* Line 1676 of yacc.c */
+/* Line 2068 of yacc.c */
#line 296 "compilers/imcc/imcparser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
View
5 compilers/imcc/pcc.c
@@ -391,7 +391,10 @@ expand_pcc_sub(ARGMOD(imc_info_t * imcc), ARGMOD(IMC_Unit *unit), ARGIN(Instruct
self->type = VTIDENTIFIER;
}
- if (sub->pcc_sub->nargs == 0 || STRNEQ(sub->pcc_sub->args[0]->name, "self"))
+ // Only add "self" to the list if...
+ if ((sub->pcc_sub->pragma & P_MANUAL_ARGS) == 0 || // we don't say no
+ sub->pcc_sub->nargs == 0 || // Don't need it
+ STRNEQ(sub->pcc_sub->args[0]->name, "self")) // It's explicit
unshift_self(imcc, sub, self);
}
View
23 compilers/imcc/symreg.h
@@ -85,17 +85,18 @@ struct namespace_t {
};
typedef enum {
- P_NONE = 0x00, /* 0<<0 */
- P_NEED_LEX = 0x01, /* 1<<0 */
- P_VTABLE = SUB_COMP_FLAG_VTABLE, /* 1<<1 0x2 */
- P_METHOD = SUB_COMP_FLAG_METHOD, /* 1<<2 0x4 */
- P_ANON = SUB_FLAG_PF_ANON, /* 1<<3 0x8 - private3 */
- P_MAIN = SUB_FLAG_PF_MAIN, /* 1<<4 0x10 - private4 */
- P_LOAD = SUB_FLAG_PF_LOAD, /* 1<<5 0x20 - private5 */
- P_IMMEDIATE = SUB_FLAG_PF_IMMEDIATE, /* 1<<6 0x40 - private6 */
- P_POSTCOMP = SUB_FLAG_PF_POSTCOMP, /* 1<<7 0x80 - private7 */
- P_INIT = SUB_COMP_FLAG_PF_INIT, /* 1<<10 0x400 - 10 */
- P_NSENTRY = SUB_COMP_FLAG_NSENTRY /* 1<<11 0x800 - 11 */
+ P_NONE = 0x00, /* 0<<0 */
+ P_NEED_LEX = 0x01, /* 1<<0 */
+ P_VTABLE = SUB_COMP_FLAG_VTABLE, /* 1<<1 0x2 */
+ P_METHOD = SUB_COMP_FLAG_METHOD, /* 1<<2 0x4 */
+ P_ANON = SUB_FLAG_PF_ANON, /* 1<<3 0x8 - private3 */
+ P_MAIN = SUB_FLAG_PF_MAIN, /* 1<<4 0x10 - private4 */
+ P_LOAD = SUB_FLAG_PF_LOAD, /* 1<<5 0x20 - private5 */
+ P_IMMEDIATE = SUB_FLAG_PF_IMMEDIATE, /* 1<<6 0x40 - private6 */
+ P_POSTCOMP = SUB_FLAG_PF_POSTCOMP, /* 1<<7 0x80 - private7 */
+ P_INIT = SUB_COMP_FLAG_PF_INIT, /* 1<<10 0x400 - 10 */
+ P_NSENTRY = SUB_COMP_FLAG_NSENTRY, /* 1<<11 0x800 - 11 */
+ P_MANUAL_ARGS = SUB_COMP_FLAG_MANUALARGS /* 1<<12 0x1000 */
} pragma_enum_t;
typedef struct pcc_sub_t {
View
1  include/parrot/sub.h
@@ -68,6 +68,7 @@ typedef enum {
SUB_COMP_FLAG_BIT_11 = SUB_FLAG(11),
SUB_COMP_FLAG_NSENTRY = SUB_COMP_FLAG_BIT_11,
SUB_COMP_FLAG_BIT_12 = SUB_FLAG(12),
+ SUB_COMP_FLAG_MANUALARGS = SUB_COMP_FLAG_BIT_12,
SUB_COMP_FLAG_BIT_13 = SUB_FLAG(13),
SUB_COMP_FLAG_BIT_14 = SUB_FLAG(14),
SUB_COMP_FLAG_BIT_15 = SUB_FLAG(15),

No commit comments for this range

Something went wrong with that request. Please try again.