Skip to content

repr produces invalid code #14598

Open
Open
@timotheecour

Description

repr produces invalid code

Example

import macros
macro mdbg(a): untyped =
  echo a.repr
  parseStmt(a.repr)

mdbg:
  let a = 1e1000000'f32

Current Output

let a = inf'f32
macros.nim(566, 14) Error: missing closing ' for character literal [ValueError]

Expected Output

works

Additional Information

I encountered this while working on a megatest for isMainModule blocks, which gathers isMainModule blocks from input files using parseStmt + repr (more details on this later)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions