summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-29 15:09:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-29 15:27:59 +0900
commit2ed68d0ff9a932efbc4393c869534040dec8f647 (patch)
tree60a21a02ebbc9ae018125c7a46e714e571845151 /parse.y
parent893900dc7876596fab0e488affddf3abcb510445 (diff)
Revert "Add pipeline operator [Feature #15799]"
This reverts commits: * d365fd5a024254d7c105a62a015a7ea29ccf3e5d * d780c3662484d6072b3a6945b840049de72c2096 * aa7211836b769231a2a8ef6b6ec2fd0ec882ef29 * 043f010c28e82ea38978bf8ed885416f133b5b75 * bb4dd7c6af05c7821d572e2592ea3d0cc748d81f * 043f010c28e82ea38978bf8ed885416f133b5b75 * f169043d81524b5b529f2c1e9c35437ba5bc3a7a http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/94645
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y42
1 files changed, 2 insertions, 40 deletions
diff --git a/parse.y b/parse.y
index ade2e0a941..694db6ba9b 100644
--- a/parse.y
+++ b/parse.y
@@ -1009,7 +1009,7 @@ static void token_info_warn(struct parser_params *p, const char *token, token_in
%type <node> literal numeric simple_numeric ssym dsym symbol cpath
%type <node> top_compstmt top_stmts top_stmt begin_block
%type <node> bodystmt compstmt stmts stmt_or_begin stmt expr arg primary command command_call method_call
-%type <node> expr_value expr_value_do arg_value primary_value fcall rel_expr pipeline
+%type <node> expr_value expr_value_do arg_value primary_value fcall rel_expr
%type <node> if_tail opt_else case_body case_args cases opt_rescue exc_list exc_var opt_ensure
%type <node> args call_args opt_call_args
%type <node> paren_args opt_paren_args args_tail opt_args_tail block_args_tail opt_block_args_tail
@@ -1067,7 +1067,6 @@ static void token_info_warn(struct parser_params *p, const char *token, token_in
%token <id> tANDDOT RUBY_TOKEN(ANDDOT) "&."
%token <id> tCOLON2 RUBY_TOKEN(COLON2) "::"
%token <id> tMETHREF RUBY_TOKEN(METHREF) ".:"
-%token tPIPE RUBY_TOKEN(PIPE) "|>"
%token tCOLON3 ":: at EXPR_BEG"
%token <id> tOP_ASGN "operator-assignment" /* +=, -= etc. */
%token tASSOC "=>"
@@ -1103,7 +1102,6 @@ static void token_info_warn(struct parser_params *p, const char *token, token_in
%nonassoc modifier_if modifier_unless modifier_while modifier_until
%left keyword_or keyword_and
%right keyword_not
-%left tPIPE
%nonassoc keyword_defined
%right '=' tOP_ASGN
%left modifier_rescue
@@ -1512,37 +1510,6 @@ expr : command_call
$$ = call_uni_op(p, method_cond(p, $2, &@2), '!', &@1, &@$);
}
| arg
- | pipeline
- ;
-
-pipeline : expr tPIPE operation opt_paren_args
- {
- /*%%%*/
- $$ = new_command_qcall(p, ID2VAL(idPIPE), $1, $3, $4, Qnull, &@3, &@$);
- /*% %*/
- /*% ripper: command_call!($1, ID2VAL(idPIPE), $3, $4) %*/
- }
- | expr tPIPE operation opt_paren_args brace_block
- {
- /*%%%*/
- $$ = new_command_qcall(p, ID2VAL(idPIPE), $1, $3, $4, $5, &@3, &@$);
- /*% %*/
- /*% ripper: method_add_block!(command_call!($1, ID2VAL(idPIPE), $3, $4), $5) %*/
- }
- | expr tPIPE operation command_args
- {
- /*%%%*/
- $$ = new_command_qcall(p, ID2VAL(idPIPE), $1, $3, $4, Qnull, &@3, &@$);
- /*% %*/
- /*% ripper: command_call!($1, ID2VAL(idPIPE), $3, $4) %*/
- }
- | expr tPIPE operation command_args do_block
- {
- /*%%%*/
- $$ = new_command_qcall(p, ID2VAL(idPIPE), $1, $3, $4, $5, &@3, &@$);
- /*% %*/
- /*% ripper: method_add_block!(command_call!($1, ID2VAL(idPIPE), $3, $4), $5) %*/
- }
;
expr_value : expr
@@ -8710,11 +8677,10 @@ parser_yylex(struct parser_params *p)
case '\13': /* '\v' */
space_seen = 1;
break;
- case '|':
case '&':
case '.': {
dispatch_delayed_token(p, tIGNORED_NL);
- if (c == '|' ? peek(p, '>') : (peek(p, '.') == (c == '&'))) {
+ if (peek(p, '.') == (c == '&')) {
pushback(p, c);
dispatch_scan_event(p, tSP);
goto retry;
@@ -8989,10 +8955,6 @@ parser_yylex(struct parser_params *p)
SET_LEX_STATE(EXPR_BEG);
return tOP_ASGN;
}
- if (c == '>') {
- SET_LEX_STATE(EXPR_DOT);
- return tPIPE;
- }
SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
pushback(p, c);
return '|';