vishapoberon / compiler

vishap oberon compiler
http://oberon.vishap.am
GNU General Public License v3.0
186 stars 25 forks source link

failure to handle comments #30

Open norayr opened 8 years ago

norayr commented 8 years ago
IF prev = 3AX (* : *) THEN
                    ^
pos  1956  err 100  incompatible operands of dyadic operator
dcwbrown commented 8 years ago

I assume that the operands of '=' are incompatible? Basically the compiler records the position of the first symbol after the error (THEN in this case) and displays the error pointer one char earlier. (The comment is not a symbol.)

Another error position issue I've seen is that an error in expr in WHILE expr DO statements END is shown at the end of the statements rather than at the end of the expression.

I spent long enough looking at the position recording code to decide that it needed a few days of intense analysis to fix overall.