Compiler update (#21)

* added seperate folders for cmd packages.

* Fix netmodes in test + reverse bigint bytes

* glide get deps

* add, sub, mul, div

* booleans

* strings

* binary expressions

* if statements

* function calls

* composite literals (slice, array)

* Added lots of test cases and update readme.
This commit is contained in:
Anthony De Meulemeester 2018-02-15 16:35:49 +01:00 committed by GitHub
parent f7d57e4e49
commit b257a06f3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 1253 additions and 494 deletions

View file

@ -45,8 +45,12 @@ func Uint256DecodeFromBytes(b []byte) (Uint256, error) {
// ToArrayReverse return a reversed version of the given byte slice.
func ToArrayReverse(b []byte) []byte {
dest := make([]byte, len(b))
// Protect from big.Ints that have 1 len bytes.
if len(b) < 2 {
return b
}
dest := make([]byte, len(b))
for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
dest[i], dest[j] = b[j], b[i]
}