fizzbee-io / fizzbee

Easiest-ever formal methods language! Designed for developers crafting distributed systems, microservices, and cloud applications
https://fizzbee.io
Apache License 2.0
150 stars 8 forks source link

Set error linenumbers in the stacktrace #52

Closed jp-fizzbee closed 4 months ago

jp-fizzbee commented 4 months ago

This not the perfect solution though.

For example: for this code,

action Init:
  val = 0

atomic action Next:
  print(1,
        y,
       x)

The variables y and x are not defined. So, the error trace would look like,

E0623 01:29:13.795345   65903 starlark.go:34] Error executing stmt: filename.fizz:2:9: undefined: y
panic: Between Lines 5 and 7: Error executing statement: print(1,
        y,
       x)

On the first line, the actual error is present, but the linenumber and filename is incorrect. The second line has the correct line numbers, and the actual code that caused the error.

These will be fixed and cleaned up eventually.