mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Remove the return error "foo" special case.
This commit is contained in:
1 parent
7cefcccc98
commit
4b572702f9
4 files changed
+25
-78
No files matched your search
+4
-10
@@ -481,22 +481,16 @@ func NewIf(condition *Expr, elseIf *If, bodyIfTrue []*Node, bodyIfFalse []*Node)
|
||||
}
|
||||
}
|
||||
|
||||
// Return is "return LHS", "return error ID1" or "return suspension ID1":
|
||||
// - ID0: <0|IDError|IDSuspension>
|
||||
// - ID1: message
|
||||
// Return is "return LHS":
|
||||
// - LHS: <nil|Expr>
|
||||
type Return Node
|
||||
|
||||
func (n *Return) Node() *Node { return (*Node)(n) }
|
||||
func (n *Return) Keyword() t.ID { return n.id0 }
|
||||
func (n *Return) Message() t.ID { return n.id1 }
|
||||
func (n *Return) Value() *Expr { return n.lhs.Expr() }
|
||||
func (n *Return) Node() *Node { return (*Node)(n) }
|
||||
func (n *Return) Value() *Expr { return n.lhs.Expr() }
|
||||
|
||||
func NewReturn(keyword t.ID, message t.ID, value *Expr) *Return {
|
||||
func NewReturn(value *Expr) *Return {
|
||||
return &Return{
|
||||
kind: KReturn,
|
||||
id0: keyword,
|
||||
id1: message,
|
||||
lhs: value.Node(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user