Add a slice.suffix method.

This commit is contained in:
Nigel Tao committed 2017-09-22 14:12:54 +10:00
1 parent 51f2b183a2
commit 2fb9972bb9
10 files changed
+176 -2

No files matched your search

+8
View File
@@ -760,6 +760,14 @@ func isIsErrorOKSuspension(tm *t.Map, n *a.Expr, methodName t.Key) bool {
return n.ID0().Key() == t.KeyDot && n.ID1().Key() == methodName
}
func isIsPrefixSuffix(tm *t.Map, n *a.Expr, methodName t.Key) bool {
if n.ID0().Key() != t.KeyOpenParen || n.CallImpure() || len(n.Args()) != 1 {
return false
}
n = n.LHS().Expr()
return n.ID0().Key() == t.KeyDot && n.ID1().Key() == methodName
}
func isSetLiteralWidth(tm *t.Map, n *a.Expr) bool {
// TODO: check that n.Args() is "(lw:bar)".
if n.ID0().Key() != t.KeyOpenParen || n.CallImpure() || len(n.Args()) != 1 {