Skip to content

Importing JSON as Facts does not escape correctly #3

@petithug

Description

@petithug

Describe the bug

When loading a JSON file that contains strings with single quote (section 1.3 of "A Guide to ERGOAI Packages"), the quote is not escaped.

To Reproduce

// The file test.json contains: {"a":"blah's"}

ergo> 'test.json'[parse2file('test.ergo')]@\json.

Yes

ergo> [test].

++Warning[GPP]: /tmp/test.ergo:4: input ended while scanning a comment/string: perhaps missing a quote character somewhere above the indicated line.

++Error[Ergo]> [test.ergo] near line(2)/char(19) `s'
unexpected operand:
',', '.', or some other operator may be missing just before the indicated location

++1 error

++compilation aborted

Expected behavior

The single quote should be escaped.

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