Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler freeze linked to macro and strutils.replace (or at least strings) #13

Closed
ddlsmurf opened this issue Feb 7, 2011 · 1 comment

Comments

@ddlsmurf
Copy link
Contributor

ddlsmurf commented Feb 7, 2011

import macros, strutils
macro mac(n: expr): expr =
  expectKind(n, nnkCall)
  expectLen(n, 2)
  expectKind(n[1], nnkStrLit)
  var s : string = n[1].strVal
  s = s.replace("l", "!!") # <--- Offending line right here people
  result = newStrLitNode("Your value sir: '$#'" % [s])

const s = mac("HEllo World")
echo s
@Araq
Copy link
Member

Araq commented Mar 8, 2011

closed by 6d46609; closed by 6d46609

ddlsmurf pushed a commit to ddlsmurf/Nimrod that referenced this issue Jan 21, 2012
reactormonk pushed a commit to reactormonk/nim that referenced this issue Apr 7, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants