martinohmann / hcl-rs

HCL parsing and encoding libraries for rust with serde support
Apache License 2.0
122 stars 13 forks source link

parser panics instead of returning an error #284

Closed theKlisha closed 1 year ago

theKlisha commented 1 year ago

Provided code snippet causes panic.

let str = r#"
  locals {
    test = {
      a = b// this comment breaks the parser
      c = d // but this one doesn't
    }
  }
"#;

let _: Result<hcl::Body, _> = hcl::from_str(str);

tested on version 0.16.3

martinohmann commented 1 year ago

Hi there!

Thanks for the bug report and the reproducer.

I'm trying to get this fixed with the next release but it may take a couple of days since i just moved to a new home and still need to unpack stuff in order to set up my workspace again 😉.

martinohmann commented 1 year ago

@theKlisha Got to it earlier than expected. I just released the fix as 0.16.4.

theKlisha commented 1 year ago

Thanks for the fix!