summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorchromatic <chromatic@wgz.org>2008-05-10 05:52:11 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-05-18 21:08:01 +0000
commitbe25f60935927114e0ef411fb4fbc04fea5ce8fa (patch)
tree3ec48b054b9f6867ea11fb40e75da767d5bbaa25 /toke.c
parente385c3bfc8853b925197cc2ddff78a11bae595e5 (diff)
downloadperl-be25f60935927114e0ef411fb4fbc04fea5ce8fa.tar.gz
Add ..., !!!, and ??? operators
Message-Id: <200805101252.11961.chromatic@wgz.org> p4raw-id: //depot/perl@33858
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index 2a63a90a8b..bc559ae30f 100644
--- a/toke.c
+++ b/toke.c
@@ -368,6 +368,7 @@ static struct debug_tokens {
{ WHEN, TOKENTYPE_IVAL, "WHEN" },
{ WHILE, TOKENTYPE_IVAL, "WHILE" },
{ WORD, TOKENTYPE_OPVAL, "WORD" },
+ { YADAYADA, TOKENTYPE_IVAL, "YADAYADA" },
{ 0, TOKENTYPE_NONE, NULL }
};
@@ -4774,6 +4775,10 @@ Perl_yylex(pTHX)
pl_yylval.ival = 0;
OPERATOR(ASSIGNOP);
case '!':
+ if (PL_expect == XSTATE && s[1] == '!' && s[2] == '!') {
+ s += 3;
+ LOP(OP_DIE,XTERM);
+ }
s++;
{
const char tmp = *s++;
@@ -5025,10 +5030,14 @@ Perl_yylex(pTHX)
AOPERATOR(DORDOR);
}
case '?': /* may either be conditional or pattern */
- if(PL_expect == XOPERATOR) {
+ if (PL_expect == XSTATE && s[1] == '?' && s[2] == '?') {
+ s += 3;
+ LOP(OP_WARN,XTERM);
+ }
+ if (PL_expect == XOPERATOR) {
char tmp = *s++;
if(tmp == '?') {
- OPERATOR('?');
+ OPERATOR('?');
}
else {
tmp = *s++;
@@ -5067,6 +5076,10 @@ Perl_yylex(pTHX)
PL_expect = XSTATE;
goto rightbracket;
}
+ if (PL_expect == XSTATE && s[1] == '.' && s[2] == '.') {
+ s += 3;
+ OPERATOR(YADAYADA);
+ }
if (PL_expect == XOPERATOR || !isDIGIT(s[1])) {
char tmp = *s++;
if (*s == tmp) {