uqbar-project / wollok

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

Enhance parser messages #1238

Closed fdodino closed 7 years ago

fdodino commented 7 years ago

I received today a mail from a student, reporting this code in a describe.wtest file

class Presentacion {
    var fecha
    var locacion
    var participantes

    constructor(_fecha, _locacion,_parcipantes) {
        fecha = _fecha locacion = _locacion participantes = _parcipantes 
    }

    method cuandoFue() = fecha
    method dondeFue() = locacion
    method quienParcitipo() = participantes
} 

const trioAlegriaEnElLuna = new Presentacion (new Date (20,04,2017),"lunaPark","joaquin,lucia,luisAlberto")

Obviously, there is no "describe" or "method" or "class" or "object" container to declare a reference. Wollok now reports: "You should declare references before constructors, methods and tests." (in spanish, because it is i18nized) Instead it should warn "You should declare references only inside a class, object, describe, fixture, test or method" or just "You should not declare references outside a container". Now I'm working on parser messages, so I assigned myself.

fdodino commented 7 years ago

issue1238