compiler: remove custom logic for util
builtins
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
6fe8f4565d
commit
a92bf281c1
5 changed files with 19 additions and 21 deletions
|
@ -17,7 +17,7 @@ var (
|
|||
goBuiltins = []string{"len", "append", "panic", "make", "copy", "recover", "delete"}
|
||||
// Custom builtin utility functions.
|
||||
customBuiltins = []string{
|
||||
"Abort", "FromAddress", "Equals", "Remove",
|
||||
"FromAddress",
|
||||
"ToBool", "ToBytes", "ToString", "ToInteger",
|
||||
}
|
||||
)
|
||||
|
@ -376,7 +376,7 @@ func canConvert(s string) bool {
|
|||
// canInline returns true if function is to be inlined.
|
||||
// Currently there is a static list of function which are inlined,
|
||||
// this may change in future.
|
||||
func canInline(s string) bool {
|
||||
func canInline(s string, name string) bool {
|
||||
if strings.HasPrefix(s, "github.com/nspcc-dev/neo-go/pkg/compiler/testdata/inline") {
|
||||
return true
|
||||
}
|
||||
|
@ -384,5 +384,5 @@ func canInline(s string) bool {
|
|||
return false
|
||||
}
|
||||
return !strings.HasPrefix(s[len(interopPrefix):], "/neogointernal") &&
|
||||
!strings.HasPrefix(s[len(interopPrefix):], "/util")
|
||||
!(strings.HasPrefix(s[len(interopPrefix):], "/util") && name == "FromAddress")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue