From e81a3e6df54842b5a836dad7055a4295cf4155bc Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 20 Sep 2019 22:03:37 +0900 Subject: Allows calling a private method only with bare `self` --- parse.y | 2 ++ 1 file changed, 2 insertions(+) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 03db19f2cf..a51328cdce 100644 --- a/parse.y +++ b/parse.y @@ -2595,6 +2595,7 @@ primary : literal | tLPAREN_ARG stmt {SET_LEX_STATE(EXPR_ENDARG);} rparen { /*%%%*/ + if (nd_type($2) == NODE_SELF) $2->nd_state = 0; $$ = $2; /*% %*/ /*% ripper: paren!($2) %*/ @@ -2602,6 +2603,7 @@ primary : literal | tLPAREN compstmt ')' { /*%%%*/ + if (nd_type($2) == NODE_SELF) $2->nd_state = 0; $$ = $2; /*% %*/ /*% ripper: paren!($2) %*/ -- cgit v1.2.3