lib/parser/statements/VariableStatement.js
function VariableStatement(name) {
    var bracketIndex = name.indexOf('(');
    if (bracketIndex !== -1) {
        var endBracketIndex = name.indexOf(')');
        if (endBracketIndex === -1) throw new SyntaxError('Expected end bracket');

        var arrayName = name.substring(0, bracketIndex);
        var arrayDimensionsText = name.substring(bracketIndex + 1, endBracketIndex).trim();
        var arrayDimensions = new statements.ArgumentStatement(arrayDimensionsText);

        name = arrayName;
        this.isArray = true;
        this.dimensions = arrayDimensions.args;
    } else this.isArray = false;

    if (name[name.length - 1] === '$') {
        this.type = 'string';
        this.name = name.substring(0, name.length - 1);
    } else {
        this.type = 'number';
        this.name = name;
    }
}
function VariableStatement(name) {
    var bracketIndex = name.indexOf('(');
    if (bracketIndex !== -1) {
        var endBracketIndex = name.indexOf(')');
        if (endBracketIndex === -1) throw new SyntaxError('Expected end bracket');

        var arrayName = name.substring(0, bracketIndex);
        var arrayDimensionsText = name.substring(bracketIndex + 1, endBracketIndex).trim();
        var arrayDimensions = new statements.ArgumentStatement(arrayDimensionsText);

        name = arrayName;
        this.isArray = true;
        this.dimensions = arrayDimensions.args;
    } else this.isArray = false;

    if (name[name.length - 1] === '$') {
        this.type = 'string';
        this.name = name.substring(0, name.length - 1);
    } else {
        this.type = 'number';
        this.name = name;
    }
}
function VariableStatement ( name ) { var bracketIndex = name . indexOf ( '(' ) ; if ( bracketIndex !== - 1 ) { var endBracketIndex = name . indexOf ( ')' ) ; if ( endBracketIndex === - 1 ) throw new SyntaxError ( 'Expected end bracket' ) ; var arrayName = name . substring ( 0 , bracketIndex ) ; var arrayDimensionsText = name . substring ( bracketIndex + 1 , endBracketIndex ) . trim ( ) ; var arrayDimensions = new statements . ArgumentStatement ( arrayDimensionsText ) ; name = arrayName ; this . isArray = true ; this . dimensions = arrayDimensions . args ; } else this . isArray = false ; if ( name [ name . length - 1 ] === '$' ) { this . type = 'string' ; this . name = name . substring ( 0 , name . length - 1 ) ; } else { this . type = 'number' ; this . name = name ; } }
Represents a variable

@param {String} name The name of the variable
Represents a variable