[bitbake-devel,dunfell,1.46,6/8] pyshyacc: allow double COMMA statements

Submitted by Steve Sakoman on July 15, 2020, 2:26 p.m. | Patch ID: 174456

Details

Message ID 85a499f8915dd6596d56808e6e1c536015e4eb34.1594822992.git.steve@sakoman.com
State New
Headers show

Commit Message

Steve Sakoman July 15, 2020, 2:26 p.m.
From: Konrad Weihmann <kweihmann@outlook.com>

this allows shell statements like '; ;' to pass the parser.
As it may be bad code but still valid enough to execute

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b7732b1b5085bea73e17d112e1bd9ac3d4dc34fb)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 lib/bb/pysh/pyshyacc.py | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/lib/bb/pysh/pyshyacc.py b/lib/bb/pysh/pyshyacc.py
index de565dc9..924860a6 100644
--- a/lib/bb/pysh/pyshyacc.py
+++ b/lib/bb/pysh/pyshyacc.py
@@ -570,6 +570,7 @@  def p_linebreak(p):
 
 def p_separator_op(p):                 
     """separator_op : COMMA
+                    | COMMA COMMA
                     | AMP"""
     p[0] = p[1]