Skip to content

Renderer doesn't escape/quote symbols when it should #19735

@yglukhov

Description

@yglukhov
import macros

macro dumpRepr(u: typed) =
  echo repr u

template decl(a: untyped) =
  proc `a @ procName`(`a @ param`: int) = discard

dumpRepr:
  decl(hi)

Actual output:

proc hi@procName(a@param`gensym0: int) =
  discard

Expected output:

proc `hi@procName`(`a@param'`'gensym0`: int) =
  discard
$ nim -v
Nim Compiler Version 1.7.1 [Linux: amd64]
Compiled at 2022-04-19
Copyright (c) 2006-2022 by Andreas Rumpf

git hash: dc4cc2dca53e3772efb3654a4ddbbe8350d1db43
active boot switches: -d:release

Metadata

Metadata

Assignees

No one assigned

    Labels

    AST RendererIssues related to the compiler turning AST back into Nim code as a string.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions