VM and compiler update (#63)
* renamed test folders and fixed bug where wrong jump labels would be exectuted for rewrite. * Added support for Osize (len(string)) and factored out the array tests * Added current instruction number to VM prompt if program is loaded. * added support for unary expressions. * updated README of and sorted the help commands * updated readme of the compiler * bumped version -> 0.39.0
This commit is contained in:
parent
83e467e527
commit
941bd7e728
19 changed files with 475 additions and 292 deletions
|
@ -72,6 +72,9 @@ func (e *Element) BigInt() *big.Int {
|
|||
// Bool attempts to get the underlying value of the element as a boolean.
|
||||
// Will panic if the assertion failed which will be catched by the VM.
|
||||
func (e *Element) Bool() bool {
|
||||
if v, ok := e.value.Value().(*big.Int); ok {
|
||||
return v.Int64() == 1
|
||||
}
|
||||
return e.value.Value().(bool)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue