uqbar-project / wollok

Wollok Programming Language
GNU General Public License v3.0
61 stars 16 forks source link

Unclear Error `missing RULE_ID` when catch argument is missing #1876

Open alete89 opened 4 years ago

alete89 commented 4 years ago

the following block will raise missing RULE_ID at '{' Error in Problems.

object wollok {
    method testing() {
        try {
            // something
        } catch {   }
    }
}

It could be improved to something like: catch argument is missing or argument is missing if it's used in similar structures.

also this (javascript like) :

try {
} catch (e) { }

will raise extraneous input '(' expecting RULE_ID and no viable alternative at input ')' I think the first one could be changed to extraneous input '(' expecting argument , reference or something like that.

fdodino commented 4 years ago

@alete89 , ok, fijate si podés capturar los mensajes del parser. No es fácil poder resolverlo puntualmente para los catch y que no encaje en otro patrón similar.