Skip to content

Parses invalid code as valid in tuple esque structure #136

Description

@mhanberg

Description

Failing test

code = """
{
  attributes: %{
    "polyline" => Faker.Lorem.characters()
  },
  type: "shape"
}
"""

assert s2q(code) == Spitfire.parse(code)

Fails with

Assertion with == failed
code:  assert s2q(code) == Spitfire.parse(code)
left:  {:error, {[line: 5, column: 16], "syntax error before: ", "eol"}}
right: {
      :ok,
      {
        :{},
        [end_of_expression: [newlines: 1, line: 6, column: 2], newlines: 1, closing: [line: 6, column: 1], line: 1, column: 1],
        [[attributes: {:%{}, [newlines: 1, closing: [line: 4, column: 3], line: 2, column: 15], [{"polyline", {{:., [line: 3, column: 30], [{:__aliases__, [last: [line: 3, column: 25], line: 3, column: 19], [:Faker, :Lorem]}, :characters]}, [closing: [line: 3, column: 42], line: 3, column:
31], []}}]}, type: "shape"]]
      }
    }

Spitfire should report this as an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions