Hacker News new | comments | show | ask | jobs | submit login
Show HN: Visualize positions of a string (github.com)
17 points by Thimo 1425 days ago | hide | past | web | 6 comments | favorite



You shouldn't be using character offsets when parsing HTML or XML...


Your lexer emits buffer positions which you then put into error/diagnostic messages. Afaict, this tool makes it easier to visualize cursor positions in buffers. Personally, I'm not sure about its approach but it's not an unreasonable goal.


I parsed many strings from a website today. These strings were created by a user. So they didn't have a structure. It seemed easier to search for some keyword (like €/$) and extract substrings than writing a grammar. Working with positions can be compilcated, so I created this little tool to visualize it and make it a bit more easy and to save some time.


Simple, but i think it would be very useful to teach substring to very young programmer. Thanks, starred for future purpose.



Looks like a good and simple tool. In some cases it's just easier and faster to work with buffer positions. I can be tricky though.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: