From 63b9e3c524eacad178f9f21d5fe91406029f0ce8 Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Mon, 16 Mar 2020 16:13:38 +0100 Subject: [PATCH] skip comments in lists --- src/hcl/parser.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/hcl/parser.py b/src/hcl/parser.py index df0a208..9f987a6 100644 --- a/src/hcl/parser.py +++ b/src/hcl/parser.py @@ -463,6 +463,16 @@ def p_listitems_4(self, p): p[2].insert(0, p[1]) p[0] = p[2] + def p_listitems_5(self, p): + ''' + listitems : listitems COMMA COMMENT + | listitems COMMA MULTICOMMENT + ''' + # skip comments in lists + if DEBUG: + self.print_p(p) + p[0] = p[1] + def p_listitem_0(self, p): ''' listitem : number