Skip to content

Apparent unmatched double quote in Clojure-style output #1505

Open
@rebcabin

Description

@rebcabin

This command (compiling tests/expr7.py)

("/Users/brian/Documents/GitHub/lpython/src/bin/lpython"
 "-I/Users/brian/Documents/GitHub/lpython/src/runtime/ltypes/ltypes.py"
 "--show-asr"
 "--no-color"
 "--with-intrinsic-mods"
 "/Users/brian/Documents/GitHub/lpython/tests/expr7.py")

produces the following sub-form, which has (apparently) an unmatched double-quote in it, right after the ! character:

(StringConstant " !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" (Character 1 97 () []))

it probably should be

(StringConstant " !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" (Character 1 97 () []))

with the double-quote escaped.

HOWEVER

This issue, #1505, corrected or not, raises Issue #1420 to BLOCKER status, because the colon embedded in the string constant gets caught by my ad-hoc, regex-based keyword patcher. I don't know any easy way to match foobar: but not " !\"#$%&...789:;<=...". My ad-hoc, regex-based keyword patcher correctly changes foobar: to :foobar, but incorrectly reorders the string constant from

" !\"#$%&...789:;<=..."

to

" :!\"#$%&...789;<=...".

With this issue, #1505, UN-corrected, my ad-hoc, regex-based keyword patch changes

" !"#$%&...789:;<=..."

to

" :!"#$%&...789:;<=..."

which has an illegal Clojure reader macro, #$%&... in it.

Suffice it to say that Issue #1420 and this issue, #1505, are now both BLOCKERs.

SUPPLEMENTARY SCREEN SHOT

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    asrASR related changesbugSomething isn't workingeasy to fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions