Arc Forumnew | comments | leaders | submitlogin
Ask AF: What is the location in arc error messages?
6 points by kinnard 75 days ago | 3 comments
What is the location in arc error messages?

eg: `pipeline.arc::1830: read: expected a closing "`

Is it a reference to character 1830?



6 points by rocketnia 75 days ago | link

Yeah, that 1830 is the number of characters since the start of the stream, like you say. (I think it's specifically 1 plus the number of bytes, as documented at [1].)

Racket errors tend to report whatever location information they can, and Racket ports track four things: The name of the file, the line number, the column number, and the overall position in the stream. But line-counting isn't enabled by default on Racket streams, so the error you see doesn't contain the line number information.

I just pushed a commit[2] to Anarki that enables line-counting on the stream when an Arc files is loaded, which should mean you can now see the line and column of a reader error. A reader error on line 17, column 6 should now be printed like so:

  sample-file.arc:17:6: read: expected a closing "
[1] (https://docs.racket-lang.org/reference/linecol.html#(def._((...)

[2] https://github.com/arclanguage/anarki/commit/208620eca083650...

-----

4 points by zck 69 days ago | link

What a nice change! Super glad to have this.

-----

4 points by kinnard 74 days ago | link

Wow.

-----