mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 08:47:28 +01:00
Add io_bind history_position arg
This commit is contained in:
1 parent
b60a2cacd9
commit
28a54baa19
11 files changed
+87
-24
No files matched your search
+11
-8
@@ -583,26 +583,29 @@ func NewField(flags Flags, name t.ID, xType *TypeExpr) *Field {
|
||||
}
|
||||
}
|
||||
|
||||
// IOBind is "io_bind (io:LHS, data:MHS) { List2 }" or "io_limit (io:LHS,
|
||||
// limit:MHS) { List2 }":
|
||||
// IOBind is "io_bind (io:LHS, data:MHS, history_position:RHS) { List2 }" or
|
||||
// "io_limit (io:LHS, limit:MHS) { List2 }":
|
||||
// - ID0: <IDIOBind|IDIOLimit>
|
||||
// - LHS: <Expr>
|
||||
// - MHS: <Expr>
|
||||
// - RHS: <Expr>
|
||||
// - List2: <Statement> body
|
||||
type IOBind Node
|
||||
|
||||
func (n *IOBind) AsNode() *Node { return (*Node)(n) }
|
||||
func (n *IOBind) Keyword() t.ID { return n.id0 }
|
||||
func (n *IOBind) IO() *Expr { return n.lhs.AsExpr() }
|
||||
func (n *IOBind) Arg1() *Expr { return n.mhs.AsExpr() }
|
||||
func (n *IOBind) Body() []*Node { return n.list2 }
|
||||
func (n *IOBind) AsNode() *Node { return (*Node)(n) }
|
||||
func (n *IOBind) Keyword() t.ID { return n.id0 }
|
||||
func (n *IOBind) IO() *Expr { return n.lhs.AsExpr() }
|
||||
func (n *IOBind) Arg1() *Expr { return n.mhs.AsExpr() }
|
||||
func (n *IOBind) HistoryPosition() *Expr { return n.rhs.AsExpr() }
|
||||
func (n *IOBind) Body() []*Node { return n.list2 }
|
||||
|
||||
func NewIOBind(keyword t.ID, io *Expr, arg1 *Expr, body []*Node) *IOBind {
|
||||
func NewIOBind(keyword t.ID, io *Expr, arg1 *Expr, historyPosition *Expr, body []*Node) *IOBind {
|
||||
return &IOBind{
|
||||
kind: KIOBind,
|
||||
id0: keyword,
|
||||
lhs: io.AsNode(),
|
||||
mhs: arg1.AsNode(),
|
||||
rhs: historyPosition.AsNode(),
|
||||
list2: body,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user