hsp/compiler/treebuilder/syntaxTree.js
function (description, errdesc) {

        //TODO: errdesc is a bit vague
        var desc = {
            description : description
        };
        if (errdesc) {
            if (errdesc.line) { // Integers
                desc.line = errdesc.line;
                desc.column = errdesc.column;
            }
            if (errdesc.code) { // String
                desc.code = errdesc.code;
            }
            if (errdesc.suberrors) { // Array of String
                desc.suberrors = errdesc.suberrors;
            }
        }
        this.errors.push(desc);
    }
function (description, errdesc) {

        //TODO: errdesc is a bit vague
        var desc = {
            description : description
        };
        if (errdesc) {
            if (errdesc.line) { // Integers
                desc.line = errdesc.line;
                desc.column = errdesc.column;
            }
            if (errdesc.code) { // String
                desc.code = errdesc.code;
            }
            if (errdesc.suberrors) { // Array of String
                desc.suberrors = errdesc.suberrors;
            }
        }
        this.errors.push(desc);
    }
function ( description , errdesc ) { //TODO: errdesc is a bit vague var desc = { description : description } ; if ( errdesc ) { if ( errdesc . line ) { // Integers desc . line = errdesc . line ; desc . column = errdesc . column ; } if ( errdesc . code ) { // String desc . code = errdesc . code ; } if ( errdesc . suberrors ) { // Array of String desc . suberrors = errdesc . suberrors ; } } this . errors . push ( desc ) ; }
Adds an error to the current error list.
@param {String} description the error description
@param {Object} errdesc additional object (block, node, ...) which can contain additional info about the error (line/column number, code).
Adds an error to the current error list .