Blame view

js/lib/JSBuilder/src/Parser/Statement/Elseif.js 557 Bytes
16035364   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Parser.Statement.Elseif = Ext.extend(Parser.Statement.If, {
    isEnd: function(line, stream) {
        var statement,
            isEnd = false;

        statement = Parser.parseStatement(line);

        if (statement) {
            if (statement.type === 'elseif' || statement.type === 'else') {
                isEnd = true;
            }
        } else if (this.parent.isEnd.apply(this.parent, arguments)) {
            isEnd = true;
        }

        if (isEnd) {
            stream.goBack(line.length + 1);
        }

        return isEnd;
    }
});