mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
compiler: allow to use init
function
Process `init()` functions after global variables has been processed. It's body is saved into the `_initialize` method where all initialization is performed.
This commit is contained in:
parent
ef53a45e7a
commit
b771d2d024
3 changed files with 101 additions and 14 deletions
|
@ -48,6 +48,7 @@ func (c *codegen) traverseGlobals() int {
|
|||
}
|
||||
emit.Instruction(c.prog.BinWriter, opcode.INITSSLOT, []byte{byte(n)})
|
||||
c.ForEachFile(c.convertGlobals)
|
||||
c.ForEachFile(c.convertInitFuncs)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue