4 ms·
I'll try to find an example of the syntax error I was mentioning, but I regularly trip up the parser with dumb mistakes which cause it to give completely useles
by xavxav 4y ago
I'll try to find an example of the syntax error I was mentioning, but I regularly trip up the parser with dumb mistakes which cause it to give completely useless errors.
> Syntax errors are caught well by the parser which tells you exactly where they are.
They aren't necessarily caused where the actual error is, just wherever the parser gets stuck, and the error it produces is usually not reflective of the human thought process that went in, but rather the automata's state.
- yawaramin 4y agoWould be interesting to see such an error, but also what's interesting to me is that you are regularly making 'dumb' syntax mistakes, which suggests to me that you're still in the learning process and that you'll internalize the syntax more fully and stop making those mistakes some time in the future.
- xavxav 4y agoNot really, it's more that I regularly make typos in all forms of writing (even handwritten). It's not usually misspellings but rather whole lexemes that go missing or are swapped. fwiw, I TA a course taught (partially) in OCaml and work regularly with a large OCaml project as part of my thesis. Parser generator errors are just a personal pet peeve of mine, I grew up with (mega)parsec (Haskell), where decent errors are out-of-the-box and great ones are easy.
- belmont_sup 4y agoPartially agree here with the syntax error thread in that it’s mildly annoying to lose intellisense when you’re declaring a new variable before the “in” keyword is in place. But that’s about the only time I commonly see syntax errors.