# Fix source module of a variable created with syntax

**URL:** <https://racket.discourse.group/t/fix-source-module-of-a-variable-created-with-syntax/3770>\
**Category:** Questions & Answers\
**Created:** [June 3, 2025, 4:01pm UTC](https://racket.discourse.group/t/fix-source-module-of-a-variable-created-with-syntax/3770 "2025-06-03T16:01:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [June 3, 2025, 4:01pm UTC](https://racket.discourse.group/t/fix-source-module-of-a-variable-created-with-syntax/3770/1 "2025-06-03T16:01:01Z")

</div>

hello,

i have a hard question , not even sure it can be done, i parse some superscript character and create variable from the token i get with this code:

```scheme
(datum->syntax #'superscript-parser (string->symbol p-tok))

```

all works well at REPL, but in some code below i got an error:

 ![Capture d’écran de 2025-06-03 17-41-03](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/d/d35480cf28b11a919f72da640cfabc71d5c41b16.jpeg)

the problem is that the variable z which should be only one are in fact from 2 modules ,the REPL and the other from the parser, i do not know how i can fix this easily. (it is in syntax transformer context, i have plan to port code parsing completely outside macro expansion, this would solve those problems and allow 100% Qi compatibility that made its own parsing too)

z should be from this "lexical scope" highlighted below:

 ![Capture d’écran de 2025-06-03 17-47-30](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/0/0af36a9d0b8559dcc4c6c5e9e178468db9a16acf.jpeg)

note if i define z , not like `{z <- 1.13+1.765i}` but `(define z 1.13+1.765i)` the problem is the same, i just defined it in infix to show the syntax location.

the more fun is that if wrote this code it works:

```scheme
#lang reader SRFI-105 ; SRFI-105 Curly-infix-expressions

(module repl racket

  (provide (all-defined-out)) 
  (require Scheme+)
  
  ;; put your code here or simply use the REPL
  {z <- 1.13+1.765i}
  (define n 2)
  ;;{n ᶻ}
  ;;{n ** z}
  {n ¹⸱¹³⁺¹⸱⁷⁶⁵ᶦ}
  )

```

```scheme
0.7450965706579622+2.057849829037449i

```

because the complex number `¹⸱¹³⁺¹⸱⁷⁶⁵ᶦ` is well parsed and as it is a numerical constant its value is **independant** of the environment or source location it belongs from.
