greptilian logo

IRC log for #sourcefu, 2018-11-10

http://sourcefu.com

| Channels | #sourcefu index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
14:31 pdurbin prologic (and others, aditsu maybe): any thoughs on lexers and parsers? Please see https://gitter.im/open-source-society/computer-science?at=5be6d1a42138723405e545e7
14:37 aditsu I'm probably the wrong person to ask about "best practice", but I think the lexer should go ballistic when it finds an error, unless you want to report multiple errors in one file
22:43 prologic pdurbin aditsu lexers do not generally report errors
22:43 prologic they usually have very little context except the token and source position
22:44 prologic best practices normally  dictate the lexer capture not only the token stream but the position in the source including line number and column
22:44 prologic this is so that the parser can accurately report on parsing errors
22:45 aditsu prologic: what it the lexer is getting something that can't be a token?
22:45 prologic the only type of error a lexer *can*/*should* report is "invalid token on line x, column y" but beyond that any other kind of error is either impossible or useless
22:45 prologic ^^^
22:45 prologic you didn't let me finish :)
22:45 aditsu well, of course, that's what it would report
22:46 prologic but that's the only error it should report on :)
22:46 aditsu sure
22:46 prologic lexers are pretty dumb really
22:46 prologic _some_ language implemtnations skip lexing altogether

| Channels | #sourcefu index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

http://sourcefu.com