From d9ab13970f7d5be31fa23f6fd3ee10d4956aad79 Mon Sep 17 00:00:00 2001 From: Sawyer X Date: Tue, 31 May 2022 13:02:16 +0200 Subject: [PATCH] GH #112: Support "readline STDIN": This includes "readline(STDIN)". --- lib/Guacamole.pm | 4 +++- .../OpUnaryKeywordExpr/OpKeywordReadlineExpr.t | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 t/Statements/Expressions/OpUnaryKeywordExpr/OpKeywordReadlineExpr.t diff --git a/lib/Guacamole.pm b/lib/Guacamole.pm index ea11891..c4b84de 100644 --- a/lib/Guacamole.pm +++ b/lib/Guacamole.pm @@ -1125,7 +1125,9 @@ OpKeywordReadExpr ::= OpKeywordRead OpListKeywordArg OpKeywordReaddirExpr ::= OpKeywordReaddir OpUnaryKeywordArg -OpKeywordReadlineExpr ::= OpKeywordReadline OpUnaryKeywordArg +OpKeywordReadlineExpr ::= OpKeywordReadline LParen BuiltinFilehandle RParen + | OpKeywordReadline BuiltinFilehandle + | OpKeywordReadline OpUnaryKeywordArg | OpKeywordReadline OpKeywordReadlinkExpr ::= OpKeywordReadlink OpUnaryKeywordArg diff --git a/t/Statements/Expressions/OpUnaryKeywordExpr/OpKeywordReadlineExpr.t b/t/Statements/Expressions/OpUnaryKeywordExpr/OpKeywordReadlineExpr.t new file mode 100644 index 0000000..4b525ec --- /dev/null +++ b/t/Statements/Expressions/OpUnaryKeywordExpr/OpKeywordReadlineExpr.t @@ -0,0 +1,11 @@ +use strict; +use warnings; +use Guacamole::Test; + +parses('readline;'); +parses('readline();'); +parses('readline STDIN;'); +parses('readline (STDIN);'); +parses('readline(STDIN);'); + +done_testing();