arturo-lang / arturo

Simple, expressive & portable programming language for efficient scripting
http://arturo-lang.io
MIT License
700 stars 32 forks source link

[Errors] Line number messed up at start of block #1610

Open github-actions[bot] opened 5 months ago

github-actions[bot] commented 5 months ago

[Errors] Line number messed up at start of block let's say we do

do [
print 3/0

]

The line of the error will be messed up. This wouldn't happen if it was the second command within that block. (And I have no idea / don't remember) why this could be happening... (Nor is it necessarily related to the evaluator)

https://github.com/arturo-lang/arturo/blob/68e7f804ae1fa26e7f7fdf414d23ba78f9ed260c/src/vm/eval.nim#L404

        it.addByte(op)

    # TODO(Errors) Line number messed up at start of block
    #  let's say we do 
    #  ```
    #  do [
    #      print 3/0
    #
    #  ]
    #  ```
    #  The line of the error will be messed up. This wouldn't happen if it was
    #  the second command within that block. (And I have no idea / don't remember)
    #  why this could be happening... (Nor is it necessarily related to the evaluator)
    #  labels: error handling, bug, evaluation, ast
    template addEol(n: untyped): untyped =
        it.addOpWithNumber(opEol, n, hasShortcut=false)

ndex 5336e6d17f..4b9661fc97 100644
++ b/version/build

2f03119448b89e8723b16aafce6e2dcc9052212a