charly-lang / charly

🐈 The Charly Programming Language | Written by @KCreate
https://charly-lang.github.io/charly/
MIT License
199 stars 10 forks source link

Share trace entries across included files. #143

Closed KCreate closed 7 years ago

KCreate commented 7 years ago

main.ch

func foo() {
  require("./extern.ch")
}

foo()

extern.ch

func bar() {
  throw 2
}

bar()

Will output the following trace log:

./extern.ch
      1. func bar() {
->    2.   throw 2
      3. }
      4.
      5. bar()
at bar (extern.ch:5:1:3)
Uncaught 2

The complete trace stack from the first file is not passed to the second file. Sharing a common context object would solve this issue.