Here: 
    
    
    template lineNim: int = instantiationInfo().line
    
    proc main =
      echo "Nim line: ", lineNim
      
      var lineC: int
      {.emit: "`lineC` = __LINE__;".}
      echo "C line: ", lineC
      
      {.emit: "#define foo(s) #s".}
      
      var stuff: cstring
      {.emit: "`stuff` = foo(thisIsTheArgument);".}
      echo stuff
    
    main()
    

Reply via email to