PageRenderTime 77ms CodeModel.GetById 36ms app.highlight 0ms RepoModel.GetById 40ms app.codeStats 0ms

/source/core/ast/Return.ooc

http://github.com/nddrylliog/oc
Unknown | 20 lines | 12 code | 8 blank | 0 comment | 0 complexity | c15cf40f7069ef4ecd9482ef5ef1aee9 MD5 | raw file
 1
 2import Statement, Expression
 3
 4import middle/Resolver
 5
 6Return: class extends Statement {
 7
 8    expr: Expression { get set }
 9
10    init: func (=expr) {}
11
12    resolve: func (task: Task) {
13        if(expr) task queue(expr)
14    }
15
16    toString: func -> String {
17        expr ? "return " + expr toString() : "return"
18    }
19
20}