virtuald / pyhcl

HCL is a configuration language. pyhcl is a python parser for it.
Mozilla Public License 2.0
336 stars 60 forks source link

Parser debug hard-coded to on since "export comments" merged. #66

Closed fred-vogt closed 4 years ago

fred-vogt commented 4 years ago

It would seem that optional export code comments left debug=True when parsing.

65 fixes it.

def parse(self, s):
      return self.yacc.parse(s, lexer=Lexer())
# => 
def parse(self, s, export_comments=None):
    return self.yacc.parse(s, lexer=Lexer(export_comments=export_comments), debug=True)

Workaround

Use version 0.4.0 or older.

requirements.txt:

pyhcl==0.4.0

Output

PLY: PARSE DEBUG START

State  : 0
Stack  : . LexToken(IDENTIFIER,'...',...)
Action : Shift and goto state 7
robeden commented 4 years ago

@virtuald - This can be closed. Looks like it was fixed in PR #65.