Skip to content

Supporting heredoc #7

@munjalpatel

Description

@munjalpatel

Hey @drowzy,

I am trying to parse a config with heredoc like this:

action "transform_data" {
  js = <<-EOT
    const output = { ...input, x: 1 };
    return output;
  EOT
}

But it is failing with the following error:

** (FunctionClauseError) no function clause matching in HXL.Error.upcase_first/1

    The following arguments were given to HXL.Error.upcase_first/1:

        # 1
        'syntax error before: '

    Attempted function clauses (showing 1 out of 1):

        defp upcase_first(<<char::utf8, rest::binary>>)

    (hxl 0.1.2) lib/hxl/error.ex:37: HXL.Error.upcase_first/1
    (hxl 0.1.2) lib/hxl/error.ex:24: HXL.Error.format_reason/1
    (hxl 0.1.2) lib/hxl/parser.ex:21: HXL.Parser.parse/1
    (hxl 0.1.2) lib/hxl.ex:95: HXL.decode/2
    (hxl 0.1.2) lib/hxl.ex:25: HXL.decode_file/2
    iex:3: (file)

Is parsing HCL that contains heredoc supported?
If not, are there any potential workarounds?

BTW, this is a great library, excellent work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions