←back to thread

180 points xnacly | 1 comments | | HN request time: 0s | source
Show context
socalgal2 ◴[] No.44566606[source]
I'm sorry I only skimmed but, how to do report line,col numbers for errors?
replies(1): >>44575215 #
pkaye ◴[] No.44575215[source]
What I've done in my own implementation is include the line and column number in the token.
replies(1): >>44575873 #
1. socalgal2 ◴[] No.44575873[source]
Yea, that's what I assumed too but the article didn't include them and I assumed it was for speed reasons. I've run into this often where some idealized version doesn't take into account usage ergonomics. A compiler that can't tell me where an error is is not a useful compiler to me so if this lexer doesn't support that then it won't actually be a net positive in development speed for me. I fail compilation more often than I succeed.